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

CI: Migrate seemethere/download-artifact-s3 locally #6157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jwagantall
Copy link
Contributor

Hosting the code for seemethere/download-artifact-s3 locally to encorage more coolaboration and maintainance of this action.

This first migration is based on v4.2.0

Issue: pytorch/ci-infra#242

Copy link

vercel bot commented Jan 10, 2025

@jwagantall is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 10, 2025
@malfet
Copy link
Contributor

malfet commented Jan 13, 2025

Changes looks good to me in principle, but we should put some automation into building the actions and testing them, if they are part of test-infra on a personal repo

Copy link
Contributor

@ZainRizvi ZainRizvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, this looks pretty reasonable but it needs some fixes to pass CI

@jwagantall
Copy link
Contributor Author

Thank you so much for the review! Working on fixing the CI issues and linting issues.

@jwagantall jwagantall force-pushed the migrate-download branch 3 times, most recently from 507a669 to 6cd95dd Compare January 21, 2025 20:07
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@jwagantall jwagantall force-pushed the migrate-download branch 3 times, most recently from 4010a09 to 2415e72 Compare January 31, 2025 23:50
.github/workflows/test-download-artifact-s3-action.yml Outdated Show resolved Hide resolved
Comment on lines 60 to 70
- name: Upload artifact A
uses: actions/upload-artifact@v4
with:
name: Artifact-A-${{ matrix.runs-on }}
path: path/to/artifact-A

- name: Upload artifact B
uses: actions/upload-artifact@v4
with:
name: Artifact-B-${{ matrix.runs-on }}
path: path/to/artifact-B
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the uploads that were in your original test to try the migrated download action.
Uploads are done using the original "actions/upload-artifact" action into GHA artifacts and then we call the migrated "download-artifact-s3" action to download these files. (Part of the unit test)

The code is pretty much the same compared to seemethere/download-artifact-s3 with the exception that I added the unique name so that it wont conflict with each run from the matrix definition.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um this is unnecessary, this tests the old action and not the new action so I would just remove them. No need to keep code that doesn't actually test the thing that we're trying to test.

Comment on lines 100 to 118
# Test downloading both artifacts at once
- name: Download all Artifacts
uses: ./.github/actions/download-artifact-s3
with:
path: some/other/path

- name: Verify successful download
run: |
$fileA = "${{ github.workspace }}/some/other/path/Artifact-A-${{ matrix.runs-on }}/file-A.txt"
$fileB = "${{ github.workspace }}/some/other/path/Artifact-B-${{ matrix.runs-on }}/file-B.txt"
if(!(Test-Path -path $fileA) -or !(Test-Path -path $fileB))
{
Write-Error "Expected files do not exist"
}
if(!((Get-Content $fileA) -ceq "Lorem ipsum dolor sit amet") -or !((Get-Content $fileB) -ceq "Hello world from file B"))
{
Write-Error "File contents of downloaded artifacts are incorrect"
}
shell: pwsh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. Is part of your original unit tests. I am only fixing the names to avoid errors due to conflicts with each of the runs.

path: ~/some/path/with/a/tilde

- name: Verify successful download
run: |

Check failure

Code scanning / lintrunner

ACTIONLINT/[shellcheck]

shellcheck reported issue in this script: SC2088:warning:2:13: Tilde does not expand in quotes. Use $HOME
Hosting the code for seemethere/download-artifact-s3 locally
to encorage more coolaboration and maintainance of this action.

This first migration is based on v4.2.0

Issue: pytorch/ci-infra#242

Signed-off-by: Jessica Wagantall <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants