From f6279045ffaa082570087de3d82c0a465f80a006 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 8 May 2019 13:25:29 +0200 Subject: [PATCH 1/4] Use our wheels for build --- Dockerfile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8e105f31..adfa443b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,20 +7,16 @@ ENV ARCH=${BUILD_ARCH} # Install requirements COPY requirements.txt /usr/src/ RUN apk add --no-cache \ - rsync \ - openssh-client \ - && apk add --no-cache --virtual .build-dependencies \ - build-base \ - openssl-dev \ - libffi-dev \ - && export MAKEFLAGS="-j$(nproc)" \ - && pip3 install --no-cache-dir -r /usr/src/requirements.txt \ - && apk del .build-dependencies \ + rsync \ + openssh-client \ + && pip3 install --no-cache-dir --find-links https://wheels.hass.io/alpine-3.9/${BUILD_ARCH}/ \ + -r /usr/src/requirements.txt \ && rm -f /usr/src/requirements.txt # Install builder COPY . /usr/src/builder/ -RUN pip3 install --no-cache-dir /usr/src/builder \ +RUN pip3 install --no-cache-dir + /usr/src/builder \ && rm -fr /usr/src/builder WORKDIR /data From aa13f3238462ff1f41ac607e376ee36b5738d899 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 8 May 2019 13:28:52 +0200 Subject: [PATCH 2/4] Update azure-pipelines.yml --- azure-pipelines.yml | 55 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ca1ddaec..2b1b0da2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,10 @@ variables: value: 'v1.16.3' - name: versionBuilder value: '3.1' + - name: versionWheels + value: '0.3' - group: docker + - group: wheels jobs: @@ -48,11 +51,59 @@ jobs: displayName: 'Run Hadolint' +- job: 'Wheels' + condition: eq(variables['Build.SourceBranchName'], 'master') + timeoutInMinutes: 360 + pool: + vmImage: 'ubuntu-16.04' + strategy: + maxParallel: 3 + matrix: + amd64: + buildArch: 'amd64' + i386: + buildArch: 'i386' + armhf: + buildArch: 'armhf' + armv7: + buildArch: 'armv7' + aarch64: + buildArch: 'aarch64' + steps: + - script: | + sudo apt-get install -y --no-install-recommends \ + qemu-user-static \ + binfmt-support + + sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc + sudo update-binfmts --enable qemu-arm + sudo update-binfmts --enable qemu-aarch64 + displayName: 'Initial cross build' + - script: | + mkdir -p .ssh + echo -e "-----BEGIN RSA PRIVATE KEY-----\n$(wheelsSSH)\n-----END RSA PRIVATE KEY-----" >> .ssh/id_rsa + ssh-keyscan -H $(wheelsHost) >> .ssh/known_hosts + chmod 600 .ssh/* + displayName: 'Install ssh key' + - script: sudo docker pull homeassistant/$(buildArch)-wheels:$(versionWheels) + displayName: 'Install wheels builder' + - script: | + sudo docker run --rm -v $(pwd):/data:ro -v $(pwd)/.ssh:/root/.ssh:rw \ + homeassistant/$(buildArch)-wheels:$(versionWheels) \ + --apk "build-base;libffi-dev;openssl-dev" \ + --index https://wheels.hass.io \ + --requirement requirements.txt \ + --upload rsync \ + --remote wheels@$(wheelsHost):/opt/wheels + displayName: 'Run wheels build' + + - job: 'ReleaseDEV' - condition: and(eq(variables['Build.SourceBranchName'], 'master'), succeeded('Tox'), succeeded('Hadolint')) + condition: and(eq(variables['Build.SourceBranchName'], 'master'), succeeded('Tox'), succeeded('Hadolint'), succeeded('Wheels')) dependsOn: - 'Tox' - 'Hadolint' + - 'Wheels' pool: vmImage: 'ubuntu-16.04' steps: @@ -88,4 +139,4 @@ jobs: -v /run/docker.sock:/run/docker.sock:rw -v $(pwd):/data:ro \ homeassistant/amd64-builder:$(versionBuilder) \ --builder-wheels --all -t /data --docker-hub homeassistant - displayName: 'Build Release' \ No newline at end of file + displayName: 'Build Release' From 5be12bf06a6ea571af47b83d2c77eeff6ce113eb Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 8 May 2019 13:31:02 +0200 Subject: [PATCH 3/4] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index adfa443b..cc638a09 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN apk add --no-cache \ # Install builder COPY . /usr/src/builder/ -RUN pip3 install --no-cache-dir +RUN pip3 install --no-cache-dir \ /usr/src/builder \ && rm -fr /usr/src/builder From ffc82cff569717455ee141492139b4f32c96d408 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 8 May 2019 13:31:29 +0200 Subject: [PATCH 4/4] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cc638a09..5cc92c20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ ENV ARCH=${BUILD_ARCH} COPY requirements.txt /usr/src/ RUN apk add --no-cache \ rsync \ - openssh-client \ + openssh-client \ && pip3 install --no-cache-dir --find-links https://wheels.hass.io/alpine-3.9/${BUILD_ARCH}/ \ -r /usr/src/requirements.txt \ && rm -f /usr/src/requirements.txt