charliecloud icon indicating copy to clipboard operation
charliecloud copied to clipboard

ch-fromhost option order

Open rarensu opened this issue 1 year ago • 3 comments

ch-fromhost has two kinds of options according to its signature

ch-fromhost [options] [file_options]

the documentation doesn't define which of the options are "file options". In particular, the --dest option kind of looks like a file option to me, but since its in a third "category" all on its own, it's ambiguous.

Apparently, the order matters. If I put the --dest option after another option such as -p, the dest option is completely ignored.

I don't love that the options are only accepted in a certain order, but if it has to be that way, it should be really clear in the documentation which options have to come first.

charliecloud 0.33

rarensu avatar Sep 22 '23 02:09 rarensu

Ah, yes, I too found it a little confusing initially.

-d should proceed a -p argument, otherwise -p will use the inferred injection directory. The idea for this is to be able to inject to both a custom path and the inferred path in the same injection call. For example:

$ ch-fromhost -p /opt/foo/lib64/libfabric.so -d /usr/bin -p /usr/local/bin/fi_info

In the above /opt/foo/lib64/libfabric.so will be injected to /usr/local/lib (inferred) and fi_info will be injected into the containers /usr/bin folder.

I didn't figure that out myself until I poked around the script; so yes, I agree the documentation needs some help here.

j-ogas avatar Sep 26 '23 22:09 j-ogas

I think a better way to say this may be:

all --path arguments preceding --dest will use the inferred path; all --path arguments after --dest will use the specified path?

j-ogas avatar Sep 26 '23 22:09 j-ogas

That seems like an unnecessarily specific use case. I guess you can say that about the whole tool.

Fixing the documentation is a higher priority than refactoring the arguments, but if it was on your to-do list anyways to refactor the arguments, I thought you might like some feedback from someone who tried to use it in the wild.

I think I would rather if it worked like how bind mount works, where you go "source:dest" for explicit destinations. Yes, you'd have to repeat the destination for each file, but then it becomes pretty much impossible to misunderstand. I like that the bind mount syntax is maximally explicit.

rarensu avatar Sep 27 '23 02:09 rarensu