File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2424RUN python3.12 -m venv /opt/venv
2525ENV PATH="/opt/venv/bin:$PATH"
2626
27- # Upgrade pip
28- RUN pip install --upgrade pip
2927
3028RUN pip install git+https://github.com/ayaka14732/jax-smi.git
3129RUN pip install git+https://github.com/AI-Hypercomputer/pathways-utils.git
Original file line number Diff line number Diff line change 1010set -e
1111
1212DOCKERFILE=./Dockerfile
13- BUILD_ARGS=" "
13+
14+ if [ ! -f " $DOCKERFILE " ]; then
15+ echo " Error: Dockerfile not found at $DOCKERFILE "
16+ exit 1
17+ fi
1418
1519export LOCAL_IMAGE_NAME=tunix_base_image
1620echo " Building base image: $LOCAL_IMAGE_NAME "
@@ -23,16 +27,16 @@ export DOCKER_BUILDKIT=1
2327echo " Starting to build your docker image. This will take a few minutes but the image can be reused as you iterate."
2428
2529build_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
4650echo " Built your docker image and named it ${LOCAL_IMAGE_NAME} .
47- It only has the dependencies installed. "
51+ It only has the dependencies installed. "
You can’t perform that action at this time.
0 commit comments