Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c387e53

Browse files
committedMay 14, 2025·
add ansible context
1 parent 0d9a2fe commit c387e53

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed
 

‎infra/ansible/build_for_torchprime.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax=docker/dockerfile:1.4
12
ARG python_version=3.10
23
ARG debian_version=bullseye
34

@@ -12,7 +13,7 @@ RUN pip install *.whl
1213
# Install the dependencies including libtpu.
1314
WORKDIR /ansible
1415
RUN pip install ansible
15-
COPY . /ansible
16+
COPY --from=ansible . /ansible
1617

1718
ARG ansible_vars
1819
RUN ansible-playbook -vvv playbook.yaml -e "stage=release" -e "${ansible_vars}" --tags "install_deps"

‎infra/ansible/build_for_torchprime.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ set -ex
44

55
export IMAGE_NAME="gcr.io/tpu-pytorch/for-torchprime-ci:test"
66
export DOCKERFILE_PATH="infra/ansible/build_for_torchprime.Dockerfile"
7-
export CONTEXT_PATH="/tmp/wheels"
7+
export DEFAULT_CONTEXT_PATH="/tmp/wheels"
88

9-
docker build -t "${IMAGE_NAME}" "${CONTEXT_PATH}" -f "${DOCKERFILE_PATH}" --build-arg ansible_vars='{"arch":"amd64","accelerator":"tpu","pytorch_git_rev":"main","xla_git_rev":"foobar","bundle_libtpu":"0","package_version":"2.8","nightly_release":true}' --build-arg python_version=3.10 --build-arg debian_version=bullseye
9+
docker build -t "${IMAGE_NAME}" \
10+
--build-context ansible=infra/ansible \
11+
"${DEFAULT_CONTEXT_PATH}" \
12+
-f "${DOCKERFILE_PATH}" \
13+
--build-arg ansible_vars='{"arch":"amd64","accelerator":"tpu","pytorch_git_rev":"main","xla_git_rev":"foobar","bundle_libtpu":"0","package_version":"2.8","nightly_release":true}' \
14+
--build-arg python_version=3.10 \
15+
--build-arg debian_version=bullseye
1016
docker push "${IMAGE_NAME}"

0 commit comments

Comments
 (0)
Please sign in to comment.