Skip to content

[Artifacts] zip creation + blob storage upload functionality - #1488

Merged
konradpabjan merged 4 commits into
mainfrom
konradpabjan/artifact-zip-upload
Aug 10, 2023
Merged

konradpabjan merged 4 commits into
mainfrom
konradpabjan/artifact-zip-upload

Conversation

@konradpabjan

@konradpabjan konradpabjan commented Aug 9, 2023 •

Copy link
Copy Markdown
Contributor

Tracking: https://github.com/github/c2c-actions-checks/issues/1699

This builds up on the work that was done in #1479, #1481, #1486 and #1487

This PR adds zip creation + upload functionality to the upcoming v2.0.0 version of @actions/artifact. This in turn will power new v4 versions of upload-artifact and download-artifact.

Uploads should be significantly faster compared to the v1-v3 versions of upload-artifact since there is no proxying now and we can directly upload to blob storage from the runner. This should also make uploading less error-prone as the entire flow has been simplified.

We're also zipping without creating any temporary files on disk, this should prevent any issues with low disk space that we have seen happen for a subset of v1-v3 users of upload-artifact

@konradpabjan konradpabjan changed the title Artifact zip creation + blob storage upload functionality [Artifacts] zip creation + blob storage upload functionality Aug 9, 2023
@konradpabjan
konradpabjan marked this pull request as ready for review August 10, 2023 13:29
@konradpabjan
konradpabjan requested a review from a team as a code owner August 10, 2023 13:29
const zipWarningCallback = (error: any): void => {
if (error.code === 'ENOENT') {
core.warning('ENOENT warning during artifact zip creation.')
core.info(error)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also curious you're reasoning behind putting these in info logs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The full errors tend to have more information. Someone will inevitably want to know "what path caused the ENOENT error, and the full error message should have that information". Doesn't hurt to include it"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry! I meant as opposed to a debug log - definitely agree it should be included!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Debug logs don't shown up by default. Users would have to re-run with the flag which could be a bit annoying. A warning like this should have the full information displayed by default

// Used for controlling the highWaterMark value of the zip that is being streamed
// The same value is used as the chunk size that is use during upload to blob storage
export function getUploadChunkSize(): number {
return 8 * 1024 * 1024 // 8 MB Chunks

@yacaovsnc yacaovsnc Aug 10, 2023 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The chunk size supported by Azure is 4MiB, we should stay below 4MiB?

@konradpabjan konradpabjan Aug 10, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So we use uploadStream and the default upload size is actually 8MiB https://learn.microsoft.com/en-us/javascript/api/@azure/storage-blob/blockblobclient?view=azure-node-latest#@azure-storage-blob-blockblobclient-uploadstream

Using the same default values:

Size of every buffer allocated, also the block size in the uploaded block blob. Default value is 8MB

@konradpabjan

Copy link
Copy Markdown
Contributor Author

Postman-echo started redirecting http to https so now a bunch of unrelated tests are failing in http-client. Will merge in for now and take a look later as this is unrelated

@konradpabjan
konradpabjan merged commit 45c49b0 into main Aug 10, 2023
@konradpabjan
konradpabjan deleted the konradpabjan/artifact-zip-upload branch August 10, 2023 19:28
@davhdavh

Copy link
Copy Markdown

Will this change also include deduplication before upload? It is quite silly to have to upload 400mb when the previous build already uploaded 398mb that is exactly the same

at-wat pushed a commit to at-wat/actions-toolkit that referenced this pull request Aug 31, 2023
…#1488)

* Artifact zip creation + blob storage upload functionality

* Fix lint

* PR feedback
dundargoc added a commit to dundargoc/neovim that referenced this pull request Oct 20, 2023
This will run the three test suites (unit, functional and old) in
parallel, meaning that neovim is built for each test and run separately.
This has a slight increase in total CI usage, but it allows rerunning
only the the specific test suite that failed for flaky tests, which will
save some time.

Ideally we'd remove any drawbacks by building neovim once and reusing it
for each test suite, but that is not currently possible due to poor
upload/download speeds of the upload-artifact and download-artifact
actions. This has been addressed in
actions/toolkit#1488, but will only be made
available in upload-artifact@v4 and download-artifact@v4.
dundargoc added a commit to dundargoc/neovim that referenced this pull request Oct 20, 2023
This will run the three test suites (unit, functional and old) in
parallel, meaning that neovim is built for each test and run separately.
This has a slight increase in total CI usage, but it allows rerunning
only the the specific test suite that failed for flaky tests, which will
save some time.

Ideally we'd remove any drawbacks by building neovim once and reusing it
for each test suite, but that is not currently possible due to poor
upload/download speeds of the upload-artifact and download-artifact
actions. This has been addressed in
actions/toolkit#1488, but will only be made
available in upload-artifact@v4 and download-artifact@v4.
dundargoc added a commit to dundargoc/neovim that referenced this pull request Oct 20, 2023
This will run the three test suites (unit, functional and old) in
parallel, meaning that neovim is built for each test and run separately.
This has a slight increase in total CI usage, but it allows rerunning
only the the specific test suite that failed for flaky tests, which will
save some time.

Ideally we'd remove any drawbacks by building neovim once and reusing it
for each test suite, but that is not currently possible due to poor
upload/download speeds of the upload-artifact and download-artifact
actions. This has been addressed in
actions/toolkit#1488, but will only be made
available in upload-artifact@v4 and download-artifact@v4.
dundargoc added a commit to dundargoc/neovim that referenced this pull request Oct 20, 2023
This will run the three test suites (unit, functional and old) in
parallel, meaning that neovim is built for each test and run separately.
This has a slight increase in total CI usage, but it allows rerunning
only the the specific test suite that failed for flaky tests, which will
save some time.

Ideally we'd remove any drawbacks by building neovim once and reusing it
for each test suite, but that is not currently possible due to poor
upload/download speeds of the upload-artifact and download-artifact
actions. This has been addressed in
actions/toolkit#1488, but will only be made
available in upload-artifact@v4 and download-artifact@v4.
dundargoc added a commit to dundargoc/neovim that referenced this pull request Oct 21, 2023
This will run the three test suites (unit, functional and old) in
parallel, meaning that neovim is built for each test and run separately.
This has a slight increase in total CI usage, but it allows rerunning
only the the specific test suite that failed for flaky tests, which will
save some time.

Ideally we'd remove any drawbacks by building neovim once and reusing it
for each test suite, but that is not currently possible due to poor
upload/download speeds of the upload-artifact and download-artifact
actions. This has been addressed in
actions/toolkit#1488, but will only be made
available in upload-artifact@v4 and download-artifact@v4.
dundargoc added a commit to dundargoc/neovim that referenced this pull request Oct 22, 2023
This will run the three test suites (unit, functional and old) in
parallel, meaning that neovim is built for each test and run separately.
This has a slight increase in total CI usage, but it allows rerunning
only the the specific test suite that failed for flaky tests, which will
save some time.

Ideally we'd remove any drawbacks by building neovim once and reusing it
for each test suite, but that is not currently possible due to poor
upload/download speeds of the upload-artifact and download-artifact
actions. This has been addressed in
actions/toolkit#1488, but will only be made
available in upload-artifact@v4 and download-artifact@v4.
dundargoc added a commit to dundargoc/neovim that referenced this pull request Oct 22, 2023
This will run the three test suites (unit, functional and old) in
parallel, meaning that neovim is built for each test and run separately.
This has a slight increase in total CI usage, but it allows rerunning
only the specific test suite that failed for flaky tests, which will
save some time.

Ideally we'd remove any drawbacks by building neovim once and reusing it
for each test suite, but that is not currently possible due to poor
upload/download speeds of the upload-artifact and download-artifact
actions. This has been addressed in
actions/toolkit#1488, but will only be made
available in upload-artifact@v4 and download-artifact@v4.
dundargoc added a commit to neovim/neovim that referenced this pull request Oct 22, 2023
This will run the three test suites (unit, functional and old) in
parallel, meaning that neovim is built for each test and run separately.
This has a slight increase in total CI usage, but it allows rerunning
only the specific test suite that failed for flaky tests, which will
save some time.

Ideally we'd remove any drawbacks by building neovim once and reusing it
for each test suite, but that is not currently possible due to poor
upload/download speeds of the upload-artifact and download-artifact
actions. This has been addressed in
actions/toolkit#1488, but will only be made
available in upload-artifact@v4 and download-artifact@v4.
Derrick-MUGISHA pushed a commit to Derrick-MUGISHA/toolkit that referenced this pull request Oct 12, 2026
…#1488)

* Artifact zip creation + blob storage upload functionality

* Fix lint

* PR feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants