Skip to content

Commit 311a6a8

Browse files
Merge pull request #435 from puneetmatharu/add-radus-changes
Patch build for internal CI
2 parents 2999b70 + 9c67216 commit 311a6a8

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

ML-Frameworks/pytorch-aarch64/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
# SPDX-License-Identifier: Apache-2.0
55

66
# Specify DOCKER_IMAGE_MIRROR if you want to use a mirror of hub.docker.com
7-
ARG PYTHON_IMAGE=python:3.12-slim
7+
ARG BASE_IMAGE=python:3.12-slim
88
ARG DOCKER_IMAGE_MIRROR=""
99

1010
# ============================
1111
# Workshop
1212
# ============================
13-
FROM ${DOCKER_IMAGE_MIRROR}${PYTHON_IMAGE} AS workshop
13+
FROM ${DOCKER_IMAGE_MIRROR}${BASE_IMAGE} AS workshop
1414

1515
ARG USERNAME
1616
ARG TORCH_WHEEL
@@ -33,6 +33,7 @@ COPY --chown=$DOCKER_USER:$DOCKER_USER welcome.txt /home/$DOCKER_USER/welcome.tx
3333

3434
# Switch to userland
3535
USER $DOCKER_USER
36+
RUN echo "DOCKER_USER=${DOCKER_USER}"
3637
WORKDIR /home/$DOCKER_USER
3738

3839
# Create virtual environment
@@ -68,7 +69,7 @@ COPY --chown=$DOCKER_USER:$DOCKER_USER pytorch/test /home/$DOCKER_USER/pytorch/t
6869
# ============================
6970
# Final flat image
7071
# ============================
71-
FROM ${DOCKER_IMAGE_MIRROR}${PYTHON_IMAGE}
72+
FROM ${DOCKER_IMAGE_MIRROR}${BASE_IMAGE}
7273

7374
ARG USERNAME
7475
ENV DEBIAN_FRONTEND=noninteractive

ML-Frameworks/pytorch-aarch64/dockerize.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ if ! [ -e "$1" ] || ! [ -e "$2" ]; then
2222
exit 1
2323
fi
2424

25+
IMAGE_USERNAME="${USERNAME:-$(. /etc/os-release && echo "$ID")}"
26+
echo "USERNAME=$IMAGE_USERNAME"
27+
2528
docker buildx \
2629
build --load \
2730
-t toolsolutions-pytorch:latest \
2831
--build-context rootdir=../.. \
2932
--build-arg DOCKER_IMAGE_MIRROR \
3033
--build-arg TORCH_WHEEL=$1 \
3134
--build-arg TORCH_AO_WHEEL=$2 \
32-
--build-arg USERNAME=debian \
35+
--build-arg USERNAME="$IMAGE_USERNAME" \
3336
.
3437

3538
[[ $* == *--build-only* ]] && exit 0

ML-Frameworks/utils/git-utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function apply-github-patch {
5757

5858
# Approach #1: Try a simple patch application with 'git am'
5959
_git_with_credentials am --keep-cr "$patch_file" && return 0
60-
git am --abort || true # wokeignore:rule=abort/terminate
60+
_git_with_credentials am --abort || true # wokeignore:rule=abort/terminate
6161

6262
# Approach #2: Try a three-way merge after fetching the parent commit. It can handle
6363
# scenarios in which the context of the patch has moved. However, we need the parent
@@ -68,7 +68,7 @@ function apply-github-patch {
6868
fi
6969
git fetch --no-tags --quiet --depth=2 "$fetch_url" "$2" || true
7070
_git_with_credentials am --3way --keep-cr "$patch_file" && return 0
71-
git am --abort || true # wokeignore:rule=abort/terminate
71+
_git_with_credentials am --abort || true # wokeignore:rule=abort/terminate
7272

7373
# Approach #3: Fall back to GNU 'patch'
7474
patch -p1 < "$patch_file" || return 1

0 commit comments

Comments
 (0)