Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-24.04
os: ubuntu-26.04
tools:
python: "3.12"

Expand Down
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Target with dependencies and the binaries to run the complete flow
FROM openroad/flow-dev
FROM openroad/flow-ubuntu26.04-dev:latest

WORKDIR /OpenROAD-flow-scripts

# synthesis tools binaries and plugins
COPY --from=openroad/yosys /install ./tools/install/yosys
# Flow tools built for the same Ubuntu release as the runtime image.
COPY --from=openroad/flow-ubuntu26.04-tools:latest \
/OpenROAD-flow-scripts/tools/install ./tools/install

# openroad binary
COPY --from=openroad/ubuntu22.04-builder-gcc \
/OpenROAD/install/bin/openroad \
./tools/install/OpenROAD/bin/openroad
# OpenROAD binary and its installed libraries.
COPY --from=openroad/ubuntu26.04:latest \
/OpenROAD/install ./tools/install/OpenROAD

# flow files
COPY ./env.sh .
COPY ./flow ./flow

# avoid issues with permissions
RUN chmod o+rw -R /OpenROAD-flow-scripts
# Allow users of the image to write flow results.
RUN chmod -R a+rwX /OpenROAD-flow-scripts/flow
2 changes: 1 addition & 1 deletion docker/Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# NOTE: don't use this file directly unless you know what you are doing,
# instead use etc/DockerHelper.sh

ARG fromImage=openroad/flow-ubuntu22.04-dev:latest
ARG fromImage=openroad/flow-ubuntu26.04-dev:latest
# Image holding the prebuilt tools/install of every tool except OpenROAD
# (a build of the orfs-tools target). By default they are built here.
ARG toolsImage=orfs-tools
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.claude
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Usage: see claude.sh at the repo root.

ARG fromImage=openroad/flow-ubuntu22.04-dev:latest
ARG fromImage=openroad/flow-ubuntu26.04-dev:latest

FROM ${fromImage}

Expand Down
8 changes: 5 additions & 3 deletions docker/claude-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ if [ -n "${HOST_UID}" ] && [ -n "${HOST_GID}" ]; then

# Create user (reuse existing if UID is taken)
if ! getent passwd "${HOST_UID}" > /dev/null 2>&1; then
mkdir -p "${USER_HOME}"
useradd \
--uid "${HOST_UID}" \
--gid "${HOST_GID}" \
Expand All @@ -34,15 +33,18 @@ if [ -n "${HOST_UID}" ] && [ -n "${HOST_GID}" ]; then
"${USER_NAME}"
else
USER_NAME=$(getent passwd "${HOST_UID}" | cut -d: -f1)
USER_HOME=$(getent passwd "${HOST_UID}" | cut -d: -f6)
usermod --home "${USER_HOME}" "${USER_NAME}"
fi
Comment thread
vvbandeira marked this conversation as resolved.
Resolved

# Passwordless sudo
echo "${USER_NAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/claude-user
chmod 0440 /etc/sudoers.d/claude-user

# The engine creates .cache as root when it mounts .cache/bazel.
# Bazelisk writes to .cache/bazelisk, so the user owns .cache too.
mkdir -p "${USER_HOME}/.cache"
export HOME="${USER_HOME}"
chown "${HOST_UID}:${HOST_GID}" "${USER_HOME}"
chown "${HOST_UID}:${HOST_GID}" "${USER_HOME}" "${USER_HOME}/.cache"
touch "${USER_HOME}/.hushlogin"

# Set up ORFS environment (PATH to tools, FLOW_HOME, etc.)
Expand Down
60 changes: 60 additions & 0 deletions docker/test-claude-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
set -euo pipefail

if [[ "${1:-}" == --assert ]]; then
if [[ "${HOME}" != /home/claude-user ]]; then
echo "HOME=${HOME}, expected /home/claude-user" >&2
exit 1
fi
test "$(id -u)" = "$2"
account_home=$(getent passwd "$2" | cut -d: -f6)
if [[ "${account_home}" != "${HOME}" ]]; then
echo "Account home=${account_home}, HOME=${HOME}" >&2
exit 1
fi
test "$(cat "${HOME}/.claude/settings.json")" = fixture
echo updated > "${HOME}/.claude/settings.json"
# Bazelisk downloads Bazel into ~/.cache/bazelisk.
mkdir "${HOME}/.cache/bazelisk"
echo "UID $2 reads and writes settings through HOME"
echo "UID $2 creates ~/.cache/bazelisk next to the mounted Bazel cache"
exit 0
fi

if [[ "${1:-}" == --inside ]]; then
uid=$2
gid=$3
if [[ "$4" == existing ]]; then
getent passwd "${uid}" > /dev/null
mkdir -p "$(getent passwd "${uid}" | cut -d: -f6)"
else
if getent passwd "${uid}" > /dev/null; then
echo "Fixture UID ${uid} must be unused" >&2
exit 1
fi
fi
mkdir -p /home/claude-user/.claude /etc/sudoers.d
echo fixture > /home/claude-user/.claude/settings.json
chown -R "${uid}:${gid}" /home/claude-user/.claude
# claude.sh mounts the Bazel cache here; the engine leaves .cache owned by root.
mkdir -p /home/claude-user/.cache/bazel
chown "${uid}:${gid}" /home/claude-user/.cache/bazel
export HOST_UID=${uid} HOST_GID=${gid}
exec bash /test/claude-entrypoint.sh bash /test/test-claude-entrypoint.sh --assert "${uid}"
fi

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONTAINER_ENGINE="${CONTAINER_ENGINE:-docker}"
TEST_IMAGE="${TEST_IMAGE:-openroad/flow-ubuntu26.04-dev:latest}"

for fixture in '1000 1000 existing' '2000 2000 new'; do
read -r uid gid state <<< "${fixture}"
"${CONTAINER_ENGINE}" run --rm --platform linux/amd64 \
--network none --user 0:0 \
--cap-drop ALL --cap-add CHOWN --cap-add SETUID --cap-add SETGID --cap-add DAC_OVERRIDE \
--security-opt no-new-privileges \
--cpus 2 --memory 4g --pids-limit 256 \
--volume "${SCRIPT_DIR}:/test:ro" \
--entrypoint bash "${TEST_IMAGE}" \
/test/test-claude-entrypoint.sh --inside "${uid}" "${gid}" "${state}"
done
2 changes: 1 addition & 1 deletion docs/user/BuildLocally.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ up the environment. The `make` command runs from RTL-GDSII generation for defaul
``` shell
source ./env.sh
yosys -help
yosys -m slang -p "slang_version"
yosys -p "slang_version"
openroad -help
cd flow
make
Expand Down
11 changes: 9 additions & 2 deletions docs/user/BuildWithDocker.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,20 @@ You can start the container in an interactive mode using
the command below.

```shell
docker run -it ubuntu:22.04
docker run -it ubuntu:26.04
```

Now you are ready to install the prebuilt binaries.
Please refer to the instructions for installing prebuilt binaries
[here](./BuildWithPrebuilt.md).

The root `Dockerfile` assembles a runtime image from the published Ubuntu 26.04 development image, flow tools, and OpenROAD installation.
Build it without compiling the tools:

```shell
docker build -t openroad/orfs-local .
```

### Build Using Docker from sources

Alternatively, if you would like the latest commits from the OpenROAD repositories,
Expand Down Expand Up @@ -85,7 +92,7 @@ Then, inside docker:
``` shell
source ./env.sh
yosys -help
yosys -m slang -p "slang_version"
yosys -p "slang_version"
openroad -help
cd flow
make
Expand Down
8 changes: 4 additions & 4 deletions docs/user/BuildWithPrebuilt.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from [OpenROAD VaultLink](https://vaultlink.precisioninno.com/).
Thanks to [Precision Innovations](https://precisioninno.com/) for hosting and maintaining these binaries.

Pre-built binaries are available for these platforms:
- Ubuntu 22.04
- Ubuntu 26.04
- Ubuntu 24.04

Use the following steps to download:
Expand All @@ -27,10 +27,10 @@ Step 1: Open [OpenROAD VaultLink](https://vaultlink.precisioninno.com/).
Step 2: Download the `.deb` package for your Ubuntu version.

Step 3: Install the package with `apt`.
For example, on Ubuntu 22.04:
For example, on Ubuntu 26.04:

```shell
sudo apt install ./openroad_<version>_amd64-ubuntu-22.04.deb
sudo apt install ./openroad_<version>_amd64-ubuntu-26.04.deb
```

## Verify Installation
Expand All @@ -48,7 +48,7 @@ export OPENROAD_EXE=$(command -v openroad)
export YOSYS_EXE=$(command -v yosys)

yosys -help
yosys -m slang -p "slang_version"
yosys -p "slang_version"
openroad -help
cd flow
make
Expand Down
23 changes: 20 additions & 3 deletions docs/user/ClaudeCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ The setup consists of three files:

### `docker/Dockerfile.claude`

Extends the `openroad/flow-ubuntu22.04-dev` base image (which has all
Extends the `openroad/flow-ubuntu26.04-dev` base image (which has all
OpenROAD build dependencies) with:

- Java 21 and Bazelisk (for Bazel 8.x builds)
Expand All @@ -136,8 +136,25 @@ correct ownership on the host. The entrypoint:
2. Sources `env.sh` to set up tool paths, from the start directory if it has one, else from `/workspace`
3. Drops privileges via `setpriv` before running the command

This follows the same pattern as `tools/OpenROAD/etc/docker-entrypoint.sh`
and the `--user` mode in `flow/util/docker_shell`.
The mapped user's account record and `HOME` both use `/home/claude-user`.
This keeps the settings and cache mounts visible when the base image already has an account with the host UID.

Run the entrypoint regression check in disposable containers:

```shell
bash docker/test-claude-entrypoint.sh
```

With Podman:

```shell
CONTAINER_ENGINE=podman bash docker/test-claude-entrypoint.sh
```

The check covers an existing UID and a new UID.
It verifies that the launched command can read and write fixture settings through `HOME`.
It also checks that the account's recorded home matches `HOME`.
It also checks that the user can create `~/.cache/bazelisk` beside the mounted Bazel cache.

### `claude.sh`

Expand Down