hpc / charliecloud

Now hosted on GitLab.
https://gitlab.com/charliecloud/main
Apache License 2.0
313 stars 61 forks source link

Leave a breadcrumb about the state of the container at last pull #1688

Open qwofford opened 1 year ago

qwofford commented 1 year ago

A container can be ch-run'd in three ways:

  1. directory
  2. path to squashfs
  3. name in ch-image storage

I will call these three container types "deployed containers", though the third ch-run type makes me nervous and I may never use it.

For any deployed container, I would like the ability to inspect it for a hash that may be referenced to ch-pull from an arbitrary container registry. If the container has been deleted in the registry, there's nothing you can do about that and that's ok.

If the container has been changed since it was deployed, this will fail to match a remote hash and that is also ok. In this case my pull should fail and that's ok.

This feature request is driven by a need to know whether an application is running in a container or not, and if it is in a container, we want to store how to get it for posterity (@DanielRJohnson). The logic is something like this:

if $CH_RUNNING and $CH_IMAGE_REF are set: 
    container_ref = $CH_IMAGE_REF
else:
    container_ref = “baremetal”
pagrubel commented 1 year ago

I believe in BEE using our current builder we always run from a directory, even when we pull. The hazard with this is that the dir may be a previous version so it would be nice to

pagrubel commented 1 year ago

Sorry, I did not complete my thought. It might be nice to have a way to compare to the version in a registry.