Skip to content

Commit a3f1ca8

Browse files
lc5211The tunix Authors
authored andcommitted
[Tunix] Move out Docker files to the root directory
PiperOrigin-RevId: 830613217
1 parent f974645 commit a3f1ca8

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

tunix/Dockerfile renamed to Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2424
RUN python3.12 -m venv /opt/venv
2525
ENV PATH="/opt/venv/bin:$PATH"
2626

27-
# Upgrade pip
28-
RUN pip install --upgrade pip
2927

3028
RUN pip install git+https://github.com/ayaka14732/jax-smi.git
3129
RUN pip install git+https://github.com/AI-Hypercomputer/pathways-utils.git

tunix/build_docker.sh renamed to build_docker.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
set -e
1111

1212
DOCKERFILE=./Dockerfile
13-
BUILD_ARGS=""
13+
14+
if [ ! -f "$DOCKERFILE" ]; then
15+
echo "Error: Dockerfile not found at $DOCKERFILE"
16+
exit 1
17+
fi
1418

1519
export LOCAL_IMAGE_NAME=tunix_base_image
1620
echo "Building base image: $LOCAL_IMAGE_NAME"
@@ -23,16 +27,16 @@ export DOCKER_BUILDKIT=1
2327
echo "Starting to build your docker image. This will take a few minutes but the image can be reused as you iterate."
2428

2529
build_ai_image() {
26-
if [[ -z ${LOCAL_IMAGE_NAME+x} ]]; then
27-
echo "Error: LOCAL_IMAGE_NAME is unset, please set it!"
28-
exit 1
29-
fi
3030
COMMIT_HASH=$(git rev-parse --short HEAD)
3131
echo "Building Tunix Image at commit hash ${COMMIT_HASH}..."
3232

33-
sudo docker build \
33+
DOCKER_COMMAND="docker"
34+
if ! docker info >/dev/null 2>&1; then
35+
DOCKER_COMMAND="sudo docker"
36+
fi
37+
38+
$DOCKER_COMMAND build \
3439
--network=host \
35-
${BUILD_ARGS} \
3640
-t ${LOCAL_IMAGE_NAME} \
3741
-f ${DOCKERFILE} .
3842
}
@@ -44,4 +48,4 @@ echo "*************************
4448
"
4549

4650
echo "Built your docker image and named it ${LOCAL_IMAGE_NAME}.
47-
It only has the dependencies installed. "
51+
It only has the dependencies installed. "

0 commit comments

Comments
 (0)