Interaction between --upload-base-dir and --upload path names, and consistency with LocalArtifact.add_local_file().
The following discussion should be addressed. Repasting the end of the discussion:
Looking at !159 (comment 368407) I think there's a mismatch between what I said and what ended up implemented.
I said:
But upon further thoughts, I think the cleanest is that upload_base_directory should be None by default and in that case, we just use the basename of each file (whether relative or absolute). When upload_base_directory has a value, then all files passed as parameter to --upload must be within that directory (otherwise we error out), and they will produce a pathname that is relative to the base directory.
So the idea was to compute relative path names for paths in the artifact, not to impose relative path names as input, and error out for the weird cases that would have opened up the can of worms as you say.
We should consider adjusting the behavior of the command line interface to match the above (from a cursory look, right now it assumes that all paths passed to --upload
are relative when you pass --upload-base-dir
) and maybe it would make sense to move that feature into LocalArtifact
so that one can do local_artifact.add_local_file(file, artifact_base_dir=artifact_base_dir)
and have an artifact containing file with a computed relative path (being the relative path of file
inside artifact_base_dir
).