Skip to content

Conversation

@AkihiroSuda
Copy link
Member

Example:

images:
- location: "https://example.com/dummy-x86_64"
  arch: "x86_64"
- location: "https://example.com/dummy-aarch64"
  arch: "aarch64"

Before:

$ limactl start dummy
INFO[0000] Using the existing instance "dummy"
INFO[0000] Attempting to download the image              arch=x86_64 digest= location="https://example.com/dummy-x86_64"
FATA[0000] failed to download the image, attempted 2 candidates, errors=[failed to download "https://example.com/dummy-x86_64": expected HTTP status 200, got 404 Not Found unsupported arch: "aarch64"]

After:

$ limactl start dummy
INFO[0000] Using the existing instance "dummy"
INFO[0000] Attempting to download the image              arch=x86_64 digest= location="https://example.com/dummy-x86_64"
FATA[0000] failed to download "https://example.com/dummy-x86_64": expected HTTP status 200, got 404 Not Found

@jandubois
Copy link
Member

This does not deal gracefully with the situation when there are no images for the required arch. I've modified the template to only have aarch64 images and tried to create an x86_64 instance:

$ l start examples/opensuse.yaml
? Creating an instance "opensuse" Proceed with the current configuration
INFO[0001] Attempting to download the nerdctl archive    arch=x86_64 digest="sha256:ce4615eb027265d2aaa61f185388738096b652541f7fc7c607bc3f829dd5713d" location="https://github.com/containerd/nerdctl/releases/download/v1.3.0/nerdctl-full-1.3.0-linux-amd64.tar.gz"
Downloading the nerdctl archive (nerdctl-full-1.3.0-linux-amd64.tar.gz)
232.92 MiB / 232.92 MiB [-----------------------------------] 100.00% 7.42 MiB/s
INFO[0033] Downloaded the nerdctl archive from "https://github.com/containerd/nerdctl/releases/download/v1.3.0/nerdctl-full-1.3.0-linux-amd64.tar.gz"
FATA[0035] exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/Users/jan/.lima/opensuse/ha.stderr.log")

$ tail -1 /Users/jan/.lima/opensuse/ha.stderr.log
{"level":"fatal","msg":"open /Users/jan/.lima/opensuse/basedisk: no such file or directory","time":"2023-04-09T21:13:06-07:00"}

There is no indication that Lima didn't find an image to download at all. It should have detected this, and not proceeded to download nerdctl.

@AkihiroSuda
Copy link
Member Author

Updated

Example:
```yaml
images:
- location: "https://example.com/dummy-x86_64"
  arch: "x86_64"
- location: "https://example.com/dummy-aarch64"
  arch: "aarch64"
```

Before:
```console
$ limactl start dummy
INFO[0000] Using the existing instance "dummy"
INFO[0000] Attempting to download the image              arch=x86_64 digest= location="https://example.com/dummy-x86_64"
FATA[0000] failed to download the image, attempted 2 candidates, errors=[failed to download "https://example.com/dummy-x86_64": expected HTTP status 200, got 404 Not Found unsupported arch: "aarch64"]
```

After:
```console
$ limactl start dummy
INFO[0000] Using the existing instance "dummy"
INFO[0000] Attempting to download the image              arch=x86_64 digest= location="https://example.com/dummy-x86_64"
FATA[0000] failed to download "https://example.com/dummy-x86_64": expected HTTP status 200, got 404 Not Found
```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@AkihiroSuda
Copy link
Member Author

@jandubois PTAL

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@jandubois jandubois merged commit 7574cd9 into lima-vm:master Apr 14, 2023
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

Successfully merging this pull request may close these issues.

2 participants