Skip to content

eth-cscs/local-registry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Local Container Registry

local-registry manages a local container registry

it can run a local container registry inside a slurm job listening on localhost

It provides:

  • env-registry - script to be sourced in order to add its folder to $PATH
  • registry - script to manage local registry server
  • podman-cached - wrapper for "podman build", add those options that enable cache on local registry

Disclaimer

Any other user accessing the same node can have complete access to the local registry and its content.
The local registry instance is not protected by any credentials.
The local registry instance is not supposed to be shared among users.

Beware of Filesystem Cleanup policies that can corrupt the content of the local registry in the long term.

Workflow

# DOWNLOAD 
$ git clone https://github.com/eth-cscs/local-registry.git
Cloning into 'local-registry'...
...
Receiving objects: 100% (6/6), done.
$ cd local-registry

# LAUNCH interactive slurm job - local registry can work only on compute nodes inside a slurm job
$ srun ... --pty bash

# SETUP registry
$ mkdir <CHOSEN_REGISTRY_DIRPATH>

# <CHOSEN_REGISTRY_DIRPATH> can be omitted if unchanged 
$ . env-registry && registry up <CHOSEN_REGISTRY_DIRPATH>
Local registry started on folder <CHOSEN_REGISTRY_DIRPATH>
The address is:
<REGISTRY_HOST>:<REGISTRY_PORT>

# USE registry as cache
$ cat ./Containerfile
FROM ubuntu:latest
RUN apt update
RUN apt upgrade -y

$ podman-cached .
Executing: podman build --layers --tls-verify=false --cache-from=<REGISTRY_HOST>:<REGISTRY_PORT>/cache --cache-to=<REGISTRY_HOST>:<REGISTRY_PORT>/cache .
STEP 1/3: FROM ubuntu:latest
STEP 2/3: RUN apt update
--> Using cache 7e878891345baea142da9dca42bf131488a317178a162b1388f449f40328eb45
--> Pushing cache [localhost:5000/cache]:3e03c073728436d9337daacb491169e6cb3868d4f0f9385058d8333dc62eb903
--> 7e878891345b
STEP 3/3: RUN apt upgrade -y
--> Using cache 2c8781e264b03ce41c571b6a4d24c8d8472a413ee50073ad662e517f92a0ff2a
--> Pushing cache [localhost:5000/cache]:3e44a53a47cd2318f910222fec5ae4f68853c471410d73f52e6b01c4eaec5555
--> 2c8781e264b0
2c8781e264b03ce41c571b6a4d24c8d8472a413ee50073ad662e517f92a0ff2a

# STOP registry
$ registry down
local registry is stopped.

Additional commands

# CHECK registry status (UP)
$ registry status
local registry is running at:
<REGISTRY_HOST>:<REGISTRY_PORT>

# CHECK registry status (DOWN)
$ registry status
local registry is stopped.

# DELETE registry (when data is not needed anymore)
$ registry delete
Removing directory <CHOSEN_REGISTRY_DIRPATH> content ... [DONE]
Removing configuration file <HOME>/.local_registry/registry.conf ... [DONE]

local registry is DELETED.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages