|
| 1 | +name: Temp XLA JAX T5x Perf test workflow |
| 2 | +on |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + ARCHITECTURE: |
| 6 | + type: string |
| 7 | + required: true |
| 8 | + BUILD_DATE: |
| 9 | + type: string |
| 10 | + description: Build date in YYYY-MM-DD format |
| 11 | + required: false |
| 12 | + default: NOT SPECIFIED |
| 13 | + PUBLISH: |
| 14 | + type: boolean |
| 15 | + description: Publish dated images and update the 'latest' tag? |
| 16 | + default: false |
| 17 | + required: false |
| 18 | + BUMP_MANIFEST: |
| 19 | + type: boolean |
| 20 | + description: Bump manifest file? |
| 21 | + default: false |
| 22 | + required: false |
| 23 | + SRC_JAX: |
| 24 | + description: 'JAX source: <repo>#<branch|tag|commit>' |
| 25 | + type: string |
| 26 | + required: true |
| 27 | + default: 'https://github.com/google/jax.git#main' |
| 28 | + SRC_XLA: |
| 29 | + description: 'XLA source: <repo>#<branch|tag|commit>' |
| 30 | + type: string |
| 31 | + required: true |
| 32 | + default: 'https://github.com/openxla/xla.git#main' |
| 33 | + SRC_T5X: |
| 34 | + description: 'T5X source: <repo>#<branch|tag|commit>' |
| 35 | + type: string |
| 36 | + required: true |
| 37 | + default: 'https://github.com/google-research/t5x.git#main' |
| 38 | + outputs: |
| 39 | + CONTAINER_TAGS: |
| 40 | + description: Single JSON object to store all generated docker tags |
| 41 | + value: ${{ jobs.save-tags.output.CONTAINER_TAGS }} |
| 42 | +concurrency: |
| 43 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 44 | + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
| 45 | + |
| 46 | +permissions: |
| 47 | + contents: read # to fetch code |
| 48 | + actions: write # to cancel previous workflows |
| 49 | + packages: write # to upload container |
| 50 | + |
| 51 | +jobs: |
| 52 | + metadata: |
| 53 | + runs-on: ubuntu-22.04 |
| 54 | + outputs: |
| 55 | + BUILD_DATE: ${{ steps.date.outputs.BUILD_DATE }} |
| 56 | + PUBLISH: ${{ steps.if-publish.outputs.PUBLISH }} |
| 57 | + BUMP_MANIFEST: ${{ steps.if-bump-manifest.outputs.BUMP_MANIFEST }} |
| 58 | + steps: |
| 59 | + - name: Set build date |
| 60 | + id: date |
| 61 | + shell: bash -x -e {0} |
| 62 | + run: | |
| 63 | + BUILD_DATE=$(TZ='US/Los_Angeles' date '+%Y-%m-%d') |
| 64 | + echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_OUTPUT |
| 65 | +
|
| 66 | + - name: Determine whether results will be 'published' |
| 67 | + id: if-publish |
| 68 | + shell: bash -x -e {0} |
| 69 | + run: | |
| 70 | + echo "PUBLISH=${{ github.event_name == 'schedule' || inputs.PUBLISH }}" >> $GITHUB_OUTPUT |
| 71 | +
|
| 72 | + - name: Determine whether need to bump manifest |
| 73 | + id: if-bump-manifest |
| 74 | + shell: bash -x -e {0} |
| 75 | + run: | |
| 76 | + echo "BUMP_MANIFEST=${{ github.event_name == 'schedule' || inputs.BUMP_MANIFEST }}" >> $GITHUB_OUTPUT |
| 77 | +
|
| 78 | + build-base: |
| 79 | + uses: ./.github/workflows/_build_base.yaml |
| 80 | + with: |
| 81 | + ARCHITECTURE: ${{ inputs.ARCHITECTURE }} |
| 82 | + BUILD_DATE: ${{ inputs.BUILD_DATE }} |
| 83 | + BUMP_MANIFEST: ${{ inputs.BUMP_MANIFEST }} |
| 84 | + secrets: inherit |
| 85 | + |
| 86 | + build-jax: |
| 87 | + needs: build-base |
| 88 | + uses: ./.github/workflows/_build_jax.yaml |
| 89 | + with: |
| 90 | + ARCHITECTURE: ${{ inputs.ARCHITECTURE }} |
| 91 | + BUILD_DATE: ${{ inputs.BUILD_DATE }} |
| 92 | + BASE_IMAGE: ${{ needs.build-base.outputs.DOCKER_TAG }} |
| 93 | + secrets: inherit |
| 94 | + |
| 95 | + build-t5x: |
| 96 | + needs: build-jax |
| 97 | + if: inputs.ARCHITECTURE == 'amd64' # T5X arm64 build is wip in PR 252 |
| 98 | + uses: ./.github/workflows/_build.yaml |
| 99 | + with: |
| 100 | + ARCHITECTURE: ${{ inputs.ARCHITECTURE }} |
| 101 | + ARTIFACT_NAME: "artifact-t5x-build" |
| 102 | + BADGE_FILENAME: "badge-t5x-build" |
| 103 | + BUILD_DATE: ${{ needs.metadata.outputs.BUILD_DATE }} |
| 104 | + BASE_IMAGE: ${{ needs.build-jax.outputs.DOCKER_TAG_MEALKIT }} |
| 105 | + CONTAINER_NAME: upstream-t5x |
| 106 | + DOCKERFILE: .github/container/Dockerfile.t5x |
| 107 | + secrets: inherit |
| 108 | + |
| 109 | + test-distribution: |
| 110 | + runs-on: ubuntu-22.04 |
| 111 | + strategy: |
| 112 | + matrix: |
| 113 | + TEST_SCRIPT: |
| 114 | + - extra-only-distribution.sh |
| 115 | + - mirror-only-distribution.sh |
| 116 | + - upstream-only-distribution.sh |
| 117 | + fail-fast: false |
| 118 | + steps: |
| 119 | + - name: Print environment variables |
| 120 | + run: env |
| 121 | + - name: Set git login for tests |
| 122 | + run: | |
| 123 | + git config --global user.email "[email protected]" |
| 124 | + git config --global user.name "JAX-Toolbox CI" |
| 125 | + - name: Check out the repository under ${GITHUB_WORKSPACE} |
| 126 | + uses: actions/checkout@v3 |
| 127 | + - name: Run integration test ${{ matrix.TEST_SCRIPT }} |
| 128 | + run: bash rosetta/tests/${{ matrix.TEST_SCRIPT }} |
| 129 | + |
| 130 | + test-upstream-t5x: |
| 131 | + needs: build-t5x |
| 132 | + if: inputs.ARCHITECTURE == 'amd64' # arm64 runners n/a |
| 133 | + uses: ./.github/workflows/_test_t5x.yaml |
| 134 | + with: |
| 135 | + T5X_IMAGE: ${{ needs.build-t5x.outputs.DOCKER_TAG_FINAL }} |
| 136 | + secrets: inherit |
| 137 | + |
| 138 | + publish-target-tags: |
| 139 | + runs-on: ubuntu-22.04 |
| 140 | + outputs: |
| 141 | + TARGET_TAGS: ${{ steps.tags.outputs.TARGET_TAGS}} |
| 142 | + steps: |
| 143 | + - id: tags |
| 144 | + run: | |
| 145 | + declare -a TARGET_IMAGE=("jax" "upstream-t5x") |
| 146 | + declare -a FLAVOR=("mealkit" "final") |
| 147 | +
|
| 148 | + ## now loop through the above array |
| 149 | + JSON="{" |
| 150 | + for target in "${TARGET_IMAGE[@]}";do |
| 151 | + for flavor in "${FLAVOR[@]}"; do |
| 152 | + CONTAINER_TAG=${flavor} |
| 153 | + TAG_DATED=${flavor} |
| 154 | + if [[ ${flavor} == "final" ]]; then |
| 155 | + CONTAINER_TAG=latest |
| 156 | + TAG_DATED=nightly |
| 157 | + fi |
| 158 | + JSON=$(echo ${JSON}\"${target}-${flavor}-container-tag\":\"${CONTAINER_TAG}\",) |
| 159 | + JSON=$(echo ${JSON}\"${target}-${flavor}-tag-dated\":\"${TAG_DATED}\",) |
| 160 | + done |
| 161 | + done |
| 162 | + JSON="${JSON::-1} }" |
| 163 | + echo "TARGET_TAGS=${JSON}" | tee -a $GITHUB_OUTPUT |
| 164 | +
|
| 165 | + publish: |
| 166 | + needs: [metadata, test-upstream-t5x, publish-target-tags] |
| 167 | + if: false # TODO: enable this after new image renaming proposal is approved |
| 168 | + # if: ${{ !cancelled() && needs.metadata.outputs.PUBLISH }} |
| 169 | + strategy: |
| 170 | + fail-fast: false |
| 171 | + matrix: |
| 172 | + TARGET_IMAGE: ["jax" "upstream-t5x"] |
| 173 | + FLAVOR: [mealkit, final] |
| 174 | + uses: ./.github/workflows/_publish_container.yaml |
| 175 | + with: |
| 176 | + SOURCE_IMAGE: | |
| 177 | + ${{ fromJson(needs.amd64.outputs.CONTAINER_TAGS)[format('tag-{0}-{1}', matrix.TARGET_IMAGE, matrix.FLAVOR)] }} |
| 178 | + ${{ fromJson(needs.arm64.outputs.CONTAINER_TAGS)[format('tag-{0}-{1}', matrix.TARGET_IMAGE, matrix.FLAVOR)] }} |
| 179 | + TARGET_IMAGE: ${{ matrix.TARGET_IMAGE }} |
| 180 | + TARGET_TAGS: | |
| 181 | + type=raw,value=${{ fromJson(needs.publish-target-tags.outputs.TARGET_TAGS)[format('{0}-{1}-container-tag', matrix.TARGET_IMAGE, matrix.FLAVOR)] }},priority=500 |
| 182 | + type=raw,value=${{ fromJson(needs.publish-target-tags.outputs.TARGET_TAGS)[format('{0}-{1}-tag-dated', matrix.TARGET_IMAGE, matrix.FLAVOR)] }}-${{ needs.metadata.outputs.BUILD_DATE }},priority=500 |
| 183 | +
|
| 184 | + finalize: |
| 185 | + needs: [metadata, test-upstream-t5x, publish-target-tags] |
| 186 | + if: "!cancelled()" |
| 187 | + uses: ./.github/workflows/_finalize.yaml |
| 188 | + with: |
| 189 | + PUBLISH_BADGE: false |
| 190 | + secrets: inherit |
0 commit comments