Skip to content

Commit 7274819

Browse files
committed
[build] bump image to v2.5.0 with Codex and Claude CLIs
1 parent 9428c77 commit 7274819

5 files changed

Lines changed: 76 additions & 34 deletions

File tree

AGENTS.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
This repository is a small Docker image build system. The root contains `Dockerfile.cpu` and `Dockerfile.cuda`, which define the CPU and CUDA variants. Shared shell entrypoints, environment setup, and container dotfiles live in `data/`. Operational wrappers live in `scripts/`: `build.sh`, `run.sh`, `exec.sh`, and `image-configs.sh`. Release automation is in `.github/workflows/cd-docker-build-push.yml`.
5+
6+
## Build, Test, and Development Commands
7+
Use the scripts rather than calling long `docker` commands by hand.
8+
9+
- `bash ./scripts/build.sh Dockerfile.cpu`: build the CPU image and print its tag.
10+
- `bash ./scripts/build.sh Dockerfile.cuda`: build the CUDA image using the version values from `scripts/image-configs.sh`.
11+
- `bash ./scripts/run.sh -i jamesnulliu/deeplearning:v2.4.7-cuda12.8.0 --tmp`: start an interactive temporary container.
12+
- `bash ./scripts/run.sh -i <image> -c devbox`: start a named long-lived container.
13+
- `bash ./scripts/exec.sh devbox`: open a shell in an existing container.
14+
15+
## Coding Style & Naming Conventions
16+
Keep Dockerfiles and shell scripts POSIX/Bash-friendly, with one logical step per block and consistent four-space indentation for wrapped commands. Prefer uppercase variable names for exported build configuration (`IMAGE_VERSION`, `CUDA_VERSION`) and lowercase filenames for scripts and data assets. When you change a version, update `scripts/image-configs.sh` first so tags stay consistent.
17+
18+
## Testing Guidelines
19+
There is no automated unit test suite in this repository today. Validation is build-and-smoke-test based: rebuild the affected Dockerfile, start a container, and verify entrypoint behavior plus any installed toolchain changes. For example, after editing `data/env_setup.sh`, run the image and confirm the shell starts cleanly.
20+
21+
## Commit & Pull Request Guidelines
22+
Recent history uses short bracketed prefixes such as `[update]`, `[fix]`, and version-scoped subjects like `[UPDATE][v2.4.5] ...`. Follow that pattern and keep the subject imperative. PRs should state which image variant changed, summarize package/toolchain impact, include the exact build command used for verification, and note any release-tag implications. Do not commit credentials; Docker Hub publishing is handled by GitHub Actions secrets on tagged pushes (`v*`).

Dockerfile.cpu

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ SHELL ["/bin/bash", "-c"]
3030
RUN apt-get update && apt-get upgrade -y && \
3131
apt-get install -y \
3232
apt-utils lsb-release software-properties-common gnupg git acl sed\
33-
vim-gtk3 wget p7zip-full ninja-build curl jq pkg-config ssh ccache \
33+
vim-gtk3 wget p7zip-full ninja-build curl jq nodejs npm pkg-config ssh ccache \
3434
build-essential gdb htop tmux kmod \
3535
libssl-dev && \
3636
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" \
@@ -68,6 +68,10 @@ RUN wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && \
6868
# Install Rust
6969
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
7070

71+
# Install AI coding CLIs
72+
RUN npm install -g @openai/codex @anthropic-ai/claude-code \
73+
&& npm cache clean --force
74+
7175
# Config files
7276
COPY data/vimrc.local /etc/vim/vimrc.local
7377
COPY data/env_setup.sh ${ENV_SETUP_FILE}

Dockerfile.cuda

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ SHELL ["/bin/bash", "-c"]
2929
RUN apt-get update && apt-get upgrade -y && \
3030
apt-get install -y \
3131
apt-utils lsb-release software-properties-common gnupg git acl sed \
32-
vim-gtk3 wget p7zip-full ninja-build curl jq pkg-config ssh ccache \
32+
vim-gtk3 wget p7zip-full ninja-build curl jq nodejs npm pkg-config ssh ccache \
3333
build-essential gdb htop tmux kmod \
3434
libssl-dev && \
3535
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" \
@@ -67,6 +67,10 @@ RUN wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && \
6767
# Install Rust
6868
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
6969

70+
# Install AI coding CLIs
71+
RUN npm install -g @openai/codex @anthropic-ai/claude-code \
72+
&& npm cache clean --force
73+
7074
# Config files
7175
COPY data/vimrc.local /etc/vim/vimrc.local
7276
COPY data/env_setup.sh ${ENV_SETUP_FILE}

scripts/image-configs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
IMAGE_VERSION=2.4.7
1+
IMAGE_VERSION=2.5.0
22
CUDA_VERSION=12.8.0
33
UBUNTU_VERSION=24.04
44
LLVM_VERSION=20

scripts/run.sh

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -e
44
IMAGE_NAME=""
55
CONTAINER_NAME="tmp"
66
TMP="false"
7+
PROXY_URL=""
8+
SYS_ADMIN="false"
79

810
function print_help() {
911
echo "Usage: $0 [options]"
@@ -13,6 +15,8 @@ function print_help() {
1315
echo " -c, --container-name Name of the Docker container (default: tmp)"
1416
echo " --tmp Create a temporary container and attach to it;"
1517
echo " The container would be removed after exit"
18+
echo " --proxy <url> Set http_proxy, https_proxy, and all_proxy"
19+
echo " --sys-admin Add SYS_ADMIN capability to the container"
1620
}
1721

1822
while [[ $# -gt 0 ]]; do
@@ -23,6 +27,10 @@ while [[ $# -gt 0 ]]; do
2327
CONTAINER_NAME="$2"; shift ;;
2428
--tmp)
2529
TMP="true" ;;
30+
--proxy)
31+
PROXY_URL="$2"; shift ;;
32+
--sys-admin)
33+
SYS_ADMIN="true" ;;
2634
-h|--help)
2735
print_help; exit 0 ;;
2836
*)
@@ -32,42 +40,46 @@ while [[ $# -gt 0 ]]; do
3240
shift
3341
done
3442

35-
3643
if [ -z "$IMAGE_NAME" ]; then
3744
echo "[run.sh] ERROR: Image name is required. Use -i or --image-name to specify it."
3845
exit 1
3946
fi
4047

41-
if [ "$TMP" = "true" ]; then
42-
docker run -it --rm \
43-
--name $CONTAINER_NAME \
44-
--gpus all \
45-
--network host \
46-
--shm-size 20G \
47-
--hostname $CONTAINER_NAME \
48-
-v /home:/home \
49-
$IMAGE_NAME /bin/bash
48+
if [ -n "$PROXY_URL" ]; then
49+
PROXY_ARGS=(
50+
-e "http_proxy=$PROXY_URL"
51+
-e "https_proxy=$PROXY_URL"
52+
-e "all_proxy=$PROXY_URL"
53+
)
54+
else
55+
PROXY_ARGS=()
56+
fi
57+
58+
if [ "$SYS_ADMIN" = "true" ]; then
59+
SYS_ADMIN_ARGS=(--cap-add SYS_ADMIN)
5060
else
51-
if [[ "$IMAGE_NAME" == *"cuda"* ]]; then
52-
docker run -td \
53-
--name $CONTAINER_NAME \
54-
--gpus all \
55-
--network host \
56-
--shm-size 20G \
57-
--hostname $CONTAINER_NAME \
58-
-v /home:/home \
59-
$IMAGE_NAME
60-
else
61-
docker run -td \
62-
--name $CONTAINER_NAME \
63-
--network host \
64-
--shm-size 20G \
65-
--hostname $CONTAINER_NAME \
66-
-v /home:/home \
67-
$IMAGE_NAME
68-
fi
69-
docker cp $HOME/.ssh $CONTAINER_NAME:/root/
70-
docker start $CONTAINER_NAME
71-
docker exec $CONTAINER_NAME chown -R root:root /root/.ssh
61+
SYS_ADMIN_ARGS=()
62+
fi
63+
64+
DOCKER_RUN_ARGS=(
65+
--name "$CONTAINER_NAME"
66+
--network host
67+
--shm-size 20G
68+
--hostname "$CONTAINER_NAME"
69+
-v /home:/home
70+
)
71+
72+
if [ "$TMP" = "true" ] || [[ "$IMAGE_NAME" == *"cuda"* ]]; then
73+
DOCKER_RUN_ARGS+=(--gpus all)
7274
fi
7375

76+
DOCKER_RUN_ARGS+=("${PROXY_ARGS[@]}" "${SYS_ADMIN_ARGS[@]}")
77+
78+
if [ "$TMP" = "true" ]; then
79+
docker run -it --rm "${DOCKER_RUN_ARGS[@]}" "$IMAGE_NAME" /bin/bash
80+
else
81+
docker run -td "${DOCKER_RUN_ARGS[@]}" "$IMAGE_NAME"
82+
docker cp "$HOME/.ssh" "$CONTAINER_NAME:/root/"
83+
docker start "$CONTAINER_NAME"
84+
docker exec "$CONTAINER_NAME" chown -R root:root /root/.ssh
85+
fi

0 commit comments

Comments
 (0)