cirruslabs/cirrus-cli

Cirrus CLI attempts to pull an image even though it's already available locally

bartekpacia opened this issue · 6 comments

Basically the title.

$ docker images
REPOSITORY                       TAG        IMAGE ID       CREATED        SIZE
ghcr.io/cirruslabs/cirrus-cli    v0.119.0   9163cd7c694d   2 weeks ago    58.4MB
ghcr.io/cirruslabs/flutter       3.22.0     83097a4467df   6 weeks ago    2.92GB
ghcr.io/cirruslabs/android-sdk   34         2e1b7231459d   6 weeks ago    1.69GB
alpine                           3.19       ace17d5d883e   5 months ago   7.73MB

But when I run my Cirrus CI pipeline, it does this:

$ op run -- cirrus run \                                                                                                                                                   exit 1
  --output simple \
  --env CIRRUS_BRANCH=master \
  --env OP_SERVICE_ACCOUNT_TOKEN="$(op read "op://Personal/1Password/service accounts/3eyjcas2mkzd4yh4jmwgd7xzoa")" \
  'Deploy Android app'
Started 'Deploy Android app' Task
Started 'Preparing execution environment...'
Preparing volume to work with...
'Preparing execution environment...' succeeded in 10s!
Started 'image pull'
Pulling image ghcr.io/cirruslabs/android-sdk:34...

It's really annoying for me because I often work on university Wi-Fi which is very slow :(

You probably want to use --lazy-pull or --tart-lazy-pull command-line arguments to cirrus run.

Thanks for such a quick response @edigaryev! :)

I tried --lazy-pull (since I'm trying to boot a Linux container, not a macOS VM), but then I get this (I'm on M1 Mac):

$ op run -- cirrus run \
  --lazy-pull \
  --output simple \
  --env CIRRUS_BRANCH=master \
  --env OP_SERVICE_ACCOUNT_TOKEN="$(op read "op://Personal/1Password/service accounts/3eyjcas2mkzd4yh4jmwgd7xzoa")" \
  'Deploy Android app'
Started 'Deploy Android app' Task
Started 'Preparing execution environment...'
Preparing volume to work with...
'Preparing execution environment...' succeeded in 0.5s!
Error response from daemon: image with reference ghcr.io/cirruslabs/android-sdk:34 was found but does not match the specified platform: wanted linux/amd64, actual: linux/arm64

The ghcr.io/cirruslabs/android-sdk:34 image is arm64 indeed:

$ docker image inspect $(docker images -q) | jq -r '.[] | .RepoTags[0], .Architecture' | sed 'N;s/\n/ /'
alpine:3.19 arm64
ghcr.io/cirruslabs/cirrus-cli:v0.119.0 amd64
ghcr.io/cirruslabs/flutter:3.22.0 arm64
ghcr.io/cirruslabs/android-sdk:34 arm64

Off-topic: shouldn't --lazy-pull be the default in Cirrus CLI?

Off-topic: shouldn't --lazy-pull be the default in Cirrus CLI?

I don't think so because that's not how it works in the Cirrus CI, yet Cirrus CLI is designed to mimic the Cirrus CI where possible.

Note that even without the --lazy-pull we still have the underlying instance's (whether it's containers or Tart) image caching logic at hand, and it won't do anything if the image really is up-to-date.

It seems that the underlying reason for this was observed in #748 (namely, the architecture mismatch for the images), so closing as a duplicate.