1
0
mirror of https://github.com/home-assistant/operating-system.git synced 2026-04-02 00:27:14 +01:00
Commit Graph

7 Commits

Author SHA1 Message Date
Jan Čermák
21e4c3733d Fix skopeo for ARM images in hassio after builder changes (#4594)
Afer builder changes, ARM images are now correctly published with their
platform, and when skopeo is used to inspect/pull the image on x86 without any
other flags, it fails with:

Error parsing manifest for image: Error choosing image instance: no image found in image index for architecture amd64, variant "", OS linux

Pass the correct arch in skopeo operations to fix that.
2026-03-23 09:36:13 +01:00
Jan Čermák
123b023f20 Fix retry in hassio container fetching, retry with backoff (#4572)
The retry when fetching containers from the registry didn't work because the
script was executed with `set -e`. Capture the error code also for non-zero
exit status.

Also use while loop instead of recursion and back off exponentially - start
with 5s and multiply by 3 (i.e. 5s, 15s, 45s - waiting in total up to 1 minute
for the registry to recover).
2026-03-10 08:12:14 +01:00
Jan Čermák
55655f5a50 Use OCI archive in hassio import to fix Containerd snapshotter issues (#4393)
Importing docker-archive format leads to some layers missing in the content
storage which results in some image metadata missing. This appears to be the
same regression as moby/moby#49473. Importing OCI archives when bootstrapping
the data partition seems to work this bug around.

Fixes #4385
2025-11-11 15:39:50 +01:00
Jan Čermák
abe018d4aa Improve resiliency of skopeo operations in hassio package (#3416)
We still face occasional build errors when fetching from the Docker registry
fails and is not retried with the Skopeo's built-in retry mechanism that was
enabled in #1866. This happens on some network failures, or when premature EOF
is returned when fetching the HTTP data. Seems we're not the only ones having
such issues [1].

To workaround this, add a generic retry shell function that simply retries when
the command ends with a non-zero status, no matter what was the actual cause of
the error.

[1] https://www.github.com/containers/common/issues/654
2024-06-13 15:44:11 +02:00
Stefan Agner
2114dd328f Make container fetching more reliable (#1866)
It seems that the GitHub container registry sometimes returns 503
service unavailable temporarily ("Error fetching tags list: invalid status
code from registry 503"). Use skopeo's retry mechanism to try up to 5
times before failing.
2022-04-25 14:58:22 +02:00
Stefan Agner
19a135edac Avoid race condition when fetching containers during build (#1671)
* Avoid race condition when fetching containers during build

So far only a single builder was active for each architecture. This
toghether with the naming scheme to include architecture/machine name
made sure that an image could only be fetched or used by a single
builder.

However, since most systems are now aarch64, multiple runners are now
active for a single architecture. This makes it necessary to lock
fetching/coping of container images to avoid race conditions.
2021-12-13 15:43:42 +00:00
Stefan Agner
762f098c14 Use skopeo and DIND to download container images (#1561)
* Use skopeo to download container images

Separate container download from image build. This will allow to share
the downloaded images between multiple builds.

We won't store the Supervisor container with the version tag, just with
the latest tag. This allows to simplify the procedure a bit. It seems
there is no downside to this approach.

* Use official Docker in Docker images to build data partition

Instead of building our own Debian based image let's use the official
Docker in Docker image. This avoids building an image for the hassio
data partition and speeds up build as well.

This calls mount commands using sudo to mount the data partition as part
of the buildroot build now. This is not much different from before as
mount has been called as root inside the container, essentially equates
to the same "isolation" level.

* Use image digest as part of the file name

The landing page has no version information in the tag. To avoid
potentially source caching issues, use the digest as part of the file
name.
2021-10-04 10:06:26 +02:00