6262 required : true
6363 type : string
6464 description : Docker image to use
65- DOCKER_IMAGE_TAG_PREFIX :
66- required : true
67- type : string
68- description : Docker image tag to use
6965 LIBTORCH_CONFIG :
7066 required : false
7167 type : string
8884 required : true
8985 description : Github Token
9086
91- permissions :
92- id-token : write
93-
9487jobs :
9588 build :
9689 runs-on : ${{ inputs.runner_prefix}}${{ inputs.runs_on }}
@@ -185,7 +178,7 @@ jobs:
185178 fi
186179
187180 - name : Checkout PyTorch to pytorch dir
188- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
181+ uses : actions/checkout@v4
189182 with :
190183 ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
191184 submodules : recursive
@@ -210,43 +203,17 @@ jobs:
210203 { config: "default" },
211204 ]}
212205
213- - name : configure aws credentials
214- id : aws_creds
215- if : ${{ steps.filter.outputs.is-test-matrix-empty == 'False' && inputs.build_environment != 'linux-s390x-binary-manywheel' && inputs.build_environment != 'linux-ppc64le-binary-manywheel' && startsWith(github.event.ref, 'refs/tags/ciflow/') }}
216- uses : aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
217- with :
218- role-to-assume : arn:aws:iam::308535385114:role/gha_workflow_s3_and_ecr_read_only
219- aws-region : us-east-1
220- role-duration-seconds : 18000
221-
222- - name : Build Docker image for ppc64le
223- run : |
224- docker build -f ./pytorch/.ci/docker/manywheel/Dockerfile_ppc64le -t pytorch/manylinuxppc64le-builder:cpu-ppc64le-main .
225- - name : Calculate docker image
226- id : calculate-docker-image
227- if : ${{ steps.filter.outputs.is-test-matrix-empty == 'False' && inputs.build_environment != 'linux-s390x-binary-manywheel' && inputs.build_environment != 'linux-ppc64le-binary-manywheel' }}
228- uses : pytorch/test-infra/.github/actions/calculate-docker-image@main
229- with :
230- # If doing this in main or release branch, use docker.io. Otherwise
231- # use ECR
232- docker-registry : ${{ startsWith(github.event.ref, 'refs/tags/ciflow/') && '308535385114.dkr.ecr.us-east-1.amazonaws.com' || 'docker.io' }}
233- docker-image-name : ${{ inputs.DOCKER_IMAGE }}
234- custom-tag-prefix : ${{ inputs.DOCKER_IMAGE_TAG_PREFIX }}
235- # The build.sh script in this folder is not actually the correct one,
236- # this is just needed for sha calculation
237- docker-build-dir : .ci/docker
238- working-directory : pytorch
239-
240206 - name : Pull Docker image
241207 if : ${{ steps.filter.outputs.is-test-matrix-empty == 'False' && inputs.build_environment != 'linux-s390x-binary-manywheel' && inputs.build_environment != 'linux-ppc64le-binary-manywheel' }}
242208 uses : pytorch/test-infra/.github/actions/pull-docker-image@main
243209 with :
244- docker-image : ${{ steps.calculate-docker-image.outputs.docker-image }}
210+ docker-image : ${{ inputs.DOCKER_IMAGE }}
245211
212+ - name : Build Docker image for ppc64le
213+ run : |
214+ docker build -f ./pytorch/.ci/docker/manywheel/Dockerfile_ppc64le -t pytorch/manylinuxppc64le-builder:cpu-ppc64le-main .
246215 - name : Build PyTorch binary
247216 if : ${{ steps.filter.outputs.is-test-matrix-empty == 'False' }}
248- env :
249- DOCKER_IMAGE : ${{ steps.calculate-docker-image.outputs.docker-image || format('{0}:{1}', inputs.DOCKER_IMAGE, inputs.DOCKER_IMAGE_TAG_PREFIX) }}
250217 run : |
251218 set -x
252219 mkdir -p artifacts/
@@ -273,7 +240,11 @@ jobs:
273240 "${DOCKER_IMAGE}"
274241 )
275242 docker exec -t -w "${PYTORCH_ROOT}" "${container_name}" bash -c "bash .circleci/scripts/binary_populate_env.sh"
276-
243+ if [[ ${BUILD_ENVIRONMENT} == *"aarch64"* ]]; then
244+ docker exec -t "${container_name}" bash -c "source ${BINARY_ENV_FILE} && bash /pytorch/.ci/aarch64_linux/aarch64_ci_build.sh"
245+ else
246+ docker exec -t "${container_name}" bash -c "source ${BINARY_ENV_FILE} && bash /pytorch/.ci/${{ inputs.PACKAGE_TYPE }}/build.sh"
247+ fi
277248
278249 - name : Chown artifacts
279250 if : ${{ steps.filter.outputs.is-test-matrix-empty == 'False' && inputs.build_environment != 'linux-s390x-binary-manywheel' && inputs.build_environment != 'linux-ppc64le-binary-manywheel' }}
@@ -282,7 +253,7 @@ jobs:
282253 # Ensure the working directory gets chowned back to the current user
283254 docker run --rm -v "${RUNNER_TEMP}/artifacts:/v" -w /v "${ALPINE_IMAGE}" chown -R "$(id -u):$(id -g)" .
284255
285- - uses : actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
256+ 286257 if : ${{ steps.filter.outputs.is-test-matrix-empty == 'False' }}
287258 with :
288259 name : ${{ inputs.build_name }}
@@ -301,7 +272,7 @@ jobs:
301272 ALPINE_IMAGE : ${{ inputs.ALPINE_IMAGE }}
302273
303274 - name : Cleanup docker
304- if : always() && ( inputs.build_environment == 'linux-s390x-binary-manywheel' || inputs.build_environment != 'linux-ppc64le-binary-manywheel' )
275+ if : always() && (inputs.build_environment == 'linux-s390x-binary-manywheel' || inputs.build_environment == 'linux-ppc64le-binary-manywheel')
305276 shell : bash
306277 run : |
307278 # on s390x and ppc64le stop the container for clean worker stop
0 commit comments