You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ad...@apache.org on 2024/11/12 10:29:51 UTC
(ozone-docker-runner) branch jdk11 updated (9fa66cc -> 269e055)
This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a change to branch jdk11
in repository https://gitbox.apache.org/repos/asf/ozone-docker-runner.git
from 9fa66cc HDDS-11639. Upgrade ozone-runner to Rocky Linux 9.3 (#31)
new 1b6bdb8 HDDS-11632. Publish images to GitHub container registry (#30)
new 4ec04fa HDDS-8569. Build and publish ozone-runner for linux/arm64 (#32)
new 269e055 HDDS-11634. Publish images to Docker Hub from GitHub workflow (#33)
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.github/workflows/build-and-tag.yaml | 81 ++++++++++++++++++++++++++++++++++++
.github/workflows/build.yaml | 77 ++++++++++++++++++++++++++++++----
2 files changed, 151 insertions(+), 7 deletions(-)
create mode 100644 .github/workflows/build-and-tag.yaml
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org
(ozone-docker-runner) 01/03: HDDS-11632. Publish images to GitHub container registry (#30)
Posted by ad...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch jdk11
in repository https://gitbox.apache.org/repos/asf/ozone-docker-runner.git
commit 1b6bdb8bdba0022339765f48ad30ffd70a29d898
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Thu Nov 7 07:58:20 2024 +0100
HDDS-11632. Publish images to GitHub container registry (#30)
(cherry picked from commit 797fc417b514777bbb8bdc42079da66c377facbc)
---
.github/workflows/build-and-tag.yaml | 64 +++++++++++++++++++++++++++++++++
.github/workflows/build.yaml | 69 ++++++++++++++++++++++++++++++++----
2 files changed, 126 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/build-and-tag.yaml b/.github/workflows/build-and-tag.yaml
new file mode 100644
index 0000000..199cc0b
--- /dev/null
+++ b/.github/workflows/build-and-tag.yaml
@@ -0,0 +1,64 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: build-and-tag
+
+# This workflow builds (if necessary) and tags the Docker image.
+
+on:
+ push:
+
+permissions:
+ contents: read
+ packages: write
+
+jobs:
+ build:
+ uses: ./.github/workflows/build.yaml
+
+ tag:
+ needs: build
+ if: ${{ github.ref_type == 'tag' }}
+ runs-on: ubuntu-latest
+ env:
+ IMAGE_ID: ${{ needs.build.outputs.image-id }}
+ steps:
+ - name: Generate tags
+ uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
+ with:
+ images: |
+ ghcr.io/${{ github.repository_owner }}/ozone-runner
+ tags: |
+ type=ref,event=tag
+ flavor: |
+ latest=false
+
+ - name: Pull image
+ run: |
+ docker pull "$IMAGE_ID"
+
+ - name: Login to GitHub Container Registry
+ uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Apply tags to existing image
+ run: |
+ for tag in $DOCKER_METADATA_OUTPUT_TAGS; do
+ docker tag "$IMAGE_ID" "$tag"
+ docker push "$tag"
+ done
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de51b61..02ae644 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -12,16 +12,71 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
name: build
+
+# This workflow builds the Docker image if it does not exists already.
+# For non-PR runs, it also publishes the image to the registry, tagging it by the full SHA of the commit.
+
on:
- - push
- - pull_request
+ pull_request:
+ types: [opened, ready_for_review, synchronize]
+ workflow_call:
+ outputs:
+ image-id:
+ description: "Docker image ID in repo/owner/name:tag format"
+ value: ${{ jobs.build.outputs.image-id }}
+
+concurrency:
+ group: ${{ github.sha }}
+ cancel-in-progress: false
+
+permissions:
+ contents: read
+ packages: write
+
jobs:
build:
- name: build and deploy
runs-on: ubuntu-latest
+ outputs:
+ image-id: ${{ steps.meta.outputs.tags }}
steps:
- - name: checkout source
- uses: actions/checkout@v4
- - name: build image
- run: DOCKER_BUILDKIT=1 docker build -t ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]' | sed 's/docker-//g') .
+ - name: Generate image ID
+ id: meta
+ uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
+ with:
+ images: |
+ ghcr.io/${{ github.repository_owner }}/ozone-runner
+ tags: |
+ # keep single item
+ # any further tags should be added only in build-and-tag.yaml, not here
+ type=sha,prefix=,format=long
+
+ - name: Check if image exists
+ id: pull
+ run: |
+ success=false
+ if docker pull "$DOCKER_METADATA_OUTPUT_TAGS"; then
+ success=true
+ fi
+
+ echo "success=$success" >> $GITHUB_OUTPUT
+
+ - name: Login to GitHub Container Registry
+ id: login
+ if: ${{ github.event_name != 'pull_request' && steps.pull.outputs.success == 'false' }}
+ uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Build and push image to GitHub Container Registry
+ id: build
+ if: ${{ steps.pull.outputs.success == 'false' }}
+ uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
+ with:
+ platforms: linux/amd64
+ push: ${{ github.event_name != 'pull_request' }}
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org
(ozone-docker-runner) 03/03: HDDS-11634. Publish images to Docker Hub from GitHub workflow (#33)
Posted by ad...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch jdk11
in repository https://gitbox.apache.org/repos/asf/ozone-docker-runner.git
commit 269e0559870d0bfdacf73842df28fbcb2f3244b8
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Fri Nov 8 06:47:36 2024 +0100
HDDS-11634. Publish images to Docker Hub from GitHub workflow (#33)
(cherry picked from commit c36597a55b23e95719fde77986e4ea898c5d9090)
---
.github/workflows/build-and-tag.yaml | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/build-and-tag.yaml b/.github/workflows/build-and-tag.yaml
index 199cc0b..8544a6c 100644
--- a/.github/workflows/build-and-tag.yaml
+++ b/.github/workflows/build-and-tag.yaml
@@ -33,18 +33,25 @@ jobs:
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-latest
env:
+ DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
IMAGE_ID: ${{ needs.build.outputs.image-id }}
+ REGISTRIES: ghcr.io # docker.io is appended dynamically
steps:
- name: Generate tags
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: |
- ghcr.io/${{ github.repository_owner }}/ozone-runner
+ ${{ github.repository_owner }}/ozone-runner
tags: |
type=ref,event=tag
flavor: |
latest=false
+ - name: Add Docker Hub to targets
+ if: ${{ env.DOCKERHUB_USER }}
+ run: |
+ echo "REGISTRIES=${{ env.REGISTRIES }} docker.io" >> $GITHUB_ENV
+
- name: Pull image
run: |
docker pull "$IMAGE_ID"
@@ -56,9 +63,19 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
+ - name: Login to Docker Hub
+ if: ${{ env.DOCKERHUB_USER }}
+ uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
+ with:
+ username: ${{ env.DOCKERHUB_USER }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+
- name: Apply tags to existing image
run: |
- for tag in $DOCKER_METADATA_OUTPUT_TAGS; do
- docker tag "$IMAGE_ID" "$tag"
- docker push "$tag"
+ set -x
+ for registry in $REGISTRIES; do
+ opts="$(echo "$DOCKER_METADATA_OUTPUT_TAGS" | sed "s@^@--tag $registry/@g" | xargs echo)"
+ if [[ -n "$opts" ]]; then
+ docker buildx imagetools create $opts "$IMAGE_ID"
+ fi
done
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org
(ozone-docker-runner) 02/03: HDDS-8569. Build and publish ozone-runner for linux/arm64 (#32)
Posted by ad...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch jdk11
in repository https://gitbox.apache.org/repos/asf/ozone-docker-runner.git
commit 4ec04fabdffadc3018195c56377797d1a855ff13
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Thu Nov 7 10:37:34 2024 +0100
HDDS-8569. Build and publish ozone-runner for linux/arm64 (#32)
(cherry picked from commit 445b14f8b4ce21a2fb63359d024ab5f6370ff2d4)
---
.github/workflows/build.yaml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 02ae644..df0a323 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -62,6 +62,14 @@ jobs:
echo "success=$success" >> $GITHUB_OUTPUT
+ - name: Set up QEMU
+ if: ${{ steps.pull.outputs.success == 'false' }}
+ uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
+
+ - name: Set up Docker Buildx
+ if: ${{ steps.pull.outputs.success == 'false' }}
+ uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349
+
- name: Login to GitHub Container Registry
id: login
if: ${{ github.event_name != 'pull_request' && steps.pull.outputs.success == 'false' }}
@@ -76,7 +84,7 @@ jobs:
if: ${{ steps.pull.outputs.success == 'false' }}
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
with:
- platforms: linux/amd64
+ platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org