From 0f0f7c50037b87e40372a3cb36d5b0ef4dc3da2d Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Sun, 29 Oct 2023 11:57:59 +0100 Subject: [PATCH 1/2] Move CI container creation to kiwix/container-images --- .github/workflows/container_images.yml | 43 -------------------------- ci_images/alpine_builder.dockerfile | 23 -------------- ci_images/bionic_builder.dockerfile | 26 ---------------- ci_images/f35_builder.dockerfile | 28 ----------------- ci_images/focal_builder.dockerfile | 40 ------------------------ 5 files changed, 160 deletions(-) delete mode 100644 .github/workflows/container_images.yml delete mode 100644 ci_images/alpine_builder.dockerfile delete mode 100644 ci_images/bionic_builder.dockerfile delete mode 100644 ci_images/f35_builder.dockerfile delete mode 100644 ci_images/focal_builder.dockerfile diff --git a/.github/workflows/container_images.yml b/.github/workflows/container_images.yml deleted file mode 100644 index e3f5e0bd..00000000 --- a/.github/workflows/container_images.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Container images CD - -on: - push: - paths: - - 'ci_images/**' - release: - types: [published] - -env: - IMAGE_PREFIX: ghcr.io/kiwix/kiwix-build_ci_ - -jobs: - Container: - strategy: - fail-fast: false - matrix: - variant: [f35, focal, bionic, alpine] - runs-on: ubuntu-22.04 - - steps: - - name: Retrieve the code - uses: actions/checkout@v3 - - - name: Setup container image name - id: env - run: | - echo "IMAGE_NAME=${{ env.IMAGE_PREFIX }}${{ matrix.variant }}" >> $GITHUB_OUTPUT - - - name: Build container image - run: | - docker build -t ${{ steps.env.outputs.IMAGE_NAME }}:dev - < ci_images/${{ matrix.variant }}_builder.dockerfile - - - name: Tag release container image - if: github.event.action == 'published' - run: | - docker tag ${{ steps.env.outputs.IMAGE_NAME }}:dev ${{ steps.env.outputs.IMAGE_NAME }}:$GITHUB_REF_NAME - docker tag ${{ steps.env.outputs.IMAGE_NAME }}:dev ${{ steps.env.outputs.IMAGE_NAME }}:latest - - - name: Upload container image - run: | - echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.GHCR_USERNAME }}" --password-stdin - docker push --all-tags ${{ steps.env.outputs.IMAGE_NAME }} diff --git a/ci_images/alpine_builder.dockerfile b/ci_images/alpine_builder.dockerfile deleted file mode 100644 index 19c2070f..00000000 --- a/ci_images/alpine_builder.dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM alpine:3.16 - -ENV LANG C.UTF-8 -ENV OS_NAME alpine - -RUN apk update -q \ - && apk add -q --no-cache \ -# Base build tools - bash build-base git py3-pip \ -# Packaged dependencies - xz-dev \ - zstd-dev \ - xapian-core-dev \ - icu-dev icu-data-full \ - gtest-dev - -# Create user -RUN addgroup --gid 121 runner -RUN adduser -u 1001 -G runner -h /home/runner -D runner -USER runner -ENV PATH /home/runner/.local/bin:$PATH -RUN pip3 install meson ninja ; \ - ln -s /usr/bin/python3 /home/runner/.local/bin/python diff --git a/ci_images/bionic_builder.dockerfile b/ci_images/bionic_builder.dockerfile deleted file mode 100644 index 7aaf64e0..00000000 --- a/ci_images/bionic_builder.dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -FROM ubuntu:bionic - -ENV LANG C.UTF-8 -ENV OS_NAME bionic - -RUN apt update -q \ - && apt-get update \ - && apt install -q -y --no-install-recommends \ -# Base build tools - build-essential automake libtool cmake ccache pkg-config autopoint patch \ - python3-pip python3-setuptools python3-wheel git subversion wget unzip \ - ninja-build openssh-client curl \ -# Packaged dependencies - libbz2-dev uuid-dev zlib1g-dev \ - libgtest-dev \ -# Other tools (to remove) -# vim less grep \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/debconf/* \ - && pip3 install meson pytest gcovr requests distro - -# Create user -RUN groupadd --gid 121 runner -RUN useradd --uid 1001 --gid 121 --create-home runner -USER runner -ENV PATH /home/runner/.local/bin:$PATH diff --git a/ci_images/f35_builder.dockerfile b/ci_images/f35_builder.dockerfile deleted file mode 100644 index 5dcf261b..00000000 --- a/ci_images/f35_builder.dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM fedora:35 - -ENV LANG C.UTF-8 -ENV OS_NAME f35 - -RUN dnf install -y --nodocs \ -# Base build tools - make automake libtool cmake git-core subversion pkg-config gcc-c++ \ - wget unzip ninja-build ccache which patch gcovr xz openssh-clients \ - python3-pip \ -# Cross win32 compiler - mingw32-gcc-c++ mingw32-bzip2-static mingw32-win-iconv-static \ - mingw32-winpthreads-static mingw32-zlib-static mingw32-xz-libs-static \ - mingw32-libmicrohttpd \ -# python3 - python3-pip python-unversioned-command \ -# Other tools (to remove) -# vim less grep - && dnf remove -y "*-doc" \ - && dnf autoremove -y \ - && dnf clean all \ - && pip3 install meson pytest requests distro - -# Create user -RUN groupadd --gid 121 runner -RUN useradd --uid 1001 --gid 121 --create-home runner -USER runner -ENV PATH /home/runner/.local/bin:$PATH \ No newline at end of file diff --git a/ci_images/focal_builder.dockerfile b/ci_images/focal_builder.dockerfile deleted file mode 100644 index 13bb9fcb..00000000 --- a/ci_images/focal_builder.dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM ubuntu:focal - -ENV LANG C.UTF-8 -ENV OS_NAME focal -ENV DEBIAN_FRONTEND noninteractive - -RUN apt update -q \ - && apt install -q -y --no-install-recommends \ -# Base build tools - build-essential automake libtool cmake ccache pkg-config autopoint patch \ - python3-pip python3-setuptools python3-wheel git subversion wget unzip \ - ninja-build openssh-client curl libgl-dev \ -# Python (2) is needed to install android-ndk - python \ -# Packaged dependencies - libbz2-dev libmagic-dev uuid-dev zlib1g-dev \ - libmicrohttpd-dev aria2 libgtest-dev libgl-dev \ -# Devel package to compile python modules - libxml2-dev libxslt-dev python3-dev \ -# Qt packages - libqt5gui5 qtbase5-dev qtwebengine5-dev libqt5svg5-dev qt5-image-formats-plugins qt5-default \ -# To create the appimage of kiwix-desktop - libfuse2 fuse patchelf \ -# Flatpak tools - elfutils flatpak flatpak-builder \ -# Cross win32 compiler - g++-mingw-w64-i686 gcc-mingw-w64-i686 gcc-mingw-w64-base mingw-w64-tools \ -# Cross compile i586 - libc6-dev-i386 lib32stdc++6 gcc-multilib g++-multilib \ -# Other tools (to remove) -# vim less grep \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/debconf/* \ - && pip3 install meson pytest gcovr requests distro - -# Create user -RUN groupadd --gid 121 runner -RUN useradd --uid 1001 --gid 121 --create-home runner -USER runner -ENV PATH /home/runner/.local/bin:$PATH From b743487ba0a677ac2fe094bf5914fb978f4a6751 Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Mon, 30 Oct 2023 20:07:22 +0100 Subject: [PATCH 2/2] Use CI container image 2023-10-30 --- .github/workflows/ci.yml | 2 +- .github/workflows/releaseNigthly.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f02aa9ba..29b2c4f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: SSH_KEY: /tmp/id_rsa runs-on: ubuntu-22.04 container: - image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:dev" + image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2023-10-30" options: "--device /dev/fuse --privileged" steps: - name: Checkout code diff --git a/.github/workflows/releaseNigthly.yml b/.github/workflows/releaseNigthly.yml index 19b647d2..b486ed7d 100644 --- a/.github/workflows/releaseNigthly.yml +++ b/.github/workflows/releaseNigthly.yml @@ -45,7 +45,7 @@ jobs: SSH_KEY: /tmp/id_rsa runs-on: ubuntu-22.04 container: - image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:38" + image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2023-10-30" options: "--device /dev/fuse --privileged" steps: - name: Checkout code