Skip to content

Commit

Permalink
Build with ref
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhao9 committed Sep 28, 2023
1 parent 6e55ffa commit 480353c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-nightly-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
export TODAY=$(date +'%Y%m%d')
export DOCKER_TAG=dev${TODAY}
cd benchmark/docker
docker build . -f torchbench-nightly.dockerfile -t ghcr.io/pytorch/torchbench:${DOCKER_TAG}
echo "Github Ref: ${{ github.ref }}"
docker build . --build-arg TORCHBENCH_BRANCH="${{ github.ref }}" -f torchbench-nightly.dockerfile -t ghcr.io/pytorch/torchbench:${DOCKER_TAG}
docker tag ghcr.io/pytorch/torchbench:${DOCKER_TAG} ghcr.io/pytorch/torchbench:latest
- name: Push docker to remote
if: ${{ env.WITH_PUSH == 'true' }}
Expand Down
6 changes: 5 additions & 1 deletion docker/torchbench-nightly.dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# default base image: xzhao9/gcp-a100-runner-dind:latest
ARG BASE_IMAGE=xzhao9/gcp-a100-runner-dind:latest
ARG TORCHBENCH_BRANCH=main

FROM ${BASE_IMAGE}

ENV CONDA_ENV=torchbench
ENV SETUP_SCRIPT=/workspace/setup_instance.sh

# Setup Conda env and CUDA
RUN git clone https://github.com/pytorch/benchmark /workspace/benchmark
RUN git clone -b ${TORCHBENCH_BRANCH} --single-branch \
https://github.com/pytorch/benchmark /workspace/benchmark

RUN cd /workspace/benchmark && \
. ${SETUP_SCRIPT} && \
python ./utils/python_utils.py --create-conda-env ${CONDA_ENV} && \
Expand Down

0 comments on commit 480353c

Please sign in to comment.