diff --git a/.github/workflows/codeql-analysis-java.yml b/.github/workflows/codeql-analysis-java.yml index 02119677e3d..88959b6239a 100644 --- a/.github/workflows/codeql-analysis-java.yml +++ b/.github/workflows/codeql-analysis-java.yml @@ -73,3 +73,10 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 + + publish-success-metric: + needs: [ analyze ] + if: always() + uses: ./.github/workflows/publish-job-success.yml + with: + metric-name: DJL-CodeQL-Failure diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index d183a0e2787..7fb8a7031fd 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -56,4 +56,11 @@ jobs: context: . file: docker/spark/Dockerfile build-args: DJL_VERSION=${DJL_VERSION} - tags: deepjavalibrary/djl-spark:${{ env.DJL_VERSION }}-cpu \ No newline at end of file + tags: deepjavalibrary/djl-spark:${{ env.DJL_VERSION }}-cpu + + publish-success-metric: + needs: [ publish ] + if: always() + uses: ./.github/workflows/publish-job-success.yml + with: + metric-name: DJL-SparkDockerPublish-Failure diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0f9dfe33870..b48a7b2d2a6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -65,3 +65,10 @@ jobs: run: | aws s3 sync ../site s3://djl-ai/documentation/nightly --delete aws cloudfront create-invalidation --distribution-id E733IIDCG0G5U --paths "/*" + + publish-success-metric: + needs: [ documentation ] + if: always() + uses: ./.github/workflows/publish-job-success.yml + with: + metric-name: DJL-DocumentationPublish-Failure diff --git a/.github/workflows/native_jni_s3_paddle.yml b/.github/workflows/native_jni_s3_paddle.yml index f35b54b41c9..aa1f3048283 100644 --- a/.github/workflows/native_jni_s3_paddle.yml +++ b/.github/workflows/native_jni_s3_paddle.yml @@ -108,3 +108,10 @@ jobs: PADDLE_VERSION="$(cat gradle.properties | awk -F '=' '/paddlepaddle_version/ {print $2}')" aws s3 sync jnilib s3://djl-ai/publish/paddlepaddle-${PADDLE_VERSION}/jnilib aws cloudfront create-invalidation --distribution-id E371VB8JQ6NRVY --paths "/paddlepaddle-${PADDLE_VERSION}/jnilib*" + + publish-success-metric: + needs: [ publish ] + if: always() + uses: ./.github/workflows/publish-job-success.yml + with: + metric-name: DJL-NativeJNIPaddleS3Publish-Failure diff --git a/.github/workflows/native_jni_s3_pytorch.yml b/.github/workflows/native_jni_s3_pytorch.yml index d0f284093ba..1115362b03c 100644 --- a/.github/workflows/native_jni_s3_pytorch.yml +++ b/.github/workflows/native_jni_s3_pytorch.yml @@ -306,3 +306,10 @@ jobs: cd /home/ubuntu/djl_benchmark_script/scripts instance_id=${{ needs.create-aarch64-runner.outputs.aarch64_instance_id }} ./stop_instance.sh $instance_id + + publish-success-metric: + needs: [ build-pytorch-jni-macos, build-pytorch-jni-linux, build-pytorch-jni-precxx11, build-pytorch-jni-windows, build-pytorch-jni-arm64-macos, stop-runners ] + if: always() + uses: ./.github/workflows/publish-job-success.yml + with: + metric-name: DJL-NativeJNIPytorchS3Publish-Failure diff --git a/.github/workflows/native_jni_s3_pytorch_android.yml b/.github/workflows/native_jni_s3_pytorch_android.yml index 8f09232f785..21dc253b785 100644 --- a/.github/workflows/native_jni_s3_pytorch_android.yml +++ b/.github/workflows/native_jni_s3_pytorch_android.yml @@ -43,3 +43,10 @@ jobs: PYTORCH_VERSION=${PYTORCH_VERSION:-$(cat gradle.properties | awk -F '=' '/pytorch_version/ {print $2}')} aws s3 sync engines/pytorch/pytorch-native/jnilib s3://djl-ai/publish/pytorch/${PYTORCH_VERSION}/jnilib aws cloudfront create-invalidation --distribution-id E371VB8JQ6NRVY --paths "/pytorch/${PYTORCH_VERSION}/jnilib*" + + publish-success-metric: + needs: [ build-pytorch-jni-android ] + if: always() + uses: ./.github/workflows/publish-job-success.yml + with: + metric-name: DJL-NativeJNIPytorchAndroidS3Publish-Failure diff --git a/.github/workflows/nightly_android.yml b/.github/workflows/nightly_android.yml index d7aa268f195..5bd475b1fd4 100644 --- a/.github/workflows/nightly_android.yml +++ b/.github/workflows/nightly_android.yml @@ -31,3 +31,10 @@ jobs: emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true script: cd android/core && ./gradlew cAT + + publish-success-metric: + needs: [ build ] + if: always() + uses: ./.github/workflows/publish-job-success.yml + with: + metric-name: DJL-AndroidIntegrationTests-Failure diff --git a/.github/workflows/nightly_publish.yml b/.github/workflows/nightly_publish.yml index b5078ef892d..f98f431e729 100644 --- a/.github/workflows/nightly_publish.yml +++ b/.github/workflows/nightly_publish.yml @@ -255,3 +255,10 @@ jobs: cd /home/ubuntu/djl_benchmark_script/scripts instance_id=${{ needs.create-runners.outputs.gpu_1_instance_id }} ./stop_instance.sh $instance_id + + publish-success-metric: + needs: [ publish, stop-runners ] + if: always() + uses: ./.github/workflows/publish-job-success.yml + with: + metric-name: DJL-NightlyIntegrationTestsPublish-Failure diff --git a/.github/workflows/publish-job-success.yml b/.github/workflows/publish-job-success.yml new file mode 100644 index 00000000000..7b2f7ffc7fd --- /dev/null +++ b/.github/workflows/publish-job-success.yml @@ -0,0 +1,27 @@ +name: Publish Job Success Metric to CloudWatch + +on: + workflow_call: + inputs: + metric-name: + description: "The name of the job to publish a metric for" + type: string + required: true + +jobs: + publish-job-success-to-cloudwatch: + if: ${{ github.event_name == 'schedule' }} + runs-on: [ self-hosted, scheduler ] + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-region: us-west-2 + - name: Publish Job Success Metric + run: | + [[ ${{ job.status }} == "success" ]] + failedBuild=$? + aws cloudwatch put-metric-data --namespace GithubCI \ + --metric-name ${{ inputs.metric-name }} \ + --value $failedBuild \ + --unit Count diff --git a/.github/workflows/publish_android_packages.yml b/.github/workflows/publish_android_packages.yml index 4d7d3bfd3ed..d8560a52000 100644 --- a/.github/workflows/publish_android_packages.yml +++ b/.github/workflows/publish_android_packages.yml @@ -50,3 +50,10 @@ jobs: ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingPassword }} ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.ORG_GRADLE_PROJECT_ossrhUsername }} ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.ORG_GRADLE_PROJECT_ossrhPassword }} + + publish-success-metric: + needs: [ release-android ] + if: always() + uses: ./.github/workflows/publish-job-success.yml + with: + metric-name: DJL-AndroidPublish-Failurei diff --git a/.github/workflows/serving_publish.yml b/.github/workflows/serving_publish.yml index e45f35ebead..be991ddffe4 100644 --- a/.github/workflows/serving_publish.yml +++ b/.github/workflows/serving_publish.yml @@ -105,3 +105,10 @@ jobs: ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.ORG_GRADLE_PROJECT_ossrhUsername }} ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.ORG_GRADLE_PROJECT_ossrhPassword }} DJL_STAGING: ${{ github.event.inputs.repo-id }} + + publish-success-metric: + needs: [ publish ] + if: always() + uses: ./.github/workflows/publish-job-success.yml + with: + metric-name: DJL-DJLServingPublish-Failure