Skip to content

Commit a79e3e9

Browse files
manylinux image build
1 parent d9622a0 commit a79e3e9

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/_linux-build.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,9 @@ jobs:
214214
run: |
215215
START_TIME=$(date +%s)
216216
217+
if [[ ${BUILD_ENVIRONMENT} == *"s390x"* !! ${BUILD_ENVIRONMENT} == *"ppc64le"* ]]; then
217218
JENKINS_USER=
218-
USED_IMAGE=pytorch/ubippc64le-builder:cpu-ppc64le-main
219+
USED_IMAGE="${DOCKER_IMAGE_S390X}"
219220
# ensure that docker container cleanly exits in 12 hours
220221
# if for some reason cleanup action doesn't stop container
221222
# when job is cancelled
@@ -224,7 +225,11 @@ jobs:
224225
# since some steps are skipped on s390x, if they are necessary, run them here
225226
env | grep '^GITHUB' >> "/tmp/github_env_${GITHUB_RUN_ID}"
226227
env | grep '^CI' >> "/tmp/github_env_${GITHUB_RUN_ID}"
227-
228+
else
229+
JENKINS_USER="--user jenkins"
230+
USED_IMAGE="${DOCKER_IMAGE}"
231+
DOCKER_SHELL_CMD=
232+
fi
228233
229234
# Leaving 1GB for the runner and other things
230235
TOTAL_AVAILABLE_MEMORY_IN_GB=$(awk '/MemTotal/ { printf "%.3f \n", $2/1024/1024 - 1 }' /proc/meminfo)
@@ -235,9 +240,9 @@ jobs:
235240
# detached container should get cleaned up by teardown_ec2_linux
236241
# Used for JENKINS_USER and DOCKER_SHELL_CMD, which can be empty
237242
# shellcheck disable=SC2086
238-
docker run --rm \
239-
-e BUILD_ENVIRONMENT \
240-
-e MAX_JOBS="$(nproc --ignore=2)" \
243+
container_name=$(docker run \
244+
-e BUILD_ENVIRONMENT \
245+
-e MAX_JOBS="$(nproc --ignore=2)" \
241246
-e AWS_DEFAULT_REGION \
242247
-e PR_NUMBER \
243248
-e SHA1 \
@@ -253,14 +258,20 @@ jobs:
253258
-e HUGGING_FACE_HUB_TOKEN \
254259
-e SCRIBE_GRAPHQL_ACCESS_TOKEN \
255260
-e USE_SPLIT_BUILD \
261+
--memory="${TOTAL_AVAILABLE_MEMORY_IN_GB%.*}g" \
262+
--memory-swap="${TOTAL_MEMORY_WITH_SWAP}g" \
256263
--env-file="/tmp/github_env_${GITHUB_RUN_ID}" \
257264
--security-opt seccomp=unconfined \
258265
--cap-add=SYS_PTRACE \
259266
--tty \
267+
--detach \
260268
${JENKINS_USER} \
261269
-v "${GITHUB_WORKSPACE}:/var/lib/jenkins/workspace" \
262270
-w /var/lib/jenkins/workspace \
263-
pytorch/ubippc64le-builder:cpu-ppc64le-main .ci/pytorch/build.sh
271+
"${USED_IMAGE}" \
272+
${DOCKER_SHELL_CMD}
273+
)
274+
docker exec -t "${container_name}" sh -c '.ci/pytorch/build.sh'
264275
265276
END_TIME=$(date +%s)
266277
echo "build_time=$((END_TIME - START_TIME))" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)