defenseunicorns / uds-cli

Apache License 2.0
26 stars 11 forks source link

Expand locations for `uds create -o` #879

Open UncleGedd opened 1 month ago

UncleGedd commented 1 month ago

Is your feature request related to a problem? Please describe

Today the uds create -o cmd (particularly the -o flag) is used to create bundles entirely in OCI registries. Let's expand the -o functionality to create bundles and output to a particular directory

Describe the solution you'd like

Additional context

Need to decide if the -o <dir> needs to already exist or if UDS CLI should create the directory + path if it doesn't exist. My hunch is that we force users to create the path beforehand but am open to feedback

jalling97 commented 1 day ago

Just curious, is this issue still relevant?

I was messing around with things and it looks like this is potentially resolved (at least in my environment).

Environment

UDS-CLI version: v0.16.0 OS: Pop! OS 22.04 (essentially Ubuntu 22.04) Permissions: run as root

Testing

I experimented this using the UDS bundles configs in LeapfrogAI

Experiment 1 (local dir exists)

I ran the following:

# from within the lfai repo
cd bundles/latest/gpu

mkdir foo

uds create . -o foo

After creating the package:

ls foo

Which showed:

uds-bundle-leapfrogai-amd64-0.13.1-upstream.tar.zst

Experiment 2 (local directory doesn't exist)

# from within the lfai repo
cd bundles/latest/gpu

#foo exists, foo/bar does not
uds create . -o foo/bar

After creating the package:

ls foo/bar

Which showed:

# bundle is still created
uds-bundle-leapfrogai-amd64-0.13.1-upstream.tar.zst

Conclusion

It appears the -o flag works for designating an output directory even if it's not an OCI registry, at least in this particular environment. It also appears to create directories that don't exist (at least when run as root). Happy to check in non-root scenarios, but I default to it for most UDS work I do.

Additionally, I'm assuming this is the same issue as #37?

UncleGedd commented 1 day ago

cc @catsby

jalling97 commented 20 hours ago

Quick update on this, I retried both experiments again but this time as a non-root user.

Both experiments worked in that the uds bundle was created in a different directory using the -o flag and the directory was created when it didn't exist.