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

Archive uploads instead of uploading individual files #36

Open
jry-anchor opened this issue Nov 21, 2019 · 10 comments
Open

Archive uploads instead of uploading individual files #36

jry-anchor opened this issue Nov 21, 2019 · 10 comments

Comments

@jry-anchor
Copy link

I have a 900MB node_modules directory with 86k files. Using actions/upload-artifact as-is takes about an hour and a half -- the logs appear to indicate that files are uploaded individually.

If I tar/gzip the directory first, the tar takes about 30 seconds, reducing it to 175MB, then the upload takes about 25 seconds.

Example of how actions/cache does it: https://github.com/actions/cache/blob/master/src/save.ts

@g105b
Copy link

g105b commented Nov 25, 2019

You should not use actions/upload-artifact for this, instead you should use actions/cache - see https://github.com/actions/cache

Edit Dec 2020: I was wrong. actions/cache can cache the process of running npm install, but doesn't make sense to share the node_modules directory between steps.

@jry-anchor
Copy link
Author

@g105b in that case the Passing data between jobs in a workflow doc needs an update, since that page doesn't mention limitations or actions/cache at all. Also Comparing artifacts and dependency caching. How many files and/or which size of directory warrants using caching instead of archiving?

Also calling it a cache for some "artifacts" but not others is a bit of a misnomer, since I need the exact contents of the directory in all the jobs in the workflow.

@g105b
Copy link

g105b commented Nov 25, 2019

I understand and share your frustration. I hope this is made a bit simpler soon.

@Clemens-E
Copy link

Hi, I'm trying to have a build process spit out a fully working artifact that includes everything it needs to run (node_modules, dist, etc).
But I'm facing the same problem: uploading 16k files takes longer than actually building the whole application.

If I understand this correct, actions/cache would only help if you need to share the node_modules between workflow runs?

Is there any workaround to force actions/upload-artifact to somehow tar the files instead of uploading them all individually?
I also tried using actions/create-zip-file, which speeds everything up, but when downloading the artifact there now is a zip inside a zip, and I feel like that's unnecessary.
I'm guessing #69 would fix this problem, but it doesn't seem like that will be a thing soon

@MCOfficer
Copy link

MCOfficer commented Jul 17, 2020

You can get a massive boost by taring the folder before uploading it (Zip also works, but then you're wasting time on compression). The resulting file being zipped again is unfortunate, but the speedup is worth it.
Edit: see also #39

@g105b
Copy link

g105b commented Dec 10, 2020

Any movement on this?

@Th3S4mur41
Copy link

Facing the same issue... The current solution to the problem is to use upload-tartifact and download-tartifact which do exactly that.

It would be nicer to have an option in the original action to tar before upload / untar after download instead

@olalonde
Copy link

Bump. This should probably be done by default.

@raimille1
Copy link

Bump!

@g105b
Copy link

g105b commented Apr 19, 2024

Any movement on this?

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

No branches or pull requests

7 participants