Skip to content

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Nov 8, 2022

Q                       A
Fixed Issues? It takes 1 min to download built artifacts for CI runners
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

The artifact download is slow because each file is uploaded separately to an HTTP endpoint. Currently there are 2355 files in the artifacts.

In this PR we archive the artifacts before uploading, then we extract the archive after downloading. This approach is also recommended by the @actions/upload maintainers.

After this PR, it takes less than 3 seconds to download and extract artifacts.

@babel-bot
Copy link
Collaborator

babel-bot commented Nov 8, 2022

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/53406/

- uses: actions/download-artifact@v3
with:
name: babel-artifact
- name: Generate runtime helpers
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This step is removed because the runtime helpers are stored in the artifacts, too.

!**/node_modules/**
name: babel8-artifact
path: babel-artifact.tar
retention-days: 5
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default retention days is 90, much longer than we need because the artifact is not for download purpose. Here we decrease the time so we can free up some CI storage for other projects.

BABEL_TYPES_8_BREAKING: true
- name: Prepare artifacts
run: |
./scripts/get-artifact-files.sh | tar --null -cvf babel-artifact.tar --files-from=-
Copy link
Contributor Author

@JLHwung JLHwung Nov 8, 2022

Choose a reason for hiding this comment

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

We don't need to compress the archive because @actions/upload will compress it during transfer. Also I use -v here so we can check what is included in the artifacts.

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

I'm very surprised that the action doesn't do this by itself.

Copy link
Member

@liuxingbaoyu liuxingbaoyu left a comment

Choose a reason for hiding this comment

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

I'm surprised there is no automatic compression.

@JLHwung JLHwung merged commit 4511a96 into babel:main Nov 9, 2022
@JLHwung JLHwung deleted the improve-artifacts-io branch November 9, 2022 15:23
@JLHwung JLHwung mentioned this pull request Nov 11, 2022
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Feb 9, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants