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

retreive the labels of the image being used #86

Open
tomeichlersmith opened this issue Jan 23, 2024 · 2 comments
Open

retreive the labels of the image being used #86

tomeichlersmith opened this issue Jan 23, 2024 · 2 comments

Comments

@tomeichlersmith
Copy link
Owner

Is your feature request related to a problem? Please describe.
It is helpful when using the image as an environment to do some mild introspection.

Describe the solution you'd like
Something like denv config print --image or whatever that calls the necessary docker inspect --format .... and apptainer inspect ... commands.

Describe alternatives you've considered
An alternative is just to document it, but I think this is a simple enough task that it can be done across the current four runners. I'll probably have it be an optional feature of the runners so that future runners don't have too many requirements outside of download images and actually running them.

@tomeichlersmith
Copy link
Owner Author

We can pretty-print json via python -m json.tool which is (hopefully) available on most systems. I'm worried about calling out to python though, so I will print the raw JSON if python is not available.

@tomeichlersmith
Copy link
Owner Author

apptainer pretty-prints the JSON with a few extra levels of depth, but the labels are still there and it is still json

apptainer inspect --json <image>

we can select the labels with docker inspect but its JSON is just a single-line stream, so we need another tool to pretty-print it

docker inspect --format '{{json .Config.Labels}}' ldmx/dev:latest | python3 -m json.tool

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

1 participant