Skip to content

Commit e123c8e

Browse files
committed
Refine if conditions and update the upload destination
1 parent b4f7c8e commit e123c8e

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

.github/workflows/build_artifacts.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ on:
5353
type: string
5454

5555
jobs:
56-
build:
56+
build_artifacts:
5757
continue-on-error: true
5858
defaults:
5959
run:
@@ -104,19 +104,20 @@ jobs:
104104
uses: google-ml-infra/actions/ci_connection@main
105105
with:
106106
halt-dispatch-input: ${{ inputs.halt-for-connection }}
107-
- name: Build jax
108-
if: inputs.build_jax && matrix.artifact == 'jax'
109-
run: ./ci/build_artifacts.sh "jax"
110-
- name: Build jaxlib
111-
if: inputs.build_jaxlib && matrix.artifact == 'jaxlib'
112-
run: ./ci/build_artifacts.sh "jaxlib"
113-
- name: Build jax-cuda-plugin
114-
if: inputs.build_jax_cuda_plugin && matrix.artifact == 'jax-cuda-plugin'
115-
run: ./ci/build_artifacts.sh "jax-cuda-plugin"
116-
- name: Build jax-cuda-pjrt
117-
if: inputs.build_jax_cuda_pjrt && matrix.artifact == 'jax-cuda-pjrt'
118-
run: ./ci/build_artifacts.sh "jax-cuda-pjrt"
107+
- name: Build ${{ matrix.artifact }}
108+
if: >-
109+
(inputs.build_jax && matrix.artifact == 'jax') ||
110+
(inputs.build_jaxlib && matrix.artifact == 'jaxlib') ||
111+
(inputs.build_jax_cuda_plugin && matrix.artifact == 'jax-cuda-plugin') ||
112+
(inputs.build_jax_cuda_pjrt && matrix.artifact == 'jax-cuda-pjrt')
113+
run: ./ci/build_artifacts.sh "${{ matrix.artifact }}"
114+
- name: Set Platform
115+
run: |
116+
echo "PLATFORM=$(uname)_$(uname -m)" >> $GITHUB_ENV
119117
- name: Upload artifacts to GCS bucket
120-
if: inputs.upload_artifacts
121-
run: ~/usr/local/bin/google-cloud-sdk/bin/gsutil -m cp -r $(pwd)/dist gs://general-ml-ci-transient/jax-github-actions/"${{ inputs.upload_destination }}"
118+
# Upload if requested and one of the artifacts was built
119+
if: >-
120+
inputs.upload_artifacts &&
121+
(inputs.build_jax || inputs.build_jaxlib || inputs.build_jax_cuda_plugin || inputs.build_jax_cuda_pjrt)
122+
run: ~/usr/local/bin/google-cloud-sdk/bin/gsutil -m cp -r $(pwd)/dist gs://general-ml-ci-transient/jax-github-actions/"${{ inputs.upload_destination }}"/$PLATFORM
122123

.github/workflows/pytest_cpu_reuse.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ jobs:
5454
uses: google-ml-infra/actions/ci_connection@main
5555
with:
5656
halt-dispatch-input: ${{ inputs.halt-for-connection }}
57+
- name: Set Platform
58+
run: |
59+
echo "PLATFORM=$(uname)_$(uname -m)" >> $GITHUB_ENV
5760
- name: Download the artifacts built in the "build_artifacts" job
58-
run: mkdir -p $(pwd)/dist && ~/usr/local/bin/google-cloud-sdk/bin/gsutil -m cp -r gs://general-ml-ci-transient/jax-github-actions/"${{ github.workflow }}"/${{ github.run_number }}/${{ github.run_attempt }} $(pwd)/dist
61+
run: >-
62+
mkdir -p $(pwd)/dist &&
63+
~/usr/local/bin/google-cloud-sdk/bin/gsutil -m cp -r gs://general-ml-ci-transient/jax-github-actions/"${{ github.workflow }}"/${{ github.run_number }}/${{ github.run_attempt }}/$PLATFORM $(pwd)/dist
5964
- name: Install pytest
6065
env:
6166
JAXCI_PYTHON: python${{ matrix.python }}

0 commit comments

Comments
 (0)