Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to upload Nova artifacts to S3 directly #5668

Merged
merged 6 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/linux_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ on:
under dist/ and any files under artifacts-to-be-uploaded/ will be uploaded
default: ''
type: string
use-s3:
description: |
Upload the artifact to S3 instead of GitHub. This is used for large artifacts like
exported model
required: false
default: false
type: boolean
download-artifact:
description: 'Name to download artifacts to ${RUNNER_ARTIFACT_DIR}'
default: ''
Expand Down Expand Up @@ -292,14 +299,28 @@ jobs:
fi
echo "upload-docs=${upload_docs}" >> "${GITHUB_OUTPUT}"

# NB: Keep this for compatibility with existing jobs and also keep in mind that only
# our AWS runners have access to S3
- name: Upload artifacts to GitHub (if any)
uses: actions/upload-artifact@v3
if: ${{ always() && inputs.upload-artifact != '' }}
if: ${{ always() && inputs.upload-artifact != '' && !inputs.use-s3 }}
with:
name: ${{ inputs.upload-artifact }}
path: ${{ runner.temp }}/artifacts/
if-no-files-found: ${{ steps.check-artifacts.outputs.if-no-files-found }}

# NB: This only works with our AWS runners
- name: Upload artifacts to S3 (if any)
uses: seemethere/upload-artifact-s3@v5
if: ${{ always() && inputs.upload-artifact != '' && inputs.use-s3 }}
with:
retention-days: 14
s3-bucket: gha-artifacts
s3-prefix: |
${{ env.REPOSITORY }}/${{ github.run_id }}/artifacts
if-no-files-found: ${{ steps.check-artifacts.outputs.if-no-files-found }}
path: ${{ runner.temp }}/artifacts/

- name: Upload documentation to S3 (if any)
uses: seemethere/upload-artifact-s3@v5
if: ${{ steps.check-artifacts.outputs.upload-docs == 1 && github.event.pull_request.number != '' }}
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/macos_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ on:
under dist/ and any files under artifacts-to-be-uploaded/ will be uploaded
default: ""
type: string
use-s3:
description: |
Upload the artifact to S3 instead of GitHub. This is used for large artifacts like
exported model
required: false
default: false
type: boolean
download-artifact:
description: 'Name to download artifacts to ${RUNNER_ARTIFACT_DIR}'
default: ""
Expand Down Expand Up @@ -183,14 +190,28 @@ jobs:
# Set to fail upload step if there are no files for upload and expected files for upload
echo 'if-no-files-found=error' >> "${GITHUB_OUTPUT}"

# NB: Keep this for compatibility with existing jobs and also keep in mind that only
# our AWS runners have access to S3
- name: Upload artifacts to GitHub (if any)
uses: actions/upload-artifact@v3
if: ${{ always() && inputs.upload-artifact != '' }}
if: ${{ always() && inputs.upload-artifact != '' && !inputs.use-s3 }}
with:
name: ${{ inputs.upload-artifact }}
path: ${{ runner.temp }}/artifacts/
if-no-files-found: ${{ steps.check-artifacts.outputs.if-no-files-found }}

# NB: This only works with our AWS runners
- name: Upload artifacts to S3 (if any)
uses: seemethere/upload-artifact-s3@v5
if: ${{ always() && inputs.upload-artifact != '' && inputs.use-s3 }}
with:
retention-days: 14
s3-bucket: gha-artifacts
s3-prefix: |
${{ env.REPOSITORY }}/${{ github.run_id }}/artifacts
if-no-files-found: ${{ steps.check-artifacts.outputs.if-no-files-found }}
path: ${{ runner.temp }}/artifacts/

- name: Clean up disk space
if: always()
continue-on-error: true
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test_linux_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ jobs:
upload-artifact: my-cool-artifact
script: |
echo "hello" > "${RUNNER_ARTIFACT_DIR}/cool_beans"
test-upload-artifact-s3:
uses: ./.github/workflows/linux_job.yml
with:
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
upload-artifact: my-cool-artifact
use-s3: true
script: |
echo "hello" > "${RUNNER_ARTIFACT_DIR}/cool_beans"
test-download-artifact:
needs: test-upload-artifact
uses: ./.github/workflows/linux_job.yml
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test_macos_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ jobs:
upload-artifact: my-cool-artifact
script: |
echo "hello" > "${RUNNER_ARTIFACT_DIR}/cool_beans"
test-upload-artifact-s3:
uses: ./.github/workflows/macos_job.yml
with:
runner: macos-m1-stable
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
upload-artifact: my-cool-artifact
use-s3: true
script: |
echo "hello" > "${RUNNER_ARTIFACT_DIR}/cool_beans"
test-download-artifact:
needs: test-upload-artifact
uses: ./.github/workflows/macos_job.yml
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test_windows_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ jobs:
upload-artifact: my-cool-artifact
script: |
echo "hello" > "${RUNNER_ARTIFACT_DIR}/cool_beans"
test-upload-artifact-s3:
uses: ./.github/workflows/windows_job.yml
with:
runner: windows.4xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
upload-artifact: my-cool-artifact
use-s3: true
script: |
echo "hello" > "${RUNNER_ARTIFACT_DIR}/cool_beans"
test-download-artifact:
needs: test-upload-artifact
uses: ./.github/workflows/windows_job.yml
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/windows_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ on:
under dist/ and any files under artifacts-to-be-uploaded/ will be uploaded
default: ''
type: string
use-s3:
description: |
Upload the artifact to S3 instead of GitHub. This is used for large artifacts like
exported model
required: false
default: false
type: boolean
download-artifact:
description: 'Name to download artifacts to ${RUNNER_ARTIFACT_DIR}'
default: ''
Expand Down Expand Up @@ -185,14 +192,28 @@ jobs:
# Set to fail upload step if there are no files for upload and expected files for upload
echo 'if-no-files-found=error' >> "${GITHUB_OUTPUT}"

# NB: Keep this for compatibility with existing jobs and also keep in mind that only
# our AWS runners have access to S3
- name: Upload artifacts to GitHub (if any)
uses: actions/upload-artifact@v3
if: ${{ always() && inputs.upload-artifact != '' }}
if: ${{ always() && inputs.upload-artifact != '' && !inputs.use-s3 }}
with:
name: ${{ inputs.upload-artifact }}
path: ${{ runner.temp }}/artifacts/
if-no-files-found: ${{ steps.check-artifacts.outputs.if-no-files-found }}

# NB: This only works with our AWS runners
- name: Upload artifacts to S3 (if any)
uses: seemethere/upload-artifact-s3@v5
if: ${{ always() && inputs.upload-artifact != '' && inputs.use-s3 }}
with:
retention-days: 14
s3-bucket: gha-artifacts
s3-prefix: |
${{ env.REPOSITORY }}/${{ github.run_id }}/artifacts
if-no-files-found: ${{ steps.check-artifacts.outputs.if-no-files-found }}
path: ${{ runner.temp }}/artifacts/

- name: Teardown Windows
if: ${{ always() }}
uses: ./test-infra/.github/actions/teardown-windows
Loading