Skip to content

Commit

Permalink
ready for pr
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyAmazonian committed Jan 14, 2025
1 parent 794f989 commit 02bf626
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 103 deletions.
80 changes: 40 additions & 40 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,46 +78,46 @@ jobs:
working-directory: serving/docker
run: |
yes | docker system prune -a --volumes
# - name: Login to Docker
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: install awscli
# run: |
# sudo apt-get update
# sudo apt-get install awscli -y
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# 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: |
# ./scripts/push_image_from_ECR.sh $DJL_VERSION deepjavalibrary/djl-serving ${{ inputs.mode }} ${{ matrix.arch }} ${{ inputs.commit_sha }}
# - name: Pull and sync to ECR
# working-directory: serving/docker
# run: |
# ./scripts/push_image_from_ECR.sh $DJL_VERSION $AWS_STAGING_ECR_REPO ${{ inputs.mode }} ${{ matrix.arch }} ${{ inputs.commit_sha }}
# - name: Retag image for release latest
# if: ${{ inputs.mode == 'release' }}
# working-directory: serving/docker
# run: |
# docker tag deepjavalibrary/djl-serving:${DJL_VERSION} deepjavalibrary/djl-serving:latest
# docker push deepjavalibrary/djl-serving:latest
# - name: Clean docker env
# working-directory: serving/docker
# run: |
# yes | docker system prune -a --volumes
- name: Login to Docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: install awscli
run: |
sudo apt-get update
sudo apt-get install awscli -y
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
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: |
./scripts/push_image_from_ECR.sh $DJL_VERSION deepjavalibrary/djl-serving ${{ inputs.mode }} ${{ matrix.arch }} ${{ inputs.commit_sha }}
- name: Pull and sync to ECR
working-directory: serving/docker
run: |
./scripts/push_image_from_ECR.sh $DJL_VERSION $AWS_STAGING_ECR_REPO ${{ inputs.mode }} ${{ matrix.arch }} ${{ inputs.commit_sha }}
- name: Retag image for release latest
if: ${{ inputs.mode == 'release' }}
working-directory: serving/docker
run: |
docker tag deepjavalibrary/djl-serving:${DJL_VERSION} deepjavalibrary/djl-serving:latest
docker push deepjavalibrary/djl-serving:latest
- name: Clean docker env
working-directory: serving/docker
run: |
yes | docker system prune -a --volumes
stop-aarch64-runner:
if: always()
runs-on: [ self-hosted, scheduler ]
Expand Down
126 changes: 63 additions & 63 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,73 +27,73 @@ permissions:
contents: read

jobs:
# build:
# uses: ./.github/workflows/docker-nightly-publish.yml
# secrets: inherit
# with:
# mode: ${{ inputs.mode || 'nightly' }}
# get_image_tag_suffix:
# outputs:
# test_image_tag_suffix: ${{ steps.get_image_tag_suffix.test_image_tag_suffix }}
# needs: [build]
# runs-on: ubuntu-latest
# steps:
# - name: get_image_tag_suffix
# id: get_image_tag_suffix
# run: |
# if [[ "${{ inputs.mode || 'nightly' }}" == "nightly" ]]; then
# echo "test_image_tag_suffix=nightly" >> $GITHUB_OUTPUT
# elif [[ "${{ inputs.mode }}" == "release" ]]; then
# echo "test_image_tag_suffix=${{ needs.build.outputs.djl_version }}-${GITHUB_RUN_ID}" >> $GITHUB_OUTPUT
# else
# echo "Invalid mode specified"
# exit 1
# fi
# integration-test:
# needs: [get_image_tag_suffix]
# uses: ./.github/workflows/integration.yml
# secrets: inherit
# with:
# tag-suffix: ${{ needs.get_image_tag_suffix.outputs.test_image_tag_suffix }}
# determine_images_to_publish:
# if: always()
# needs: [ integration-test ]
# runs-on: ubuntu-latest
# outputs:
# images: ${{ steps.generate-images.outputs.images }}
# steps:
# - name: Generate image list from test results
# id: generate-images
# run: |
# images=()
# if [[ "${{ needs.integration-test.outputs.failure_cpu }}" == "0" ]]; then
# images+=("cpu")
# images+=("cpu-full")
# fi
# if [[ "${{ needs.integration-test.outputs.failure_gpu }}" == "0" ]]; then
# images+=("pytorch-gpu")
# fi
# if [[ "${{ needs.integration-test.outputs.failure_aarch64 }}" == "0" ]]; then
# images+=("aarch64")
# fi
# if [[ "${{ needs.integration-test.outputs.failure_lmi }}" == "0" ]]; then
# images+=("lmi")
# fi
# if [[ "${{ needs.integration-test.outputs.failure_trtllm }}" == "0" ]]; then
# images+=("tensorrt-llm")
# fi
# if [[ "${{ needs.integration-test.outputs.failure_neuron }}" == "0" ]]; then
# images+=("pytorch-inf2")
# fi
# json_images=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${images[@]}")
# echo "images are ${json_images}"
# echo "images=${json_images}" >> "$GITHUB_OUTPUT"
build:
uses: ./.github/workflows/docker-nightly-publish.yml
secrets: inherit
with:
mode: ${{ inputs.mode || 'nightly' }}
get_image_tag_suffix:
outputs:
test_image_tag_suffix: ${{ steps.get_image_tag_suffix.test_image_tag_suffix }}
needs: [build]
runs-on: ubuntu-latest
steps:
- name: get_image_tag_suffix
id: get_image_tag_suffix
run: |
if [[ "${{ inputs.mode || 'nightly' }}" == "nightly" ]]; then
echo "test_image_tag_suffix=nightly" >> $GITHUB_OUTPUT
elif [[ "${{ inputs.mode }}" == "release" ]]; then
echo "test_image_tag_suffix=${{ needs.build.outputs.djl_version }}-${GITHUB_RUN_ID}" >> $GITHUB_OUTPUT
else
echo "Invalid mode specified"
exit 1
fi
integration-test:
needs: [get_image_tag_suffix]
uses: ./.github/workflows/integration.yml
secrets: inherit
with:
tag-suffix: ${{ needs.get_image_tag_suffix.outputs.test_image_tag_suffix }}
determine_images_to_publish:
if: always()
needs: [ integration-test ]
runs-on: ubuntu-latest
outputs:
images: ${{ steps.generate-images.outputs.images }}
steps:
- name: Generate image list from test results
id: generate-images
run: |
images=()
if [[ "${{ needs.integration-test.outputs.failure_cpu }}" == "0" ]]; then
images+=("cpu")
images+=("cpu-full")
fi
if [[ "${{ needs.integration-test.outputs.failure_gpu }}" == "0" ]]; then
images+=("pytorch-gpu")
fi
if [[ "${{ needs.integration-test.outputs.failure_aarch64 }}" == "0" ]]; then
images+=("aarch64")
fi
if [[ "${{ needs.integration-test.outputs.failure_lmi }}" == "0" ]]; then
images+=("lmi")
fi
if [[ "${{ needs.integration-test.outputs.failure_trtllm }}" == "0" ]]; then
images+=("tensorrt-llm")
fi
if [[ "${{ needs.integration-test.outputs.failure_neuron }}" == "0" ]]; then
images+=("pytorch-inf2")
fi
json_images=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${images[@]}")
echo "images are ${json_images}"
echo "images=${json_images}" >> "$GITHUB_OUTPUT"
publish:
if: always()
# needs: [determine_images_to_publish]
needs: [determine_images_to_publish]
uses: ./.github/workflows/docker_publish.yml
secrets: inherit
with:
mode: ${{ inputs.mode || 'nightly' }}
commit_sha: ${{ github.sha }}
arch: '["cpu", "cpu-full", "pytorch-inf2", "pytorch-gpu", "tensorrt-llm"]'
arch: ${{ needs.determine_images_to_publish.outputs.images }}

0 comments on commit 02bf626

Please sign in to comment.