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

Allow overriding temporary directory with $TMPDIR env var #7

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

catkins
Copy link
Contributor

@catkins catkins commented Sep 30, 2024

Currently, the images and SOCI artifacts are stored in /tmp during processing, which is a very sensible default.

We run this in our CI environment where we have a 1GiB tmpfs volume at /tmp, so on some images we get this in our build logs.

{"level":"error","error":"errors encountered while building soci layers; write /tmp/tmp.3943925700: no space left on device; write /tmp/tmp.1788043098: no space left on device","RegistryURL":"<accountid>.dkr.ecr.<region>.amazonaws.com","ImageDigest":"<digest>","time":"2024-09-30T03:22:06Z","message":"SOCI index build error"}

I'd love to be able to override the temporary directory used by this program using the built-in $TMPDIR env var recognised by the Go stdlib, for some specific builds.

References

https://pkg.go.dev/os#MkdirTemp

If dir is the empty string, MkdirTemp uses the default directory for temporary files, as returned by TempDir.

https://pkg.go.dev/os#TempDir

On Unix systems, it returns $TMPDIR if non-empty, else /tmp.

@kichik kichik merged commit 9c68e1d into CloudSnorkel:main Sep 30, 2024
1 check passed
@kichik
Copy link
Member

kichik commented Sep 30, 2024

Thanks!

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.

2 participants