Skip to content
This repository has been archived by the owner on Oct 9, 2021. It is now read-only.

Commit

Permalink
Fix cryptography wheels (#5)
Browse files Browse the repository at this point in the history
Installs Rust
Adds hack to Docker FS so armv6/v7 builds complete successfully.
  • Loading branch information
alexyao2015 authored Feb 9, 2021
1 parent 0475ddd commit e530602
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,27 @@ jobs:
arch_friendly: i386
hass_arch: i386
s6_arch: x86
rust_arch: i686-unknown-linux-gnu
- arch: linux/amd64
arch_friendly: amd64
hass_arch: amd64
s6_arch: amd64
rust_arch: x86_64-unknown-linux-gnu
- arch: linux/arm/v6
arch_friendly: armv6
hass_arch: armv6
s6_arch: arm
rust_arch: arm-unknown-linux-gnueabi
- arch: linux/arm/v7
arch_friendly: armv7
hass_arch: armv7
s6_arch: armhf
rust_arch: armv7-unknown-linux-gnueabihf
- arch: linux/arm64
arch_friendly: arm64
hass_arch: aarch64
s6_arch: aarch64
rust_arch: aarch64-unknown-linux-gnu

steps:
- name: Checkout
Expand All @@ -45,11 +50,28 @@ jobs:
with:
install: true

# https://github.com/crazy-max/ghaction-docker-buildx/issues/172
- name: Hack Docker FS to Build cryptography on armv6/armv7
run: |
df -h
sudo swapon --show
sudo dd if=/dev/zero of=/swapfile1 bs=1M count=6K
sudo chmod 600 /swapfile1
sudo mkswap /swapfile1
sudo swapon /swapfile1
sudo swapon --show
sudo free -h
sudo systemctl stop docker
sudo mount -t tmpfs -o size=9G tmpfs /var/lib/docker
df -h
sudo systemctl start docker
- name: Build
run: |
docker build \
--build-arg HASS_ARCH=${{ matrix.hass_arch }} \
--build-arg S6_ARCH=${{ matrix.s6_arch }} \
--build-arg RUST_ARCH=${{ matrix.rust_arch }} \
--tag baseimage:ci \
--platform ${{ matrix.arch }} \
--progress plain \
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# syntax=docker/dockerfile:experimental
ARG HASS_ARCH=amd64
ARG S6_ARCH=amd64
ARG RUST_ARCH=x86_64-unknown-linux-gnu

#####################################################################
# #
# Build Wheels #
# #
#####################################################################
FROM python:3.8-slim as wheels-builder
ARG RUST_ARCH

ENV PIP_EXTRA_INDEX_URL=https://www.piwheels.org/simple
ENV PATH="${PATH}:/root/.cargo/bin"

# Install buildtime packages
RUN apt-get update \
Expand All @@ -22,6 +25,10 @@ RUN apt-get update \
libffi-dev \
libssl-dev

RUN curl -o rustup-init https://static.rust-lang.org/rustup/dist/${RUST_ARCH}/rustup-init \
&& chmod +x rustup-init \
&& ./rustup-init -y --no-modify-path --profile minimal --default-host ${RUST_ARCH}

WORKDIR /wheels
RUN git clone https://github.com/hass-emulated-hue/core.git /app \
&& cp /app/requirements.txt requirements.txt
Expand Down

0 comments on commit e530602

Please sign in to comment.