Skip to content

Use tar to extract cache, write by chunks and new build state #6793

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

Closed
wants to merge 5 commits into from

Conversation

humitos
Copy link
Member

@humitos humitos commented Mar 18, 2020

We have experimented memory leak issues when extracting a file using the Python API. We are using regular tar for this operation now since the test done in the server with 2.5Gb has shown better results regarding memory usage and extracting time as well.

Besides, instead of reading the whole file into memory (fd.read()), we are iterating over its chunks and saving these small chunks into disk.

Finally, we are adding a new build status "Pulling cache" for now to communicate that the build is not in "Triggered" state, but it's actually doing something.

Related to #6763

We have experimented memory leak issues when extracting a file using
the Python API. We are using regular `tar` for this operation now
since the test done in the server with 2.5Gb has shown better results
regarding memory usage and extracting time as well.
@humitos humitos requested a review from a team March 18, 2020 19:33
humitos added 2 commits March 18, 2020 18:30
We were loading all the file in memory and then dumping it into the
disk. Now, we just read a chunk and dump that chunk into the disk.
@humitos humitos changed the title Use tar command to extract cached environment Use tar to extract cache, write by chunks and new build state Mar 19, 2020
Instead of downloading the file into a temporary file (`storage.open`
and then `.read`) to save the file into another temporary file (our
loop reading by chunks) we just use the `storage.open` response as the
input of the `tarfile.open` function and extract it from there.
@humitos
Copy link
Member Author

humitos commented Mar 20, 2020

Closing in favor of #6799 and #6800

@humitos humitos closed this Mar 20, 2020
@stsewd stsewd deleted the humitos/use-tar-command branch July 28, 2020 17:59
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.

1 participant