From 17a17e78d894769755750cba791161dec0712112 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 18 Jul 2024 10:48:01 +0700 Subject: [PATCH 01/11] feat: Layered devtools image --- .github/workflows/build-docker.yml | 28 ++++++++++++++++++++++++++++ dockerfiles/devtools.dockerfile | 5 +++++ 2 files changed, 33 insertions(+) create mode 100644 dockerfiles/devtools.dockerfile diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 5f9815ac..de7eaeb6 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -148,5 +148,33 @@ jobs: # also tag as latest buildah tag $MANIFEST $MANIFEST:latest || : buildah manifest push --all --format v2s2 $MANIFEST docker://$MANIFEST:$RELEASE + + docker-layer: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + dockerfile: + - dockerfiles/devtools.dockerfile + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Build images + uses: docker/build-push-action@v6 + with: + context: . + file: ${{ matrix.dockerfile }} + platforms: linux/amd64,linux/arm64 + push: false + tags: | + ghcr.io/ultramarine-linux/ultramarine-devtools:40 + ghcr.io/ultramarine-linux/ultramarine-devtools:latest + args: | + RELEASE=40 + #### LIVE ISO #### diff --git a/dockerfiles/devtools.dockerfile b/dockerfiles/devtools.dockerfile new file mode 100644 index 00000000..5ccae70d --- /dev/null +++ b/dockerfiles/devtools.dockerfile @@ -0,0 +1,5 @@ +ARG RELEASE + +FROM ghcr.io/ultramarine-linux/ultramarine:${RELEASE} + +RUN dnf install -y @development-tools From d7e886096c01260fcf8f8e39e063ae8b43d26e7e Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 18 Jul 2024 10:52:13 +0700 Subject: [PATCH 02/11] fix: require push task first --- .github/workflows/build-docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index de7eaeb6..d5d78a2e 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -151,6 +151,7 @@ jobs: docker-layer: runs-on: ubuntu-latest + needs: docker-push strategy: fail-fast: true matrix: From f9871d5fca61df04b38d665fa1cc8fd8cf36a819 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 18 Jul 2024 10:53:58 +0700 Subject: [PATCH 03/11] fix: use build-args --- .github/workflows/build-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index d5d78a2e..d34b378c 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -174,7 +174,7 @@ jobs: tags: | ghcr.io/ultramarine-linux/ultramarine-devtools:40 ghcr.io/ultramarine-linux/ultramarine-devtools:latest - args: | + build-args: | RELEASE=40 From 2ecb32f4409db1b7c36a2b39fe96e9ab59037de6 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 18 Jul 2024 10:58:33 +0700 Subject: [PATCH 04/11] chore: start debugging workflow --- .github/workflows/build-docker.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index d34b378c..53e559e3 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -57,8 +57,6 @@ jobs: variant: - base/base-docker-x86_64 - base/base-docker-aarch64 - - base/devtools-docker-aarch64 - - base/devtools-docker-x86_64 outputs: artifact: ${{ matrix.variant }} @@ -115,8 +113,6 @@ jobs: #### DOCKER PUSH ###### docker-push: - strategy: - fail-fast: false runs-on: ubuntu-latest needs: docker if: github.event_name != 'pull_request' @@ -151,7 +147,7 @@ jobs: docker-layer: runs-on: ubuntu-latest - needs: docker-push + # needs: docker-push strategy: fail-fast: true matrix: @@ -165,7 +161,7 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Build images - uses: docker/build-push-action@v6 + uses: dockerfiles/build-push-action@v6 with: context: . file: ${{ matrix.dockerfile }} From cd8b34d382959a03d8366d9d32b34bc77c1635b4 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 18 Jul 2024 10:59:44 +0700 Subject: [PATCH 05/11] fix: workflow name --- .github/workflows/build-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 53e559e3..ce2e36f7 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -161,7 +161,7 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Build images - uses: dockerfiles/build-push-action@v6 + uses: docker/build-push-action@v6 with: context: . file: ${{ matrix.dockerfile }} From 17a44ce89259429d2eae2e96cc9c5e4b6ec66bbe Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 18 Jul 2024 11:03:03 +0700 Subject: [PATCH 06/11] fix: set up buildx first --- .github/workflows/build-docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index ce2e36f7..f06a18b5 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -159,6 +159,8 @@ jobs: uses: actions/checkout@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Build images uses: docker/build-push-action@v6 From 2e5b3616fd178d4e3ef5341a891574e93b973887 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 18 Jul 2024 11:06:25 +0700 Subject: [PATCH 07/11] feat: run layer job after new image is pushed --- .github/workflows/build-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index f06a18b5..65e72c3f 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -147,7 +147,7 @@ jobs: docker-layer: runs-on: ubuntu-latest - # needs: docker-push + needs: docker-push strategy: fail-fast: true matrix: From da6b99119479bbaac621c0c3c97847fedf567283 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 18 Jul 2024 11:28:41 +0700 Subject: [PATCH 08/11] chore: clean up dnf cache, push images --- .github/workflows/build-docker.yml | 2 +- dockerfiles/devtools.dockerfile | 2 +- .../modules/base/devtools-docker-aarch64.yaml | 37 ------------------- .../modules/base/devtools-docker-x86_64.yaml | 37 ------------------- 4 files changed, 2 insertions(+), 76 deletions(-) delete mode 100644 katsu/modules/base/devtools-docker-aarch64.yaml delete mode 100644 katsu/modules/base/devtools-docker-x86_64.yaml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 65e72c3f..a98b4a1c 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -168,7 +168,7 @@ jobs: context: . file: ${{ matrix.dockerfile }} platforms: linux/amd64,linux/arm64 - push: false + push: true tags: | ghcr.io/ultramarine-linux/ultramarine-devtools:40 ghcr.io/ultramarine-linux/ultramarine-devtools:latest diff --git a/dockerfiles/devtools.dockerfile b/dockerfiles/devtools.dockerfile index 5ccae70d..f3c03d0e 100644 --- a/dockerfiles/devtools.dockerfile +++ b/dockerfiles/devtools.dockerfile @@ -2,4 +2,4 @@ ARG RELEASE FROM ghcr.io/ultramarine-linux/ultramarine:${RELEASE} -RUN dnf install -y @development-tools +RUN dnf install -y @development-tools && dnf clean all diff --git a/katsu/modules/base/devtools-docker-aarch64.yaml b/katsu/modules/base/devtools-docker-aarch64.yaml deleted file mode 100644 index 85a0bd93..00000000 --- a/katsu/modules/base/devtools-docker-aarch64.yaml +++ /dev/null @@ -1,37 +0,0 @@ -builder: dnf -distro: Ultramarine Linux 40 Container (Development Tools) - -import: - - base-docker.yaml - -dnf: - releasever: 40 - arch: aarch64 -packages: - #releng and packaging - - katsu - - anda - - anda-mock-configs - - anda-srpm-macros - - libostree - - rpm-ostree - #languages - - vala - - rust - - python3 - - python3-pip - - nodejs - #hwe/anywhere - - vboot-utils - #gui - - libhelium - - libhelium-devel - - tau-helium - - tau-hydrogen - - gtk4-devel - - rust-gtk4-devel - #utils - - git - - micro - - nano - - vim diff --git a/katsu/modules/base/devtools-docker-x86_64.yaml b/katsu/modules/base/devtools-docker-x86_64.yaml deleted file mode 100644 index c312bd2d..00000000 --- a/katsu/modules/base/devtools-docker-x86_64.yaml +++ /dev/null @@ -1,37 +0,0 @@ -builder: dnf -distro: Ultramarine Linux 40 Container (Development Tools) - -import: - - base-docker.yaml - -dnf: - releasever: 40 - arch: x86_64 -packages: - #releng and packaging - - katsu - - anda - - anda-mock-configs - - anda-srpm-macros - - libostree - - rpm-ostree - #languages - - vala - - rust - - python3 - - python3-pip - - nodejs - #hwe/anywhere - - vboot-utils - #gui - - libhelium - - libhelium-devel - - tau-helium - - tau-hydrogen - - gtk4-devel - - rust-gtk4-devel - #utils - - git - - micro - - nano - - vim From 85393128b506c96b5a0261b14ddab8cf916b52fb Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 18 Jul 2024 17:13:11 +0700 Subject: [PATCH 09/11] ci: make version into matrix --- .github/workflows/build-docker.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index a98b4a1c..44c759cc 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -151,6 +151,8 @@ jobs: strategy: fail-fast: true matrix: + version: + - 40 dockerfile: - dockerfiles/devtools.dockerfile @@ -170,10 +172,10 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: | - ghcr.io/ultramarine-linux/ultramarine-devtools:40 + ghcr.io/ultramarine-linux/ultramarine-devtools:${{ matrix.version }} ghcr.io/ultramarine-linux/ultramarine-devtools:latest build-args: | - RELEASE=40 + RELEASE=${{ matrix.version }} #### LIVE ISO #### From 915e07bc40d0236b2223b7380ebc60353c67d115 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 18 Jul 2024 18:00:26 +0700 Subject: [PATCH 10/11] fix: docker push --- .github/workflows/build-docker.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 44c759cc..7102b0ef 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -39,7 +39,8 @@ env: katsu https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-40.noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-40.noarch.rpm - + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} on: push: branches: [ "um40" ] @@ -146,6 +147,9 @@ jobs: buildah manifest push --all --format v2s2 $MANIFEST docker://$MANIFEST:$RELEASE docker-layer: + permissions: + contents: read + packages: write runs-on: ubuntu-latest needs: docker-push strategy: @@ -163,6 +167,12 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v2.1.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build images uses: docker/build-push-action@v6 From 2f466f6840498f49fda62a12a4b21fdbba481dc7 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 18 Jul 2024 22:27:24 +0700 Subject: [PATCH 11/11] feat: Gitpod docker image (#29) --- .github/workflows/build-docker.yml | 13 ++++++++----- dockerfiles/gitpod.dockerfile | 9 +++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 dockerfiles/gitpod.dockerfile diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 7102b0ef..04f16dd5 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -157,8 +157,11 @@ jobs: matrix: version: - 40 - dockerfile: - - dockerfiles/devtools.dockerfile + docker: + - dockerfile: dockerfiles/devtools.dockerfile + image: ghcr.io/ultramarine-linux/ultramarine-devtools + - dockerfile: dockerfiles/gitpod.dockerfile + image: ghcr.io/ultramarine-linux/ultramarine-gitpod steps: - name: Checkout @@ -178,12 +181,12 @@ jobs: uses: docker/build-push-action@v6 with: context: . - file: ${{ matrix.dockerfile }} + file: ${{ matrix.docker.dockerfile }} platforms: linux/amd64,linux/arm64 push: true tags: | - ghcr.io/ultramarine-linux/ultramarine-devtools:${{ matrix.version }} - ghcr.io/ultramarine-linux/ultramarine-devtools:latest + ${{ matrix.docker.image }}:${{ matrix.version }} + ${{ matrix.docker.image }}:latest build-args: | RELEASE=${{ matrix.version }} diff --git a/dockerfiles/gitpod.dockerfile b/dockerfiles/gitpod.dockerfile new file mode 100644 index 00000000..b9b931db --- /dev/null +++ b/dockerfiles/gitpod.dockerfile @@ -0,0 +1,9 @@ +ARG RELEASE + +FROM ghcr.io/ultramarine-linux/ultramarine:${RELEASE} + +RUN dnf install -y @development-tools sudo && dnf clean all + +RUN useradd -l -u 33333 -G wheel -md /home/gitpod -s /bin/bash -p gitpod gitpod + +USER gitpod