Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
33f14f6
comment out something doesn't work for fork
HappyAmazonian Dec 4, 2024
39a9050
use my iam role
HappyAmazonian Dec 4, 2024
c8233a3
add checkout back
HappyAmazonian Dec 4, 2024
b96628b
use my repo
HappyAmazonian Dec 4, 2024
85b15e5
remov ecreate runner
HappyAmazonian Dec 4, 2024
ec5bf65
fix-tag
HappyAmazonian Dec 4, 2024
7505dff
make everything push to ECR
HappyAmazonian Dec 4, 2024
1f17c17
add mode in tag
HappyAmazonian Dec 5, 2024
3a74892
add condition to push
HappyAmazonian Dec 5, 2024
f63a7fe
remove blank lin
HappyAmazonian Dec 5, 2024
8d43fb3
add call integration workflow
HappyAmazonian Dec 6, 2024
2674540
remove push for testing
HappyAmazonian Dec 6, 2024
4133b2e
fix push condition
HappyAmazonian Dec 6, 2024
850a69a
fix repo name
HappyAmazonian Dec 6, 2024
f182852
change repo for testing in djl
HappyAmazonian Dec 6, 2024
6f01ae3
fix role
HappyAmazonian Dec 6, 2024
5ace20e
fix neuron image, disable pytest capture
HappyAmazonian Dec 6, 2024
e974d65
add docker credential
HappyAmazonian Dec 7, 2024
8de85fa
change env
HappyAmazonian Dec 7, 2024
9808a93
fix neuron docker tag
HappyAmazonian Dec 7, 2024
14185c5
add back aarch build
HappyAmazonian Dec 9, 2024
9f4a91a
fix for PR
HappyAmazonian Dec 9, 2024
3dde6de
merge
HappyAmazonian Dec 9, 2024
0adabd0
add back docker push
HappyAmazonian Dec 9, 2024
7a75c66
fix format
HappyAmazonian Dec 9, 2024
c40f9f5
add the missing tag step
HappyAmazonian Dec 10, 2024
9fb5574
reorg
HappyAmazonian Dec 12, 2024
0bc8a25
fix region var
HappyAmazonian Dec 12, 2024
b02ca24
test split push
HappyAmazonian Dec 12, 2024
a0a1b16
fix cli
HappyAmazonian Dec 13, 2024
7dfb9c3
fix syntax + add time
HappyAmazonian Dec 13, 2024
86bd0d9
fix syntax error
HappyAmazonian Dec 13, 2024
c28e392
remove test for faster test
HappyAmazonian Dec 13, 2024
b1b0871
build,test
HappyAmazonian Dec 14, 2024
277483a
fix matrix value
HappyAmazonian Dec 14, 2024
60cd26d
fix push .github/workflows/docker-nightly-publish.yml
HappyAmazonian Dec 14, 2024
45092e4
fix uri tag
HappyAmazonian Dec 14, 2024
66466fd
fix typo
HappyAmazonian Dec 14, 2024
1dd747b
fix aws permisioon
HappyAmazonian Dec 14, 2024
49322cb
add tests back
HappyAmazonian Dec 16, 2024
0374887
fix typo
HappyAmazonian Dec 16, 2024
086065b
add override image suffix in tag
HappyAmazonian Dec 16, 2024
03f6e17
fix neuron image
HappyAmazonian Dec 16, 2024
186e602
fix condition in neuron ut
HappyAmazonian Dec 16, 2024
5d4ac70
fix neuron uri
HappyAmazonian Dec 16, 2024
3949dcc
fix format
HappyAmazonian Dec 16, 2024
bcd3555
clean
HappyAmazonian Dec 16, 2024
5a9f70c
fix based on comment
HappyAmazonian Dec 16, 2024
f396e74
update default arch value
HappyAmazonian Dec 16, 2024
362b812
temp
HappyAmazonian Dec 17, 2024
33ab630
rebase on other pr
HappyAmazonian Dec 17, 2024
74b72fa
test docker publish
HappyAmazonian Dec 17, 2024
53b0d1c
fix permission
HappyAmazonian Dec 17, 2024
26636d7
use sha
HappyAmazonian Dec 17, 2024
468a260
improve scripts
HappyAmazonian Dec 17, 2024
b5eaf03
fix for loop
HappyAmazonian Dec 17, 2024
ea3b518
improve code quality
HappyAmazonian Dec 17, 2024
0faa058
fix path
HappyAmazonian Dec 17, 2024
ab7e10b
fix multiple typo
HappyAmazonian Dec 17, 2024
5761450
merge
HappyAmazonian Dec 18, 2024
ebc7f89
use credential only for ubuntu
HappyAmazonian Dec 18, 2024
cf56d95
enable docker push
HappyAmazonian Dec 18, 2024
c5f0d83
Merge branch 'nightly-integ' into pr_check
HappyAmazonian Dec 18, 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
161 changes: 90 additions & 71 deletions .github/workflows/docker-nightly-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,50 @@ on:
description: 'release/nightly/temp, default is nightly'
required: true
default: 'nightly'
arch:
description: 'which images to build [ cpu, cpu-full, pytorch-inf2, pytorch-gpu, tensorrt-llm, lmi, aarch64]'
type: string
required: false
default: '["cpu", "cpu-full", "pytorch-inf2", "pytorch-gpu", "tensorrt-llm", "lmi", "aarch64"]'
git_ref:
description: 'which commit to build the image with'
type: string
required: false
default: ''
workflow_call:
inputs:
mode:
description: 'release/nightly/temp, default is nightly'
type: string
required: true
default: 'nightly'
schedule:
- cron: '0 13 * * *'

arch:
description: 'which images to build [ cpu, cpu-full, pytorch-inf2, pytorch-gpu, tensorrt-llm, lmi, aarch64]'
type: string
required: false
default: '["cpu", "cpu-full", "pytorch-inf2", "pytorch-gpu", "tensorrt-llm", "lmi", "aarch64"]'
outputs:
djl_version:
description: "djl version"
value: ${{ jobs.nightly-build.outputs.djl_version }}
permissions:
id-token: write
contents: read

env:
AWS_ECR_REPO: "185921645874.dkr.ecr.us-east-1.amazonaws.com/djl-ci-temp"
DOCKER_HUB_REPO: "deepjavalibrary/djl-serving"

jobs:
nightly-build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [ cpu, cpu-full, pytorch-inf2, pytorch-gpu, tensorrt-llm, lmi ]
arch: ${{ fromJson(inputs.arch) }}
exclude:
- arch: aarch64
outputs:
djl_version: ${{ steps.get-versions.outputs.DJL_VERSION }}
steps:
- name: Clean disk space
run: |
Expand All @@ -35,11 +59,11 @@ jobs:
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
$AGENT_TOOLSDIRECTORY
- uses: actions/checkout@v4
- name: Login to Docker
uses: docker/login-action@v3
if: inputs.git_ref == ''
- uses: actions/checkout@v4
if: inputs.git_ref != ''
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
ref: inputs.git_ref
- name: install awscli
run: |
sudo apt-get update
Expand All @@ -65,53 +89,49 @@ jobs:
SERVING_VERSION=$(awk -F '=' '/serving / {gsub(/ ?"/, "", $2); print $2}' gradle/libs.versions.toml)
echo "DJL_VERSION=$DJL_VERSION" >> $GITHUB_ENV
echo "SERVING_VERSION=$SERVING_VERSION" >> $GITHUB_ENV
- name: Build serving package for nightly
if: ${{ inputs.mode == '' || inputs.mode == 'nightly' }}
run: |
./gradlew --refresh-dependencies :serving:dockerDeb -Psnapshot
- name: Build and push nightly docker image
if: ${{ inputs.mode == '' || inputs.mode == 'nightly' }}
echo "DJL_VERSION=$DJL_VERSION" >> $GITHUB_OUTPUT
- name: Build release candidate docker image
if: ${{ inputs.mode == 'release'}}
working-directory: serving/docker
run: |
export NIGHTLY="-nightly"
export BASE_RELEASE_VERSION="${{ env.SERVING_VERSION }}"
export RELEASE_VERSION="${{ env.SERVING_VERSION }}-"
docker compose build --no-cache \
--build-arg djl_version=${{ env.DJL_VERSION }}-SNAPSHOT \
--build-arg djl_serving_version=${{ env.SERVING_VERSION }}-SNAPSHOT \
--build-arg djl_version=${{ env.DJL_VERSION }} \
--build-arg djl_serving_version=${{ env.SERVING_VERSION }} \
${{ matrix.arch }}
docker compose push ${{ matrix.arch }}
- name: Build and push temp image
if: ${{ inputs.mode == 'temp' }}
working-directory: serving/docker
- name: Build temp docker image
if: ${{ inputs.mode == '' || inputs.mode == 'temp' || inputs.mode == 'nightly' }}
run: |
./gradlew --refresh-dependencies :serving:dockerDeb -Psnapshot
cd serving/docker
export NIGHTLY="-nightly"
echo "NIGHTLY=$NIGHTLY" >> $GITHUB_ENV
docker compose build --no-cache \
--build-arg djl_version=${{ env.DJL_VERSION }}-SNAPSHOT \
--build-arg djl_serving_version=${{ env.SERVING_VERSION }}-SNAPSHOT \
${{ matrix.arch }}
repo="185921645874.dkr.ecr.us-east-1.amazonaws.com/djl-ci-temp"
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $repo
tempTag="$repo:${{ matrix.arch }}-${GITHUB_SHA}"
docker tag deepjavalibrary/djl-serving:${{ matrix.arch }}-nightly $tempTag
docker push $tempTag
- name: Build and push release docker image
if: ${{ inputs.mode == 'release' }}
working-directory: serving/docker
run: |
export BASE_RELEASE_VERSION="${{ env.SERVING_VERSION }}"
export RELEASE_VERSION="${{ env.SERVING_VERSION }}-"
docker compose build --no-cache \
--build-arg djl_version=${{ env.DJL_VERSION }} \
--build-arg djl_serving_version=${{ env.SERVING_VERSION }} \
${{ matrix.arch }}
docker compose push ${{ matrix.arch }}
- name: Retag image for release
if: ${{ matrix.arch == 'cpu' && inputs.mode == 'release' }}
- name: Tag and push temp image to ECR repo
working-directory: serving/docker
run: |
docker tag deepjavalibrary/djl-serving:${{ env.SERVING_VERSION }} deepjavalibrary/djl-serving:latest
docker push deepjavalibrary/djl-serving:latest
ECR_REGION=$(echo "${{ env.AWS_ECR_REPO }}" | awk -F. '{print $4}')
aws ecr get-login-password --region $ECR_REGION | docker login --username AWS --password-stdin ${{env.AWS_ECR_REPO}}
mode=${{ inputs.mode }}
if [ "${{ inputs.mode }}" == "release" ]; then
mode=${{ env.DJL_VERSION }}
fi
tempRunIdTag="${{ env.AWS_ECR_REPO }}:${{ matrix.arch }}-$mode-${GITHUB_RUN_ID}"
tempCommitTag="${{ env.AWS_ECR_REPO }}:${{ matrix.arch }}-$mode-${GITHUB_SHA}"

docker tag ${{ env.DOCKER_HUB_REPO }}:${{ matrix.arch }}${{ env.NIGHTLY }} $tempRunIdTag
docker tag ${{ env.DOCKER_HUB_REPO }}:${{ matrix.arch }}${{ env.NIGHTLY }} $tempCommitTag
if ${{ inputs.mode == 'nightly' }}; then
docker tag ${{ env.DOCKER_HUB_REPO }}:${{ matrix.arch }}${{ env.NIGHTLY }} ${{ env.AWS_ECR_REPO }}:${{ matrix.arch }}-nightly
fi
time docker push --all-tags ${{ env.AWS_ECR_REPO }}

create-runner:
if: contains(fromJSON(inputs.arch), 'aarch64')
runs-on: [ self-hosted, scheduler ]
steps:
- name: Create new Graviton instance
Expand All @@ -127,6 +147,7 @@ jobs:
aarch64_instance_id: ${{ steps.create_aarch64.outputs.action_graviton_instance_id }}

nightly-aarch64:
if: contains(fromJSON(inputs.arch), 'aarch64')
runs-on:
- self-hosted
- aarch64
Expand All @@ -141,11 +162,6 @@ jobs:
working-directory: serving/docker
run: |
yes | docker system prune -a --volumes
- name: Login to Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: install awscli
run: |
sudo apt-get update
Expand All @@ -171,46 +187,49 @@ jobs:
SERVING_VERSION=$(awk -F '=' '/serving / {gsub(/ ?"/, "", $2); print $2}' gradle/libs.versions.toml)
echo "DJL_VERSION=$DJL_VERSION" >> $GITHUB_ENV
echo "SERVING_VERSION=$SERVING_VERSION" >> $GITHUB_ENV
- name: Build serving package for nightly
if: ${{ inputs.mode == '' || inputs.mode == 'nightly' }}
run: |
./gradlew --refresh-dependencies :serving:dockerDeb -Psnapshot
- name: Build and push nightly docker image
if: ${{ inputs.mode == '' || inputs.mode == 'nightly' }}
- name: Build release candidate docker image
if: ${{ inputs.mode == 'release' }}
working-directory: serving/docker
run: |
export NIGHTLY="-nightly"
export BASE_RELEASE_VERSION="${{ env.SERVING_VERSION }}"
export RELEASE_VERSION="${{ env.SERVING_VERSION }}-"
docker compose build --no-cache \
--build-arg djl_version=${{ env.DJL_VERSION }}-SNAPSHOT \
--build-arg djl_serving_version=${{ env.SERVING_VERSION }}-SNAPSHOT \
--build-arg djl_version=${{ env.DJL_VERSION }} \
--build-arg djl_serving_version=${{ env.SERVING_VERSION }} \
aarch64
docker compose push aarch64
- name: Build and push temp image
if: ${{ inputs.mode == 'temp' }}
working-directory: serving/docker
- name: Build temp docker image
if: ${{ inputs.mode == '' || inputs.mode == 'temp' || inputs.mode == 'nightly' }}
run: |
./gradlew --refresh-dependencies :serving:dockerDeb -Psnapshot
cd serving/docker
export NIGHTLY="-nightly"
echo "NIGHTLY=$NIGHTLY" >> $GITHUB_ENV
docker compose build --no-cache \
--build-arg djl_version=${{ env.DJL_VERSION }}-SNAPSHOT \
--build-arg djl_serving_version=${{ env.SERVING_VERSION }}-SNAPSHOT \
aarch64
repo="185921645874.dkr.ecr.us-east-1.amazonaws.com/djl-ci-temp"
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $repo
tempTag="$repo:aarch64-${GITHUB_SHA}"
docker tag deepjavalibrary/djl-serving:aarch64-nightly $tempTag
docker push $tempTag
- name: Build and push release docker image
if: ${{ inputs.mode == 'release' }}
- name: Build and push temp image
working-directory: serving/docker
run: |
export BASE_RELEASE_VERSION="${{ env.SERVING_VERSION }}"
export RELEASE_VERSION="${{ env.SERVING_VERSION }}-"
docker compose build --no-cache \
--build-arg djl_version=${{ env.DJL_VERSION }} \
--build-arg djl_serving_version=${{ env.SERVING_VERSION }} \
--build-arg djl_version=${{ env.DJL_VERSION }}-SNAPSHOT \
--build-arg djl_serving_version=${{ env.SERVING_VERSION }}-SNAPSHOT \
aarch64
docker compose push aarch64
ECR_REGION=$(echo "${{ env.AWS_ECR_REPO }}" | awk -F. '{print $4}')
aws ecr get-login-password --region $ECR_REGION | docker login --username AWS --password-stdin ${{env.AWS_ECR_REPO}}
mode=${{ inputs.mode }}
if [ "${{ inputs.mode }}" == "release" ]; then
mode=${{ env.DJL_VERSION }}
fi
tempRunIdTag="${{ env.AWS_ECR_REPO }}aarch64-$mode-${GITHUB_RUN_ID}"
tempCommitTag="${{ env.AWS_ECR_REPO }}:aarch64-$mode-${GITHUB_SHA}"

docker tag ${{ env.DOCKER_HUB_REPO }}:aarch64${{ env.NIGHTLY }} $tempRunIdTag
docker tag ${{ env.DOCKER_HUB_REPO }}:aarch64${{ env.NIGHTLY }} $tempCommitTag
if ${{ inputs.mode == 'nightly' }}; then
docker tag ${{ env.DOCKER_HUB_REPO }}:aarch64${{ env.NIGHTLY }} ${{ env.AWS_ECR_REPO }}:aarch64-nightly
fi
time docker push --all-tags ${{ env.AWS_ECR_REPO }}

stop-runner:
if: always()
Expand Down
32 changes: 22 additions & 10 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,31 @@ on:
options:
- nightly
- release
commit_sha:
description: 'specify which sha value the image was built.'
required: false
default: ''
workflow_call:
inputs:
mode:
description: 'release/nightly, default is nightly'
type: string
required: true
default: 'nightly'
commit_sha:
type: string
description: 'specify which sha value the image was built.'
required: false
default: ''

permissions:
id-token: write
contents: read

env:
AWS_ECR_REPO: "185921645874.dkr.ecr.us-east-1.amazonaws.com/djl-ci-temp"
AWS_TMP_ECR_REPO: "185921645874.dkr.ecr.us-east-1.amazonaws.com/djl-ci-temp"
AWS_STAGING_ECR_REPO: "125045733377.dkr.ecr.us-east-1.amazonaws.com/djl-serving"
ECR_REPO_REGION: "us-east-1"

jobs:
create-aarch64-runner:
Expand Down Expand Up @@ -66,25 +77,26 @@ jobs:
with:
role-to-assume: arn:aws:iam::185921645874:role/github-actions-djl-serving
aws-region: us-east-1
- name: Login to ECR
run: |
aws ecr get-login-password --region ${{ env.ECR_REPO_REGION }} | docker login --username AWS --password-stdin ${{ env.AWS_TMP_ECR_REPO }}
aws ecr get-login-password --region ${{ env.ECR_REPO_REGION }} | docker login --username AWS --password-stdin ${{ env.AWS_STAGING_ECR_REPO }}
- name: Get DJL Version
run: |
DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ./gradle/libs.versions.toml)
echo "DJL_VERSION=$DJL_VERSION" >> $GITHUB_ENV
- name: Pull and sync to docker hub
working-directory: serving/docker
run: |
DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml)
ECR_REGION=$(echo "${{ env.AWS_ECR_REPO }}" | awk -F. '{print $4}')
aws ecr get-login-password --region $ECR_REGION | docker login --username AWS --password-stdin ${{env.AWS_ECR_REPO}}
./scripts/pull_and_retag.sh $DJL_VERSION deepjavalibrary/djl-serving ${{ inputs.mode }}
./scripts/push_image_from_ECR.sh $DJL_VERSION deepjavalibrary/djl-serving ${{ inputs.mode }} ${{ inputs.commit_sha }}
- name: Pull and sync to ECR
working-directory: serving/docker
run: |
DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml)
repo="125045733377.dkr.ecr.us-east-1.amazonaws.com/djl-serving"
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $repo
./scripts/pull_and_retag.sh $DJL_VERSION $repo ${{ inputs.mode }}
./scripts/push_image_from_ECR.sh $DJL_VERSION $AWS_STAGING_ECR_REPO ${{ inputs.mode }} ${{ inputs.commit_sha }}
- name: Retag image for release latest
if: ${{ inputs.mode == 'release' }}
working-directory: serving/docker
run: |
DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml)
docker tag deepjavalibrary/djl-serving:${DJL_VERSION} deepjavalibrary/djl-serving:latest
docker push deepjavalibrary/djl-serving:latest
- name: Clean docker env
Expand Down
Loading