Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding graviton docker image release #3313

Merged
merged 38 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
500db43
adding graviton docker image
udaij12 Sep 12, 2024
4249135
testing multiplatform ci
udaij12 Sep 13, 2024
f62f158
testing multiplatform ci
udaij12 Sep 13, 2024
b2775eb
testing multiplatform ci
udaij12 Sep 13, 2024
45df794
adding new builder
udaij12 Sep 13, 2024
7619552
removing arm
udaij12 Sep 13, 2024
33cabbc
removing arm
udaij12 Sep 13, 2024
debdb7f
testing arm
udaij12 Sep 13, 2024
1a6d0aa
tests
udaij12 Sep 13, 2024
b8637a3
testing driver command
udaij12 Sep 13, 2024
3244d48
testing driver command
udaij12 Sep 13, 2024
528aff0
testing on newer instance
udaij12 Sep 14, 2024
d43e74e
testing on newer instance
udaij12 Sep 14, 2024
e54ee18
testing newer
udaij12 Sep 14, 2024
b79766d
rm command
udaij12 Sep 14, 2024
76e2a4c
changing platform
udaij12 Sep 15, 2024
61d523e
testing only amd
udaij12 Sep 15, 2024
ea4b4f9
testing both arch
udaij12 Sep 15, 2024
494cff9
testing both arch
udaij12 Sep 15, 2024
97d5c4c
testing both
udaij12 Sep 15, 2024
3a985ab
remove builder
udaij12 Sep 15, 2024
bee430b
remove builder
udaij12 Sep 15, 2024
2e619c2
adding amd
udaij12 Sep 15, 2024
a23b77d
building cache
udaij12 Sep 15, 2024
fead916
cache 3
udaij12 Sep 15, 2024
470b285
cache 4
udaij12 Sep 15, 2024
6bd6511
cache 4
udaij12 Sep 15, 2024
df0a0ef
final test
udaij12 Sep 15, 2024
473c05e
reverting temp changes
udaij12 Sep 15, 2024
06289de
Merge branch 'master' into docker_aarch
agunapal Sep 16, 2024
d6b0f63
testing official release
udaij12 Sep 16, 2024
8600b4c
Merge branch 'docker_aarch' of https://github.com/pytorch/serve into …
udaij12 Sep 16, 2024
e5edd18
testing official release
udaij12 Sep 16, 2024
ec9772f
testing official release
udaij12 Sep 16, 2024
9af2db5
adding kserve changes
udaij12 Sep 16, 2024
7faad18
Merge branch 'master' into docker_aarch
agunapal Sep 16, 2024
385ba55
kserve nightly
udaij12 Sep 16, 2024
6d6bd92
Merge branch 'docker_aarch' of https://github.com/pytorch/serve into …
udaij12 Sep 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/docker-nightly-build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Push Docker Nightly

on:
# run every day at 1:15pm
# Run every day at 1:15pm
schedule:
- cron: "15 13 * * *"
workflow_dispatch:

jobs:
nightly:
runs-on: [self-hosted, ci-gpu]
Expand Down Expand Up @@ -32,12 +33,14 @@ jobs:
- name: Push Docker Nightly
run: |
cd docker
sudo apt-get update
docker buildx use multibuilder
python docker_nightly.py --cleanup
- name: Push KServe Docker Nightly
run: |
cd kubernetes/kserve
docker buildx use multibuilder
python docker_nightly.py --cleanup

- name: Open issue on failure
if: ${{ failure() && github.event_name == 'schedule' }}
uses: dacbd/create-issue-action@v1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/official_release_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ jobs:
if: github.event.inputs.upload_docker == 'yes'
run: |
cd docker
docker buildx use multibuilder
python build_upload_release.py --cleanup
- name: Build & Upload pytorch/torchserve-kfs Docker images
if: github.event.inputs.upload_kfs == 'yes'
run: |
cd kubernetes/kserve
docker buildx use multibuilder
python build_upload_release.py --cleanup
23 changes: 17 additions & 6 deletions docker/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ BUILD_NIGHTLY=false
BUILD_FROM_SRC=false
LOCAL_CHANGES=true
PYTHON_VERSION=3.9
ARCH="linux/arm64,linux/amd64"
MULTI=false

for arg in "$@"
do
Expand Down Expand Up @@ -101,6 +103,10 @@ do
BUILD_CPP=true
shift
;;
-m|--multi)
MULTI=true
shift
;;
-n|--nightly)
BUILD_NIGHTLY=true
shift
Expand Down Expand Up @@ -214,12 +220,17 @@ then
fi
fi

if [ "${BUILD_TYPE}" == "production" ]
then
DOCKER_BUILDKIT=1 docker build --file Dockerfile --build-arg BASE_IMAGE="${BASE_IMAGE}" --build-arg USE_CUDA_VERSION="${CUDA_VERSION}" --build-arg PYTHON_VERSION="${PYTHON_VERSION}"\
--build-arg BUILD_NIGHTLY="${BUILD_NIGHTLY}" --build-arg BRANCH_NAME="${BRANCH_NAME}" --build-arg REPO_URL="${REPO_URL}" --build-arg BUILD_FROM_SRC="${BUILD_FROM_SRC}"\
--build-arg LOCAL_CHANGES="${LOCAL_CHANGES}" -t "${DOCKER_TAG}" --target production-image ../
elif [ "${BUILD_TYPE}" == "ci" ]
if [ "${BUILD_TYPE}" == "production" ]; then
if [ "${MULTI}" == "true" ]; then
DOCKER_BUILDKIT=1 docker buildx build --file Dockerfile --build-arg BASE_IMAGE="${BASE_IMAGE}" --build-arg USE_CUDA_VERSION="${CUDA_VERSION}" --build-arg PYTHON_VERSION="${PYTHON_VERSION}"\
--build-arg BUILD_NIGHTLY="${BUILD_NIGHTLY}" --build-arg BRANCH_NAME="${BRANCH_NAME}" --build-arg REPO_URL="${REPO_URL}" --build-arg BUILD_FROM_SRC="${BUILD_FROM_SRC}"\
--build-arg LOCAL_CHANGES="${LOCAL_CHANGES}" -t "${DOCKER_TAG}" --platform "${ARCH}" --target production-image ../ --push
else
DOCKER_BUILDKIT=1 docker buildx build --file Dockerfile --build-arg BASE_IMAGE="${BASE_IMAGE}" --build-arg USE_CUDA_VERSION="${CUDA_VERSION}" --build-arg PYTHON_VERSION="${PYTHON_VERSION}"\
--build-arg BUILD_NIGHTLY="${BUILD_NIGHTLY}" --build-arg BRANCH_NAME="${BRANCH_NAME}" --build-arg REPO_URL="${REPO_URL}" --build-arg BUILD_FROM_SRC="${BUILD_FROM_SRC}"\
--build-arg LOCAL_CHANGES="${LOCAL_CHANGES}" -t "${DOCKER_TAG}" --target production-image ../ --load
fi
elif [ "${BUILD_TYPE}" == "ci" ];
then
DOCKER_BUILDKIT=1 docker build --file Dockerfile --build-arg BASE_IMAGE="${BASE_IMAGE}" --build-arg USE_CUDA_VERSION="${CUDA_VERSION}" --build-arg PYTHON_VERSION="${PYTHON_VERSION}"\
--build-arg BUILD_NIGHTLY="${BUILD_NIGHTLY}" --build-arg BRANCH_NAME="${BRANCH_NAME}" --build-arg REPO_URL="${REPO_URL}" --build-arg BUILD_FROM_SRC="${BUILD_FROM_SRC}"\
Expand Down
12 changes: 6 additions & 6 deletions docker/build_upload_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
organization = args.organization

# Upload pytorch/torchserve docker binaries
try_and_handle(f"./build_image.sh -t {organization}/torchserve:latest", dry_run)
try_and_handle(f"./build_image.sh -m -t {organization}/torchserve:latest", dry_run)
try_and_handle(
f"./build_image.sh -g -cv cu121 -t {organization}/torchserve:latest-gpu",
dry_run,
Expand All @@ -44,14 +44,17 @@
f"./build_image.sh -bt dev -g -cv cu121 -cpp -t {organization}/torchserve:latest-cpp-dev-gpu",
dry_run,
)

try_and_handle(
f"docker tag {organization}/torchserve:latest {organization}/torchserve:latest-cpu",
f"docker buildx imagetools create --tag {organization}/torchserve:latest-cpu {organization}/torchserve:latest",
dry_run,
)

try_and_handle(
f"docker tag {organization}/torchserve:latest {organization}/torchserve:{check_ts_version()}-cpu",
f"docker buildx imagetools create --tag {organization}/torchserve:{check_ts_version()}-cpu {organization}/torchserve:latest",
dry_run,
)

try_and_handle(
f"docker tag {organization}/torchserve:latest-gpu {organization}/torchserve:{check_ts_version()}-gpu",
dry_run,
Expand All @@ -66,12 +69,9 @@
)

for image in [
f"{organization}/torchserve:latest",
f"{organization}/torchserve:latest-cpu",
f"{organization}/torchserve:latest-gpu",
f"{organization}/torchserve:latest-cpp-dev-cpu",
f"{organization}/torchserve:latest-cpp-dev-gpu",
f"{organization}/torchserve:{check_ts_version()}-cpu",
f"{organization}/torchserve:{check_ts_version()}-gpu",
f"{organization}/torchserve:{check_ts_version()}-cpp-dev-cpu",
f"{organization}/torchserve:{check_ts_version()}-cpp-dev-gpu",
Expand Down
9 changes: 3 additions & 6 deletions docker/docker_nightly.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
cpp_dev_gpu_version = f"{project}:cpp-dev-gpu-{get_nightly_version()}"

# Build Nightly images and append the date in the name
try_and_handle(f"./build_image.sh -n -t {organization}/{cpu_version}", dry_run)
try_and_handle(f"./build_image.sh -m -n -t {organization}/{cpu_version}", dry_run)
try_and_handle(
f"./build_image.sh -g -cv cu121 -n -t {organization}/{gpu_version}",
dry_run,
Expand All @@ -54,18 +54,17 @@
)

# Push Nightly images to official PyTorch Dockerhub account
try_and_handle(f"docker push {organization}/{cpu_version}", dry_run)
try_and_handle(f"docker push {organization}/{gpu_version}", dry_run)
try_and_handle(f"docker push {organization}/{cpp_dev_cpu_version}", dry_run)
try_and_handle(f"docker push {organization}/{cpp_dev_gpu_version}", dry_run)

# Tag nightly images with latest
try_and_handle(
f"docker tag {organization}/{cpu_version} {organization}/{project}:latest-cpu",
f"docker buildx imagetools create --tag {organization}/{project}:latest-cpu {organization}/{cpu_version}",
agunapal marked this conversation as resolved.
Show resolved Hide resolved
dry_run,
)
try_and_handle(
f"docker tag {organization}/{gpu_version} {organization}/{project}:latest-gpu",
f"docker buildx imagetools create --tag {organization}/{project}:latest-gpu {organization}/{gpu_version}",
agunapal marked this conversation as resolved.
Show resolved Hide resolved
dry_run,
)
try_and_handle(
Expand All @@ -78,8 +77,6 @@
)

# Push images with latest tag
try_and_handle(f"docker push {organization}/{project}:latest-cpu", dry_run)
try_and_handle(f"docker push {organization}/{project}:latest-gpu", dry_run)
try_and_handle(f"docker push {organization}/{project}:latest-cpp-dev-cpu", dry_run)
try_and_handle(f"docker push {organization}/{project}:latest-cpp-dev-gpu", dry_run)

Expand Down
12 changes: 11 additions & 1 deletion kubernetes/kserve/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ BASE_IMAGE="pytorch/torchserve:latest-cpu"
DOCKER_FILE="Dockerfile"
BUILD_NIGHTLY=false
USE_CUSTOM_TAG=false
ARCH="linux/arm64,linux/amd64"
MULTI=false

for arg in "$@"
do
Expand Down Expand Up @@ -38,6 +40,10 @@ do
shift
shift
;;
-m|--multi)
MULTI=true
shift
;;
esac
done

Expand All @@ -57,4 +63,8 @@ fi
cp ../../frontend/server/src/main/resources/proto/*.proto .
cp -r ../../third_party .

DOCKER_BUILDKIT=1 docker build --file "$DOCKER_FILE" --build-arg BASE_IMAGE=$BASE_IMAGE -t "$DOCKER_TAG" .
if [ "${MULTI}" == "true" ]; then
DOCKER_BUILDKIT=1 docker buildx build --file "$DOCKER_FILE" --build-arg BASE_IMAGE=$BASE_IMAGE --platform "${ARCH}" -t "$DOCKER_TAG" --push
else
DOCKER_BUILDKIT=1 docker buildx build --file "$DOCKER_FILE" --build-arg BASE_IMAGE=$BASE_IMAGE -t "$DOCKER_TAG" --load
fi
3 changes: 1 addition & 2 deletions kubernetes/kserve/build_upload_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
organization = args.organization

try_and_handle(
f"./build_image.sh -t {organization}/torchserve-kfs:{check_ts_version()}",
f"./build_image.sh -m -t {organization}/torchserve-kfs:{check_ts_version()}",
dry_run,
)
try_and_handle(
Expand All @@ -40,7 +40,6 @@
)

for image in [
f"{organization}/torchserve-kfs:{check_ts_version()}",
f"{organization}/torchserve-kfs:{check_ts_version()}-gpu",
]:
try_and_handle(f"docker push {image}", dry_run)
Expand Down
6 changes: 2 additions & 4 deletions kubernetes/kserve/docker_nightly.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,18 @@
gpu_version = f"{project}:gpu-{get_nightly_version()}"

# Build Nightly images and append the date in the name
try_and_handle(f"./build_image.sh -n -t {organization}/{cpu_version}", dry_run)
try_and_handle(f"./build_image.sh -m -n -t {organization}/{cpu_version}", dry_run)
try_and_handle(
f"./build_image.sh -g -n -t {organization}/{gpu_version}",
dry_run,
)

# Push Nightly images to official PyTorch Dockerhub account
try_and_handle(f"docker push {organization}/{cpu_version}", dry_run)
try_and_handle(f"docker push {organization}/{gpu_version}", dry_run)

# Tag nightly images with latest
try_and_handle(
f"docker tag {organization}/{cpu_version} {organization}/{project}:latest-cpu",
f"docker buildx imagetools create --tag {organization}/{project}:latest-cpu {organization}/{cpu_version}",
dry_run,
)
try_and_handle(
Expand All @@ -58,7 +57,6 @@
)

# Push images with latest tag
try_and_handle(f"docker push {organization}/{project}:latest-cpu", dry_run)
try_and_handle(f"docker push {organization}/{project}:latest-gpu", dry_run)

# Cleanup built images
Expand Down
Loading