-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 users to set TMPDIR environment #5412
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Should |
Some users have small /var/tmp directories and need to be able to specify a different location for temporary files, which includes more space. Signed-off-by: Daniel J Walsh <[email protected]>
@karlyeurl Nice catch, I missed that one. |
LGTM |
} | ||
|
||
return tmpdir | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this cause the --tmpdir
global option to be ignored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were already being ignored.
Man page for podman documents this.
--tmpdir
Path to the tmp directory, for libpod runtime content.
NOTE --tmpdir is not used for the temporary storage of downloaded images. Use the environment variable TMPDIR
to change the temporary storage location of downloaded container images. Podman defaults to use /var/tmp
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I'd pulled up the man page and in my rush neglected to read the note. Ugh.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thanks for making this change. I was surprised to see my /var filling up when I thought I had locked it down to only daemons.
It's unfortunate this is inconsistent with mktemp
which defaults to /tmp
when TMPDIR is unset. I don't suppose you would consider making /tmp
the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kouso unless my memory banks have fogged over, I believe we originally had /tmp as the default several versions ago, but ran into a lot of issues with container builds not working as there wasn't enough space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! Well, I suppose it depends on your setup. On my build system, /tmp
is larger than /var
.
I can just set up a /etc/profile.d/ file to get mktemp
and podman
to agree, so it's not a big deal. Thanks for taking the time to fill me in.
/lgtm |
/hold cancel |
Hey guys, Just curious - is there any way to set this via configuration files? Our /var/tmp is really small, and it seems a little sketchy adding TMPDIR to every scope (shell/scripts) that podman is running in. It appears the libpod.conf tmp_dir is not the same as TMPDIR which isn't the same as --tmpdir (--tmpdir != $TMPDIR != tmp_dir in libpod.conf). Just seems like something you'd should be able to control via storage.conf or containers.conf. Our podman solution is looking a little messy with configuration files (storage.conf), environment variables (TMPDIR), some runtime arguments (--tmpdir) that we have to maintain. Thoughts? Thanks, Grant |
@rhatdan would this line in /etc/containers/containers.conf do the trick?
|
No, that's the libpod tmpdir, which is distinct. |
However, there is a field for setting environment of the runtime in containers.conf.
Setting that would let you set the TMPDIR environment variable for all calls to Podman/Buildah. |
Correct Should work. |
Ran into this running
Should https://github.com/containers/storage also be changed? |
This might be fixed in newer versions of Podman. The containers.conf should not be an issue, if you can trigger this by doing TMPDIR=/BIGDIR podman ... That means that the code is not properly telling containers image where to store it's blobs. |
I had |
Right, I am not sure if this was fixed in podman 1.9. Podman 2.* should have fixes for this though. |
Not sure if this is what @saper was saying - couldn't tell if @saper was were setting via Still got errors about /var/tmp. |
It should definitely be [engine] not [containers] |
This code is in the main function of podman.
Which should be setting the environment variable. |
Ok I found the bug. |
Thanks Dan. Another comment here is that - aren't we overloading the environment variable TMPDIR? I know once this fix goes through, I can set it selectively through containers.conf, but at the same time, I broke stuff by setting $TMPDIR in my bashrc. TMPDIR is used by the Why can't we have a new variable named like PODMAN_TMPDIR to avoid name conflicts since they do fundamentally different things? Or what this by design? |
Well there are other places within GOLANG that will use TMPDIR, which makes having a different environment variable potentially confusing. |
Some users have small /var/tmp directories and need to be able to specify a different location
for temporary files, which includes more space.
Fixes: #5411
Signed-off-by: Daniel J Walsh [email protected]