Skip to content

Commit

Permalink
add tests code
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyAmazonian committed Jan 14, 2025
1 parent 3c3c205 commit d343a4c
Showing 1 changed file with 63 additions and 63 deletions.
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: ${{ needs.determine_images_to_publish.outputs.images }}
arch: '["cpu", "cpu-full", "pytorch-inf2", "pytorch-gpu", "tensorrt-llm"]'

0 comments on commit d343a4c

Please sign in to comment.