Skip to content

Commit

Permalink
Fixes issue where dated rosetta nightlies were not tagged if tests fa…
Browse files Browse the repository at this point in the history
…iled (#446)

The issue was that if tests failed, the `publish-final` step wasn't run
b/c a failure in any of the `needs:` jobs would implicitly cause
`publish-final` to be skipped. So the ternary operator to conditionally
add `latest` wasn't run and `nightly-YYYY-MM-DD` was skipped.

Simple remedy is to introduce two publish steps. The code is repeated,
but it is much clearer than adding complicated `if:` logic
  • Loading branch information
terrykong authored Jan 4, 2024
1 parent 339f42f commit 33a8cb3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/nightly-rosetta-pax-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ jobs:
secrets: inherit

# TODO: ARM Tests
publish-final:
# needs: [metadata, amd64, arm64, test-amd64]
needs: [metadata, amd64, test-amd64]
# The dated nightly is tagged regardless of the test results to assist troubleshooting
publish-final-dated:
# needs: [metadata, amd64, arm64]
needs: [metadata, amd64]
if: needs.metadata.outputs.PUBLISH == 'true'
uses: ./.github/workflows/_publish_container.yaml
with:
Expand All @@ -165,22 +166,26 @@ jobs:
# ${{ needs.arm64.outputs.DOCKER_TAG_FINAL }}
TARGET_IMAGE: pax
TARGET_TAGS: |
${{ needs.test-amd64.outputs.TEST_STATUS == 'success' && 'type=raw,value=latest,priority=1000' || '' }}
type=raw,value=nightly-${{ needs.metadata.outputs.BUILD_DATE }},priority=900
test-pax:
# needs: [metadata, amd64, arm64]
needs: [metadata, amd64]
uses: ./.github/workflows/_test_pax_rosetta.yaml
if: (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch'
# TODO: ARM Tests
# The latest tag is reserved for images that pass all the CI tests
publish-final-latest:
# needs: [metadata, amd64, arm64, test-amd64]
needs: [metadata, amd64, test-amd64]
if: needs.metadata.outputs.PUBLISH == 'true'
uses: ./.github/workflows/_publish_container.yaml
with:
PAX_IMAGE: ${{ needs.amd64.outputs.DOCKER_TAG_FINAL }}
secrets: inherit
SOURCE_IMAGE: |
${{ needs.amd64.outputs.DOCKER_TAG_FINAL }}
# ${{ needs.arm64.outputs.DOCKER_TAG_FINAL }}
TARGET_IMAGE: pax
TARGET_TAGS: |
type=raw,value=latest,priority=1000
publish-pax:
needs: [metadata, test-amd64]
uses: ./.github/workflows/_publish_t5x_pax_results.yaml
if: (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch'
with:
BUILD_DATE: ${{ needs.metadata.outputs.BUILD_DATE }}
EXPERIMENT_SUBDIR: ROSETTA_PAX
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/nightly-rosetta-t5x-build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ jobs:
T5X_IMAGE: ${{ needs.amd64.outputs.DOCKER_TAG_FINAL }}
secrets: inherit

publish-final:
needs: [metadata, amd64, arm64, test-t5x-amd64, test-unit-amd64]
# The dated nightly is tagged regardless of the test results to assist troubleshooting
publish-final-dated:
needs: [metadata, amd64, arm64]
if: needs.metadata.outputs.PUBLISH == 'true'
uses: ./.github/workflows/_publish_container.yaml
with:
Expand All @@ -164,9 +165,21 @@ jobs:
${{ needs.arm64.outputs.DOCKER_TAG_FINAL }}
TARGET_IMAGE: t5x
TARGET_TAGS: |
${{ ( needs.test-t5x-amd64.outputs.TEST_STATUS == 'success' && needs.test-unit-amd64.outputs.TEST_STATUS == 'success' ) && 'type=raw,value=latest,priority=1000' || '' }}
type=raw,value=nightly-${{ needs.metadata.outputs.BUILD_DATE }},priority=900
# The latest tag is reserved for images that pass all the CI tests
publish-final-latest:
needs: [metadata, amd64, arm64, test-t5x-amd64, test-unit-amd64]
if: needs.metadata.outputs.PUBLISH == 'true'
uses: ./.github/workflows/_publish_container.yaml
with:
SOURCE_IMAGE: |
${{ needs.amd64.outputs.DOCKER_TAG_FINAL }}
${{ needs.arm64.outputs.DOCKER_TAG_FINAL }}
TARGET_IMAGE: t5x
TARGET_TAGS: |
type=raw,value=latest,priority=1000
publish-t5x:
needs: [metadata, test-t5x-amd64]
uses: ./.github/workflows/_publish_t5x_pax_results.yaml
Expand Down

0 comments on commit 33a8cb3

Please sign in to comment.