Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Publish :latest docker tag"

# Trigger the workflow on any commit or merge to the main branch
on:
push:
branches:
- main

env:
DOCKER_IMAGE_REGISTRY_PATH: nspanelmanager/nspanelmanager
DOCKER_TAG: test # TODO: change it after proper testing (after merge)

jobs:
publish:
runs-on: ubuntu-24.04

permissions:
contents: read

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Get Git commit timestamps
run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV

- name: Set up QEMU (required for Buildx)
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0

- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
Comment thread
sebastienvermeille marked this conversation as resolved.
Outdated
password: ${{ secrets.DOCKER_HUB_SECRET }}

- name: Build and push multi-arch image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: ./docker # Path to your Dockerfile
# note: platforms list: https://github.com/docker/setup-qemu-action
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,qemu-arm,qemu-aarch64
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are these run in parallel or serially?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I wanted to go the simple way first so it is currently: sequential

We can change it later on using a matrix and some mechanisms (the doc also mention that variant but it is slightly more complicated to setup)

Let me know if you want it already in parallel I can give it a shot too

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The current free tier we are using have a limit of 6 hours per job, so not doing it in parallel it will fail. Also, we are currently building with Home Assistant builder and what is considered armhf in that (I'm guessing that's the qemu-arm thing here) takes about 6-7 hours to build. So, that specific image has to be built at my PC currently and then uploaded.

This is a known issue that I have to fix, unfortunately it requires a bit of work and I don't feel we should do that work before we publish the current beta as stable. Basically, we need to remove the ZMQ and rework the communication between the web interface and the MQTTManager-component.

push: true
tags: ${{ env.DOCKER_IMAGE_REGISTRY_PATH }}:${{ env.DOCKER_TAG }}
env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
11 changes: 6 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM --platform=$BUILDPLATFORM python:3.11 AS build
# syntax=docker/dockerfile:1
# check=error=true

FROM python:3.11 AS build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG no_mqttmanager_build
Expand Down Expand Up @@ -51,15 +54,13 @@ RUN if [ "$IS_DEVEL" == "yes" ]; then conan profile detect --force && echo 'core

# Install software needed to build and run the manager
RUN apt-get install -y --no-install-recommends \
postgresql-client curl inotify-tools net-tools nginx build-essential
# && rm -rf /var/lib/apt/lists/*
postgresql-client curl inotify-tools net-tools nginx build-essential \
&& rm -rf /var/lib/apt/lists/*

RUN pip install -r requirements.txt # Install python packages
#RUN /bin/bash /MQTTManager/install_cmake.sh # Install cmake from source as it's only available for x86_64 and armv8 in repo

RUN echo "alias ll='ls -lh --color=auto'" >> /etc/bash.bashrc

#RUN if [ -z "$no_mqttmanager_build" ]; then /bin/bash /usr/src/app/make_mqttmanager.sh && /bin/bash /MQTTManager/cleanup_build.sh; else echo "Not building MQTTManager."; fi

EXPOSE 8000
CMD ["/bin/bash", "./run_uwsgi.sh"]