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

[optimize] add a new parameter to LoadOptions #1376

Open
kakaZhou719 opened this issue Mar 22, 2023 · 8 comments
Open

[optimize] add a new parameter to LoadOptions #1376

kakaZhou719 opened this issue Mar 22, 2023 · 8 comments

Comments

@kakaZhou719
Copy link

hi containers team,

when i learning our code, I found that If i knew the format of the tar file in advance , the program wouldn't need to guess the format, which will save a lot of time.

so , should we add a new parameter to indicate the format of load package on LoadOptions ?

FYI:

for _, f := range []func() ([]string, string, error){

@vrothberg
Copy link
Member

Hi @kakaZhou719,

Thanks for reaching out and offering help, very much appreciated!

I found that If i knew the format of the tar file in advance , the program wouldn't need to guess the format, which will save a lot of time.

That sounds like a nice improvement assuming the user knows exactly the format of the archive.

Before starting, I want to ask @mtrmac and @rhatdan what they think about your proposal.

@rhatdan
Copy link
Member

rhatdan commented Mar 22, 2023

Fine with me. But I would like to hear from @mtrmac

@mtrmac
Copy link
Collaborator

mtrmac commented Mar 22, 2023

If this is for a new caller, I think a set of separate functions (Runtime.LoadDockerArchive etc.) would be simpler.

If this is for the primary podman load $path code path, yes, an option probably makes sense — and it would be great to update as many callers as possible to use that option; heuristically guessing among four possibly quite expensive readers is very inefficient and historically resulted in bad error messages (which we have, sort of, fixed by just listing all of the error messages…)

@kakaZhou719
Copy link
Author

@rhatdan @mtrmac @vrothberg ,thanks for your kind reply.

BTW, could we support to set temporary directory when loading?

the reason is that some image is very large, and require at least three times free disk to load. I see that current default temporary directory is the /var/tmp/ directory. If we could set the work temporary directory, we can separate it from the system disk which will avoid load failure.

@mtrmac
Copy link
Collaborator

mtrmac commented Mar 24, 2023

BTW, could we support to set temporary directory when loading?

That’s configurable in c/image via BigFilesTemporaryDir, and c/common/libimage seems to read containers.conf for that at least in some places, so that would be the setting to tweak. (I didn’t check if LoadDockerArchive applies this setting; if not, that should be added.)

@rhatdan
Copy link
Member

rhatdan commented Mar 27, 2023

Yes setting this in containers.conf, or setting the TMPDIR environment variable allow you to customize this.

@kakaZhou719
Copy link
Author

@rhatdan @mtrmac @vrothberg , do we have a plan to support a set of separate functions (Runtime.LoadDockerArchive) ?

@vrothberg
Copy link
Member

vrothberg commented Mar 28, 2023

@rhatdan @mtrmac @vrothberg , do we have a plan to support a set of separate functions (Runtime.LoadDockerArchive) ?

I would rather add a Format string field to the LoadOptions. Otherwise, all callers would have the same dispatch table (switch Format case ... case ... case ...).

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

4 participants