Skip to content

Instantly share code, notes, and snippets.

@juliusl
Last active August 28, 2023 20:51
Show Gist options
  • Save juliusl/4ac5db33d81cc7eea322bd1189cd6568 to your computer and use it in GitHub Desktop.
Save juliusl/4ac5db33d81cc7eea322bd1189cd6568 to your computer and use it in GitHub Desktop.
Instructions for ACI

Quick start for acr-mirror

These are the following steps that are required to manually enable the mirror,

  • Install rpm package
  • Install overlaybd
  • Enable http auth
  • Configure mirror
  • Enable tcmu and overlaybd services

Step 1) Download binaries

Binaries can be downloaded from: https://acrstreamingpackage.blob.core.windows.net/bin/latest/acr-mirror-mariner.rpm

Step 2) Installation

Install the mirror and the overlaybd binaries,

sudo rpm -i ./acr-mirror-mariner.rpm
sudo /opt/acr/tools/overlaybd/install.sh

For Overlaybd Auth, if you're going to be using a MSI based auth flow then you'll do the following,

sudo /opt/acr/tools/overlaybd/enable-http-auth.sh

Otherwise, follow the instructions to setup file-based authn found here: https://github.com/containerd/overlaybd#credential-config

Step 3) Login

If az cli is installed or if the current environment is aks then the mirror will use MSI or the azure sdk to handle auth.

Otherwise, you can use the /login api to authenticate.

Here is an example script,

https://gist.github.com/juliusl/d1649b5d9d180e20135ca1d47a2a9a0c

Step 4) Start/Configure Mirror

sudo systemctl start acr-mirror

You can check that it started correctly with,

journalctl -u acr-mirror

Note: This should output the port the mirror is listening on, it should also indicate if the file access provider is being used.

or

curl http://localhost:8578/status

Finally configure the mirror,

curl -X PUT 'http://localhost:8578/config?ns=_default&enable_suffix=azurecr.io&stream_format=overlaybd&enable_containerd=true'

or if you know the registry you want to enable the mirror for,

curl -X PUT 'http://localhost:8578/config?ns=<registry-name>.azurecr.io&stream_format=overlaybd&enable_containerd=true'

This will enable the containerd client-side hosts config so it does not require a containerd restart.

Step 5) Enable tcmu and overlaybd services

Finally, enable overlaybd services,

sudo modprobe target_core_user
sudo /opt/acr/tools/overlaybd/enable.sh

NOTE This will restart containerd

To check the status of overlaybd there are several places to check,

  1. systemd --
  • sudo systemctl status overlaybd-tcmu
  • sudo systemctl status overlaybd-snapshotter
  1. logs - Check the overlaybd/accelerated-container-snapshotter repos for log directories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment