Code Monkey home page Code Monkey logo

builder's Introduction

Home Assistant Chat Status

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

Check out home-assistant.io for a demo, installation instructions, tutorials and documentation.

This is a project of the Open Home Foundation.

screenshot-states

screenshot-integrations

The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the section on architecture and the section on creating your own components.

If you run into issues while using Home Assistant or during development of a component, check the Home Assistant help section of our website for further help and information.

builder's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

builder's Issues

Builder hangs at the end of a build (non-AMD64 platforms)

My Github actions have stopped working (apologies, I can't say for sure exactly when - it occurred after I hadn't touched the project for a while). It is a .NET Core 6 build.

Everything looks like it succeeds but the process never exists:

#15 exporting to image
#15 exporting layers
#15 exporting layers 0.9s done
#15 writing image sha256:e059b6102f2b0362fe5920e480561c33d0df7ee82ff0f65f5e4fbfc6bd5cc0d3 done
#15 naming to docker.io/***/aarch64-ozric-addon:0.8.0 done
#15 DONE 0.9s
[10:32:07] INFO: Finish build for ***/aarch64-ozric-addon:0.8.0
[10:32:07] INFO: Create image tag: latest
[10:32:07] INFO: Start upload of ***/aarch64-ozric-addon:0.8.0 (attempt #1/3)
[10:32:16] INFO: Upload succeeded on attempt #1
[10:32:16] INFO: Start upload of ***/aarch64-ozric-addon:latest (attempt #1/3)
[10:32:16] INFO: Upload succeeded on attempt #1

It sits and hangs after this output until the build agent times-out and kills it.

I have narrowed it down a little - AMD64 architecture works fine, but ARM v7 and AARCH64 both lock up like this.

Do you have any idea what I might be doing wrong? My project is here if you need to poke around.

CodeNotary signature missing from most recent image

$ docker image ls
REPOSITORY                              TAG         IMAGE ID       CREATED        SIZE
homeassistant/home-assistant            stable      cceebd7b1c95   25 hours ago   1.17GB
ghcr.io/home-assistant/home-assistant   2021.12     cceebd7b1c95   25 hours ago   1.17GB
ghcr.io/home-assistant/home-assistant   2021.12.7   cceebd7b1c95   25 hours ago   1.17GB
ghcr.io/home-assistant/home-assistant   latest      cceebd7b1c95   25 hours ago   1.17GB
ghcr.io/home-assistant/home-assistant   stable      cceebd7b1c95   25 hours ago   1.17GB
ghcr.io/home-assistant/home-assistant   <none>      f7eb691068a1   26 hours ago   1.17GB
ghcr.io/home-assistant/home-assistant   2021.12.6   575a57d856f8   2 days ago     1.16GB

$ vcn authenticate --org home-assistant.io docker://ghcr.io/home-assistant/home-assistant:2021.12.6

Your assets will not be uploaded. They will be processed locally.

Looking for blockchain entry matching the organization (home-assistant.io)...

Name:           docker://homeassistant/aarch64-homeassistant:2021.12.6
Hash:           575a57d856f8f397c00a76ea0d5dbf1e7032ec72f32a5b5a5ba3877eceacead0
Visibility:     PUBLIC
Signer:         not***@hom***********.io
Company:        Home Assistant
SignerID:       0xc7ada38e353d48452d63a65c8c10a89e666e2d46
Level:          3 - ID_VERIFIED
Date:           2021-12-27T23:12:55Z
Status:         TRUSTED

$ vcn authenticate --org home-assistant.io docker://ghcr.io/home-assistant/home-assistant:2021.12.7

Your assets will not be uploaded. They will be processed locally.

Looking for blockchain entry matching the organization (home-assistant.io)...

Kind:           docker
Name:           docker://homeassistant/home-assistant:stable
Hash:           cceebd7b1c9533c31e2b477461800ca6b58bd79ae8cd0d625bf1c761d469df9e
Size:           1.2 GB
Metadata:       architecture="arm64"
                platform="linux"
                version="stable"
                docker={
                    "Id": "sha256:cceebd7b1c9533c31e2b477461800ca6b58bd79ae8cd0d625bf1c761d469df9e",
                    "RepoTags": [
                        "homeassistant/home-assistant:stable",
                        "ghcr.io/home-assistant/home-assistant:2021.12",
                        "ghcr.io/home-assistant/home-assistant:2021.12.7",
                        "ghcr.io/home-assistant/home-assistant:latest",
                        "ghcr.io/home-assistant/home-assistant:stable"
                    ],
                    "RepoDigests": [
                        "homeassistant/home-assistant@sha256:e516e3cc51c5b10d7a99b704dc806787ab0a173919ebcd7f574405e15a76bf40",
                        "ghcr.io/home-assistant/home-assistant@sha256:e516e3cc51c5b10d7a99b704dc806787ab0a173919ebcd7f574405e15a76bf40"
                    ],
                    "Comment": "",
                    "Created": "2021-12-29T19:52:12.075543888Z",
                    "DockerVersion": "20.10.11+azure-3",
                    "Author": "",
                    "Architecture": "arm64",
                    "Os": "linux",
                    "VirtualSize": 1165723398,
                    "Size": 1165723398,
                    "Metadata": {
                        "LastTagTime": "0001-01-01T00:00:00Z"
                    }
                }
Status:         UNKNOWN
Error: cceebd7b1c9533c31e2b477461800ca6b58bd79ae8cd0d625bf1c761d469df9e was not notarized by "home-assistant.io"

Upload failed on ghcr.io, no details

Hello,

I'm currently trying to use this repo as a GitHub Action, here is my workflow:

  publish:
    name: Build and publish Docker image
    runs-on: ubuntu-latest
    needs:
      - lint
      - test
    steps:
      - uses: actions/checkout@v3
      - uses: docker/login-action@v2
        with:
          registry: ghcr.io
          username: bokub
          password: ${{ secrets.GITHUB_TOKEN }}
      - uses: home-assistant/builder@master
        with:
          args: |
            --all \
            --target . \
            --docker-hub ghcr.io/bokub

Whenever the Action runs, the login step succeeds, then the build step fails with the following output:

[10:43:47] INFO: Finish build for ghcr.io/bokub/my-addon-i386:0.1.0
[10:43:47] INFO: Create image tag: latest
[10:43:47] INFO: Start upload of ghcr.io/bokub/my-addon-i386:0.1.0 (attempt #1/3)
[10:43:47] WARNING: Upload failed on attempt #1
[10:43:47] WARNING: Upload failed on attempt #1
[10:44:17] INFO: Start upload of ghcr.io/bokub/my-addon-amd64:0.1.0 (attempt #2/3)
[10:44:17] WARNING: Upload failed on attempt #2
[10:44:17] INFO: Start upload of ghcr.io/bokub/my-addon-i386:0.1.0 (attempt #2/3)
[10:44:18] WARNING: Upload failed on attempt #2
[10:44:47] INFO: Start upload of ghcr.io/bokub/my-addon-amd64:0.1.0 (attempt #3/3)
[10:44:48] FATAL: Upload failed on attempt #3
[10:44:48] INFO: Start upload of ghcr.io/bokub/my-addon-i386:0.1.0 (attempt #3/3)
[10:44:48] FATAL: Upload failed on attempt #3
...

Did I do something wrong?
Is there any way to display the upload error? ("Upload failed" is not enough to understand what went wrong)

Thanks!

CAS registration suspended

For your information the CAS service does not allow new registrations and is therefore unusable for new developers.
Are there any plans to address this problem?
I would like to sign my HomeAssistant add-on somehow :)

More on this here.

Thanks!

Builder fails with 'FATAL: Can't pull image'

I've been using the homeassistant/amd64-builder to build a custom local HASS image, and the command I was using began to fail around a week ago. Previously the build would succeed but now it will throw a fatal error trying to pull the ghcr.io/home-assistant/amd64-homeassistant-base:2023.04.2 image.

$ docker run --rm --privileged --shm-size=1024m -v /var/run/docker.sock:/var/run/docker.sock:ro -v /home/user/projects/home-assistant:/data homeassistant/amd64-builder --amd64 -t /data --test --generic local

Unable to find image 'homeassistant/amd64-builder:latest' locally
latest: Pulling from homeassistant/amd64-builder
ef5531b6e74e: Pull complete 
33b65704084a: Pull complete 
06b79ad9572c: Pull complete 
f68b5e207a61: Pull complete 
3f0f7beaf986: Pull complete 
8450e4bcb7bb: Pull complete 
Digest: sha256:fbdb77f059e734b48e81994dc48add05e08bc0d4d66762d7c7d64f1278a6b970
Status: Downloaded newer image for homeassistant/amd64-builder:latest
[01:03:51] INFO: Setup crosscompiling feature
[01:04:13] INFO: Using host docker setup with '/var/run/docker.sock'
[01:04:13] INFO: Run generic build for: amd64
[01:04:13] INFO: Init cache for homeassistant/amd64-homeassistant:local with tag latest and platform linux/amd64
CAS saved locally the trusted public key
CAS automatically trusted the signature found on current connection
UID:		1684723576173907782
Kind:		docker
Name:		docker://homeassistant/amd64-homeassistant:2023.6.0.dev20230522
Hash:		5daff6b16892dadacc7f6fa04748565df93bb38e7bfb1413b73f58965e3c0d02
Size:		1.8 GB
Timestamp:	2023-05-22 02:46:16.173907782 +0000 UTC
Metadata:	GITHUB_SERVER_URL="https://github.com"
		GITHUB_SHA="69770bac2261c1a9373a7818ab9187df2555f785"
		GITHUB_GRAPHQL_URL="https://api.github.com/graphql"
		GITHUB_EVENT_NAME="schedule"
		GITHUB_WORKFLOW="Build images"
		platform="linux"
		version="2023.6.0.dev20230522"
		CAS_CI_ENV="github"
		GITHUB_JOB="build_base"
		GITHUB_REF="refs/heads/dev"
		GITHUB_RUN_NUMBER="1162"
		docker={
		   "Architecture": "amd64",
		   "Author": "",
		   "Comment": "buildkit.dockerfile.v0",
		   "Created": "2023-05-22T02:45:51.831633722Z",
		   "DockerVersion": "",
		   "Id": "sha256:5daff6b16892dadacc7f6fa04748565df93bb38e7bfb1413b73f58965e3c0d02",
		   "Metadata": {
		       "LastTagTime": "2023-05-22T02:46:14.524286657Z"
		   },
		   "Os": "linux",
		   "RepoDigests": [],
		   "RepoTags": [
		       "homeassistant/amd64-homeassistant:2023.6.0.dev20230522",
		       "homeassistant/amd64-homeassistant:latest",
		       "ghcr.io/home-assistant/amd64-homeassistant:2023.6.0.dev20230522",
		       "ghcr.io/home-assistant/amd64-homeassistant:latest"
		   ],
		   "Size": 1815411594,
		   "VirtualSize": 1815411594
		}
		GITHUB_API_URL="https://api.github.com"
		GITHUB_ACTION="__home-assistant_builder"
		GITHUB_ACTIONS="true"
		GITHUB_ACTOR="balloob"
		GITHUB_REPOSITORY="home-assistant/core"
		GITHUB_RUN_ID="5041097185"
		CI="true"
		architecture="amd64"
		GITHUB_WORKSPACE="/home/runner/work/core/core"
SignerID:	bm90YXJ5QGhvbWUtYXNzaXN0YW50Lmlv
Apikey revoked:	no
Status:		TRUSTED
[01:06:05] INFO: Image homeassistant/amd64-homeassistant:latest is trusted
[01:06:05] INFO: Download image ghcr.io/home-assistant/amd64-homeassistant-base:2023.04.2 for CodeNotary validation
[01:06:07] FATAL: Can't pull image ghcr.io/home-assistant/amd64-homeassistant-base:2023.04.2

Pulling the image on the host works fine

$ docker pull ghcr.io/home-assistant/amd64-homeassistant-base:2023.04.2

2023.04.2: Pulling from home-assistant/amd64-homeassistant-base
Digest: sha256:9ea7d5f25cfb334e1d51d73e60450943ba85df03b3614ab87ca9a46717566b0e
Status: Image is up to date for ghcr.io/home-assistant/amd64-homeassistant-base:2023.04.2
ghcr.io/home-assistant/amd64-homeassistant-base:2023.04.2

But when the --platform amd64 parameter is used like in the script it throws

$ docker pull ghcr.io/home-assistant/amd64-homeassistant-base:2023.04.2 --platform amd64

2023.04.2: Pulling from home-assistant/amd64-homeassistant-base
Digest: sha256:9ea7d5f25cfb334e1d51d73e60450943ba85df03b3614ab87ca9a46717566b0e
Status: Image is up to date for ghcr.io/home-assistant/amd64-homeassistant-base:2023.04.2
No such image: ghcr.io/home-assistant/amd64-homeassistant-base:latest

Perhaps the latest image wasn't tagged correctly, or I'm using the script incorrectly. Happy to provide anything else, I managed to get the image building by removing that image pull (which I believe is used for the CodeNotary) from the builder.sh temporarily.

Use build.json as build spec

Instead, to hardcode build specifications, we should start to use build.json not only for add-ons. We extend the build file with an image option and start to add a build spec to all our images folder. Also, we need an options for additional tags on build spec.

The code mostly exists and needs to be moved from the add-on build function into the generic build function.

It will be not possible for all kinds of builds to use build specs but for most of our builds.

builder.sh - tries to init_crosscompile before start_docker

Greetings.

Lines ~944 & 945, currently look like this:

# Setup docker env
init_crosscompile
start_docker

The only way I could get this to work was to flip-flop them (which makes sense, you have to start docker before you can interact with it), like so:

# Setup docker env
start_docker
init_crosscompile

Thanks!

previously trusted Community Attestation Service changed its signature.

Got the following error multiple times in a test-build pipeline:

Error: operation aborted : rpc error: code = Canceled desc = signature doesn't match provided public key
previously trusted Community Attestation Service changed its signature. In order to trust again the server please provide a new public key or remove .cas-trusted-signing-pub-key stored in home folder.

This was not mitigated by using the --no-cache argument (#147) nor by using a previous version of the workflow (2022.06.2)

Full logs:
https://github.com/tux2000/home-assistant-addons/runs/7177396932?check_suite_focus=true
https://github.com/tux2000/home-assistant-addons/runs/7177672867?check_suite_focus=true
https://github.com/tux2000/home-assistant-addons/runs/7178171929?check_suite_focus=true

Bump Alpine OS version to 3.19

Currently image is using Alpine OS v.3.18.
New 3.19 version was released, can you upgrade to use that?
This is required to allow some downstream ha-addons to support new hardware.

allow different dockerfile location

I have a particular use case, but not so particular when it comes to docker.

I'm building an addon for signal and I'd like to automate the image construction using this builder.
The problem is, with the latest versions of signal, it's not possible to build non 64 bits versions anymore using alpine. That means that I end up with 2 dockerfiles, one for the amd64 and arch64 architectures, and one for the others.

It could be solved by adding an argument to specify the dockerfile location (the equivalent to option -f, --file string Name of the Dockerfile (Default is 'PATH/Dockerfile') in docker build) in this actions' args.

What do you think? I could make a PR about it.

Filesystem overlay crashing

Since yesterday I noticed an error on all of my builds on travis. They all break with following message:

error creating aufs mount to /var/lib/docker/aufs/mnt/ebe77363e81e276e757e0df588bc638bfa7ef24c2775008627ed5559145650f2-init: mount target=/var/lib/docker/aufs/mnt/ebe77363e81e276e757e0df588bc638bfa7ef24c2775008627ed5559145650f2-init data=br:/var/lib/docker/aufs/diff/ebe77363e81e276e757e0df588bc638bfa7ef24c2775008627ed5559145650f2-init=rw:/var/lib/docker/aufs/diff/98f7de999bb01a8e413f13aa97f67fb390e6061d9b9027a1e8ff7b4baf15cff6=ro+wh:/var/lib/docker/aufs/diff/b95fc0285b44c97da0fb9ff2cad58f797ba9d20103b7ba7726789702b8841b46=ro+wh:/var/lib/docker/aufs/diff/921af3e0fefcb71633830dde4ab9c66de484d79d0da3a3cf884306cf0535aeb4=ro+wh,dio,xino=/dev/shm/aufs.xino: invalid argument

see: https://travis-ci.org/Poeschl/Hassio-Addons/jobs/594965328#L257

for "-t, --tag" flag: invalid reference format

Hello,

when I try to build a modified addon, I run into a invalid argument error.
As the modification is minor, I assume a bug in the builder script.
Do you have an idea what creates the following error?

latest builder version updated 20min ago

PS C:\Users\...> docker run --rm --privileged -v ~/.docker:/root/.docker -v /var/run/docker.sock:/var/run/docker.sock:ro -v C:\Users\...\data\HomeAssistant\deconz_beta:/data homeassistant/amd64-builder --all -t /data
[17:19:56] INFO: Setup crosscompiling feature
[17:19:57] INFO: Using host docker setup with '/var/run/docker.sock'
[17:19:57] INFO: Run addon build for: armhf armv7 amd64 i386 aarch64
[17:19:57] ERROR: armv7 not supported for this add-on
[17:19:57] ERROR: i386 not supported for this add-on
[17:19:57] INFO: Init cache for /:0.0.1 with tag latest
[17:19:57] INFO: Init cache for /:0.0.1 with tag latest
[17:19:57] INFO: Init cache for /:0.0.1 with tag latest
[17:19:57] WARNING: No cache image found. Disabling cache for this build.
[17:19:57] INFO: Run build for /:0.0.1
[17:19:57] WARNING: No cache image found. Disabling cache for this build.
[17:19:57] INFO: Run build for /:0.0.1
[17:19:57] WARNING: No cache image found. Disabling cache for this build.
[17:19:57] INFO: Run build for /:0.0.1
invalid argument "/:0.0.1" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.
invalid argument "/:0.0.1" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.
invalid argument "/:0.0.1" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.

Error when starting up the builder - can't enable crosscompiling feature

Hello,
I am having trouble with the builder - not sure if this is a real problem or not. I issue the command:

#! /bin/bash
docker pull homeassistant/amd64-builder

docker run \
        --rm \
        --privileged \
        -v ~/.docker:/root/.docker \
        -v $PWD:/data \
        homeassistant/amd64-builder \
                --all \
                -t /data

and get the warning below:

Using default tag: latest
latest: Pulling from homeassistant/amd64-builder
Digest: sha256:e37fd2a524681470c0b3adaef39a5628495d5e3e0934d65ec8b9548632e33c45
Status: Image is up to date for homeassistant/amd64-builder:latest
docker.io/homeassistant/amd64-builder:latest
[11:24:28] INFO: Setup crosscompiling feature
[11:24:28] WARNING: Can't enable crosscompiling feature                 <----- This warning!
[11:24:28] INFO: Starting docker.
[11:24:28] INFO: Waiting for docker to initialize...
[11:24:29] INFO: Docker was initialized
[11:24:29] INFO: Run addon build for: armhf armv7 amd64 i386 aarch64

Being able to crosscompile seems like a mandatory function so is there some prerequisite I need to install?

My docker info output is attached. Thanks for your help.
docker-info.txt

Push to docker host other than dockerhub?

Is it possible to publish containers to the GitHub container registry rather than dockerhub? I looked through the available options and didn't see a way to do this.

With cache enabled during build, codenotary fails to validate base image

I'm trying to sign a new version of my add-on (previous versions weren't signed), but build fails to verify the base image.

Action, without --no-cache:

    - name: Test build
      uses: home-assistant/[email protected]
      with:
        args: |
          --test \
          --${{ matrix.arch }} \
          --target samba

Fails:

CAS saved locally the trusted public key
CAS automatically trusted the signature found on current connection
Warning: dbb1a3343503e0fe8fd059580dcb871a110aaa134e6893b6d238e6616217c8ff was not notarized
Warning: dbb1a3343503e0fe8fd059580dcb871a110aaa134e6893b6d238e6616217c8ff was not notarized
Warning: dbb1a3343503e0fe8fd059580dcb871a110aaa134e6893b6d238e6616217c8ff was not notarized
...

Adding --no-cache succeeds:

CAS saved locally the trusted public key
CAS automatically trusted the signature found on current connection
UID:		1655138081188031764
Kind:		docker
Name:		docker://homeassistant/armv7-base:3.15
Hash:		35dd67a5fe6b405b37ebc6b9fd30a68c7d6c724a24f69b9f6e5af8a857ace05b
Size:		87 MB
Timestamp:	2022-06-13 16:34:41.188031764 +0000 UTC
Metadata:	CI="true"
		GITHUB_RUN_ID="2489695079"
		GITHUB_SERVER_URL="https://github.com"
		GITHUB_WORKSPACE="/home/runner/work/docker-base/docker-base"
		GITHUB_RUN_NUMBER="114"
		GITHUB_SHA="b369f87158051f3bb085f0bb7896b96ec02390f5"
		docker={
		    "Architecture": "arm",
		    "Author": "",
		    "Comment": "",
		    "Created": "2022-06-13T16:34:38.[173](https://github.com/lmagyar/homeassistant-addon-samba-interface/runs/6873437119?check_suite_focus=true#step:3:182)594705Z",
		    "DockerVersion": "20.10.16+azure-2",
		    "Id": "sha256:35dd67a5fe6b405b37ebc6b9fd30a68c7d6c724a24f69b9f6e5af8a857ace05b",
		    "Metadata": {
		        "LastTagTime": "[202](https://github.com/lmagyar/homeassistant-addon-samba-interface/runs/6873437119?check_suite_focus=true#step:3:211)2-06-13T16:34:39.04953948Z"
		    },
		    "Os": "linux",
		    "RepoDigests": [],
		    "RepoTags": [
		        "homeassistant/armv7-base:3.15",
		        "ghcr.io/home-assistant/armv7-base:3.15"
		    ],
		    "Size": 86703970,
		    "VirtualSize": 86703970
		}
		GITHUB_ACTION="__home-assistant_builder"
		GITHUB_ACTIONS="true"
		GITHUB_GRAPHQL_URL="https://api.github.com/graphql"
		architecture="arm"
		platform="linux"
		version="3.15"
		CAS_CI_ENV="github"
		GITHUB_ACTOR="pvizeli"
		GITHUB_API_URL="https://api.github.com/"
		GITHUB_EVENT_NAME="release"
		GITHUB_JOB="build_alpine"
		GITHUB_REF="refs/tags/2022.06.0"
		GITHUB_REPOSITORY="home-assistant/docker-base"
		GITHUB_WORKFLOW="Build base images"
SignerID:	bm90YXJ5QGhvbWUtYXNzaXN0YW50Lmlv
Apikey revoked:	no
Status:		TRUSTED
[03:43:48] INFO: Image ghcr.io/home-assistant/armv7-base:3.15 is trusted

Support for "--platform" tag to prevent multi-arch FROM image architecture mismatch

Hello,

I manage a repo with +/- 55 addons with local builds, and wanted to convert them to automatic builds. The github actions works very well and was easily implemented in my repo, thanks very much!

There is however one case of failure : addons builds succeed when building from multi-arch base images, but use a wrong arch which result in a "[FATAL tini (*)] exec // failed: Exec format error".

By looking at docker documentation, it seems the "--platform" tag is designed to avoid this.

“–platform” tag : The optional --platform flag can be used to specify the platform of the image in case FROM references a multi-platform image. For example, linux/amd64, linux/arm64, or windows/amd64. By default, the target platform of the build request is used. Global build arguments can be used in the value of this flag, for example automatic platform ARGs allow you to force a stage to native build platform (--platform=$BUILDPLATFORM), and use it to cross-compile to the target platform inside the stage. (Dockerfile reference | Docker Documentation)

I have tried to implement it in my build.json to reference a specific arch when pulling the image, but it fails due to REGEX validation.

Can't parse /data/addons/git/db21ed7f/addons_updater/build.json: does not match regular expression ^([a-zA-Z\-\.:\d{}]+/)*?([\-\w{}]+)/([\-\w{}]+)(:[\.\-\w{}]+)?$ for dictionary value @ data['build_from']['aarch64']. Got '--platform=linux/arm64 homeassistant/aarch64-base-python:3.9-alpine3.13'

Request : I believe that a solution would be to modify the REGEX to allow the plaform tag ; but a second solution could be to automatically support the "--platform" tag in the builder... It would make multi-arch source images work; and would make no impact on single-arch source images

Gain : this would greatly help to help additional users move from locally built to images-distributed addons.

Thanks very much for your consideration. Development is not my core expertise (and neither my full time work) so please bare with me if I was naive and misinterpreted the solution.

Publish action example fails to invalid argument for "-t, --tag" flag: invalid reference format

Hi,

I'm trying to publish my add-on docker images with github actions. I'm using the same code from the Publish action example.

The only difference is the publish step:

      - name: Publish
        uses: home-assistant/builder@master
        with:
          args: |
            --all \
            --target emhass \
            --docker-hub davidusb

This fails to build for each arch throwing these errors:

[22:35:50] INFO: Image ghcr.io/home-assistant/armhf-base-debian:bullseye is trusted
[22:35:50] INFO: Run build for ***/:0.1.29 with platform linux/arm/v6
invalid argument "***/:0.1.29" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.
Error: Process completed with exit code 125.

Thank you for your help

Login to Codenotary fails

Hello,
I'm trying to sign my own addon with my own CAS_API_KEY but the github action always get's stuck trying to login:
https://github.com/SharkyRawr/hass-coredns/runs/6750681106?check_suite_focus=true#step:7:670
If you cannot see the logs. here is the error given:

[...]
##[debug]=> 'env > "/home/runner/work/_actions/home-assistant/builder/2022.03.1/env_file"
##[debug]sed -i "/\(HOME\|TERM\|PWD\|HOSTNAME\|PATH\|SHLVL\|USER\|GOROOT\)/d" "/home/runner/work/_actions/home-assistant/builder/2022.03.1/env_file"
##[debug]
##[debug]docker run --rm --privileged \
##[debug]    -v /var/run/docker.sock:/var/run/docker.sock:ro \
##[debug]    -v ~/.docker:/root/.docker \
##[debug]    -v /home/runner/work/hass-coredns/hass-coredns:/data \
##[debug]    --env-file "/home/runner/work/_actions/home-assistant/builder/2022.03.1/env_file" \
##[debug]    ghcr.io/home-assistant/amd64-builder:2022.03.1 \
##[debug]    --docker-hub-check \
##[debug]--aarch64 \
##[debug]--target /data/coredns \
##[debug]--addon
##[debug]
##[debug]'
##[debug]Result: 'env > "/home/runner/work/_actions/home-assistant/builder/2022.03.1/env_file"
##[debug]sed -i "/\(HOME\|TERM\|PWD\|HOSTNAME\|PATH\|SHLVL\|USER\|GOROOT\)/d" "/home/runner/work/_actions/home-assistant/builder/2022.03.1/env_file"
##[debug]
##[debug]docker run --rm --privileged \
##[debug]    -v /var/run/docker.sock:/var/run/docker.sock:ro \
##[debug]    -v ~/.docker:/root/.docker \
##[debug]    -v /home/runner/work/hass-coredns/hass-coredns:/data \
##[debug]    --env-file "/home/runner/work/_actions/home-assistant/builder/2022.03.1/env_file" \
##[debug]    ghcr.io/home-assistant/amd64-builder:2022.03.1 \
##[debug]    --docker-hub-check \
##[debug]--aarch64 \
##[debug]--target /data/coredns \
##[debug]--addon
##[debug]
##[debug]'
##[debug]Loading env
Run env > "/home/runner/work/_actions/home-assistant/builder/2022.03.1/env_file"
##[debug]/usr/bin/bash --noprofile --norc -e -o pipefail /home/runner/work/_temp/3979b691-5ac5-48a6-8672-c06a9be84875.sh
[05:42:57] INFO: Setup crosscompiling feature
[05:43:04] INFO: Using host docker setup with '/var/run/docker.sock'
[05:53:05] FATAL: Login to Codenotary fails!
##[debug]Re-evaluate condition on job cancellation for step: 'run'.
##[debug]Re-evaluate condition on job cancellation for step: 'Build coredns add-on'.
Error: The operation was canceled.
##[debug]System.OperationCanceledException: The operation was canceled.
##[debug]   at System.Threading.CancellationToken.ThrowOperationCanceledException()
##[debug]   at GitHub.Runner.Sdk.ProcessInvoker.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
##[debug]   at GitHub.Runner.Common.ProcessInvokerWrapper.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
##[debug]   at GitHub.Runner.Worker.Handlers.DefaultStepHost.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Boolean inheritConsoleHandler, CancellationToken cancellationToken)
##[debug]   at GitHub.Runner.Worker.Handlers.ScriptHandler.RunAsync(ActionRunStage stage)
##[debug]   at GitHub.Runner.Worker.ActionRunner.RunAsync()
##[debug]   at GitHub.Runner.Worker.Handlers.CompositeActionHandler.RunStepAsync(IStep step)
##[debug]Finished: run

My addon is here: https://github.com/SharkyRawr/hass-coredns
I copied and adapted the workflow from the dnsmasq module it does work fine without notarizing. Not sure if github actions is blocking outgoing network access or what's up.

How to get image locally

Hello

I'm trying to use the builder on the example project and I can't quite work it out

I did a git clone [email protected]:home-assistant/addons-example.git and from the addons-example directory did:

docker run \
  --rm \
  -it \
  --name builder \
  --privileged \
  -v $(pwd)/example:/data \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  homeassistant/aarch64-builder \
  --target /data    --aarch64  -d local
[23:41:53] INFO: No crossbuild support on host
[23:41:53] INFO: Using host docker setup with '/var/run/docker.sock'
[23:41:53] INFO: Run addon build for: aarch64
[23:41:53] INFO: Init cache for local/aarch64-addon-example:1.2.0 with tag latest and platform linux/arm64
[23:42:00] WARNING: No cache image found. Disabling cache for this build.
[23:42:00] INFO: Run build for local/aarch64-addon-example:1.2.0 with platform linux/arm64
WARNING: No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
[+] Building 1.8s (7/7) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                     0.0s
 => => transferring dockerfile: 410B                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                          0.0s
 => [internal] load metadata for ghcr.io/home-assistant/aarch64-base:3.15                                                                                0.4s
 => CACHED [1/3] FROM ghcr.io/home-assistant/aarch64-base:3.15@sha256:005f1df70301d335e050c8db253e69a8b7862b6f1f6ffa31f686751bb165a6e2                   0.0s
 => => resolve ghcr.io/home-assistant/aarch64-base:3.15@sha256:005f1df70301d335e050c8db253e69a8b7862b6f1f6ffa31f686751bb165a6e2                          0.0s
 => [internal] load build context                                                                                                                        0.1s
 => => transferring context: 1.70kB                                                                                                                      0.1s
 => [2/3] RUN     curl -sSLf -o /usr/bin/tempio     "https://github.com/home-assistant/tempio/releases/download/2021.09.0/tempio_aarch64"                1.3s
 => [3/3] COPY rootfs /                                                                                                                                  0.0s
[23:42:02] INFO: Finish build for local/aarch64-addon-example:1.2.0
[23:42:02] INFO: Create image tag: latest
Error response from daemon: failed to find image local/aarch64-addon-example:1.2.0: docker.io/local/aarch64-addon-example:1.2.0: image not known

I'm on MacOS Monterey 12.6 (M1 2020 Macbook Pro)
Using podman 4.3.1

Is there an option so that the built image is available to my local podman without pushing it to a docker registry?

How to compile the supervisor

I've been bashing my head against the wall for a few hours now and can't seem to figure out how to build the supervisor image for local development.

The development guide doesn't have any docker related info...

Any help for getting the development environment setup with docker is greatly appreciated!

Upload fail on <X> and error in docker login.

Hello,
I have trouble using the builder as documented. I start the build process with the command:

docker run --rm --privileged -v ~/.docker:/root/.docker -v $(pwd)/${addon}:/data homeassistant/amd64-builder --all -t /data

and all works but at the end no image is uploaded. I look in the build code and see that the docket push is redirected do /dev/null so I'm unble toi check the real error.

[13:55:22] INFO: Finish build for dianlight/rpi-mysensor-gw-armv7:0.0.19
[13:55:22] INFO: Create image tag: latest
[13:55:22] INFO: Start upload dianlight/rpi-mysensor-gw-armv7:0.0.19
[13:55:24] WARNING: Upload fail on 1
[13:55:50] INFO: Start upload dianlight/rpi-mysensor-gw-armhf:0.0.19
[13:55:51] WARNING: Upload fail on 3
[13:55:54] INFO: Start upload dianlight/rpi-mysensor-gw-armv7:0.0.19
[13:55:56] WARNING: Upload fail on 2
[13:56:21] INFO: Start upload dianlight/rpi-mysensor-gw-armhf:latest
[13:56:24] WARNING: Upload fail on 1
[13:56:26] INFO: Start upload dianlight/rpi-mysensor-gw-armv7:0.0.19
[13:56:28] WARNING: Upload fail on 3
[13:56:54] INFO: Start upload dianlight/rpi-mysensor-gw-armhf:latest
[13:56:55] WARNING: Upload fail on 2
[13:56:58] INFO: Start upload dianlight/rpi-mysensor-gw-armv7:latest
[13:57:00] WARNING: Upload fail on 1
[13:57:25] INFO: Start upload dianlight/rpi-mysensor-gw-armhf:latest
[13:57:27] WARNING: Upload fail on 3
[13:57:30] INFO: Start upload dianlight/rpi-mysensor-gw-armv7:latest
[13:57:32] WARNING: Upload fail on 2
[13:58:02] INFO: Start upload dianlight/rpi-mysensor-gw-armv7:latest
[13:58:03] WARNING: Upload fail on 3

I try to do the docker login in the buildervm with the command docker run -ti --rm --privileged -v ~/.docker:/root/.docker -v $(pwd)/${addon}:/data homeassistant/amd64-builder --all -t /data --docker-login but the following error is raised:

tMacBook-Pro-143 hassio-addons % docker run -ti --rm --privileged -v ~/.docker:/root/.docker -v $(pwd)/${addon}:/data homeassistant/amd64-builder --all -t /data --docker-login
[14:02:53] INFO: Setup crosscompiling feature
[14:02:53] INFO: Starting docker.
[14:02:53] INFO: Waiting for docker to initialize...
[14:02:54] INFO: Docker was initialized
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: REMOVED
Password:
Error saving credentials: error storing credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH, out: ``

Unable to build custom add-on insede Home Assistant

After a successful build and push in a Docker repository, a custom add-on I developed was't able to build in Home Assistant in an update process. The following error was thrown:

21-01-30 22:51:25 ERROR (MainThread) [supervisor.jobs] Unhandled exception: You must specify a directory to build in path Traceback (most recent call last): File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 61, in wrapper return await self._method(*args, **kwargs) File "/usr/src/supervisor/supervisor/addons/__init__.py", line 280, in update await addon.instance.update(store.version, store.image) File "/usr/src/supervisor/supervisor/utils/__init__.py", line 33, in wrap_api return await method(api, *args, **kwargs) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/supervisor/supervisor/docker/interface.py", line 359, in _update self._install(version, image=image, latest=latest) File "/usr/src/supervisor/supervisor/docker/addon.py", line 401, in _install self._build(version) File "/usr/src/supervisor/supervisor/docker/addon.py", line 414, in _build image, log = self.sys_docker.images.build( File "/usr/local/lib/python3.8/site-packages/docker/models/images.py", line 279, in build resp = self.client.api.build(**kwargs) File "/usr/local/lib/python3.8/site-packages/docker/api/build.py", line 148, in build raise TypeError("You must specify a directory to build in path") TypeError: You must specify a directory to build in path

Thank you so much for your help or suggestions.

YAML Support

Upon trying to convert an addon's config files from JSON to YAML I get the following error from the builder
jq: error: Could not open file /tmp/build_config/config.json: No such file or directory
Is YAML supported by the builder action?

How can i build my hass-supervisor

Hi, these days i want to install hassio in raspberry pi 3+ run as BalenaOS. It use balena-engine to manage their container. I have to build hass-supervisor by myself, but i can't very well to understand how to use it.

When i try to do it, i get some trouble like this. I need some help.
image

Best regards~~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.