feat: Ingestion Docker Image Tags (#16819)

* feat: Enable Ingestion Docker Image Tags using meta step

* feat: conditional latest tag

* chore: use separator tags

* chore: refactor use of metadata-action

* test: disable push

* chore: Add env `DOCKER_BUILD_NO_SUMMARY: true`

* chore: Use flavor for `latest` tag

* chore: Enable push of docker images to DockerHub
This commit is contained in:
Akash Jain 2024-06-27 18:40:06 +05:30 committed by GitHub
parent 47a13e27cf
commit 06d2967a80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 83 additions and 53 deletions

View File

@ -16,6 +16,8 @@ inputs:
description: true if we are building an Ingestion image, false otherwise
required: true
default: "false"
release_version:
description: OpenMetadata Release Version
dockerhub_username:
description: Dockerhub Username
required: true
@ -26,19 +28,19 @@ inputs:
outputs:
tags:
description: Generated Docker Tags
value: ${{ steps.generate-tags.outputs.tags }}
value: ${{ steps.meta.outputs.tags }}
runs:
using: composite
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ inputs.dockerhub_username }}
password: ${{ inputs.dockerhub_token }}
@ -58,13 +60,16 @@ runs:
pip install --upgrade pip
sudo make install_antlr_cli
make install_dev generate
- name: Process Docker Tags
id: generate-tags
shell: bash
run: |
if ${{ inputs.push_latest == 'true' }}; then
echo "tags=${{ inputs.image }}:${{ inputs.tag }},${{ inputs.image }}:latest" >> $GITHUB_OUTPUT
else
echo "tags=${{ inputs.image }}:${{ inputs.tag }}" >> $GITHUB_OUTPUT
fi
- name: Docker Meta
id: meta
uses: docker/metadata-action@v5
with:
flavor:
latest=${{ inputs.push_latest }}
images: |
${{ inputs.image }}
sep-tags: ','
tags: |
type=raw,value=${{ inputs.release_version }},enable=${{ inputs.is_ingestion }}
type=raw,${{ inputs.tag }}

View File

@ -13,8 +13,8 @@ name: docker-openmetadata-db docker
on:
workflow_dispatch:
inputs:
tag:
description: "Input tag"
docker_release_tag:
description: "OpenMetadata MySQL Docker Image Tag"
required: true
push_latest_tag_to_release:
description: "Do you want to update docker image latest tag as well ?"
@ -26,21 +26,23 @@ jobs:
steps:
- name: Check out the Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Prepare for Docker Build&Push
id: prepare
uses: ./.github/actions/prepare-for-docker-build-and-push
with:
image: openmetadata/db
tag: ${{ inputs.tag }}
tag: ${{ inputs.docker_release_tag }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}
- name: Build and push if event is workflow_dispatch and input is checked
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_NO_SUMMARY: true
with:
context: .
platforms: linux/amd64,linux/arm64

View File

@ -13,8 +13,11 @@ name: docker-openmetadata-ingestion-base-slim docker
on:
workflow_dispatch:
inputs:
tag:
description: "Input tag"
docker_release_tag:
description: "Ingestion Base Slim Docker Image Tag"
required: true
release_version:
description: "Provide the Release Version"
required: true
push_latest_tag_to_release:
description: "Do you want to update docker image latest tag as well ?"
@ -26,21 +29,24 @@ jobs:
steps:
- name: Check out the Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Prepare for Docker Build&Push
id: prepare
uses: ./.github/actions/prepare-for-docker-build-and-push
with:
image: openmetadata/ingestion-base-slim
tag: ${{ inputs.tag }}
tag: ${{ inputs.docker_release_tag }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
is_ingestion: true
release_version: ${{ inputs.release_version }}
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}
- name: Build and push if event is workflow_dispatch and input is checked
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_NO_SUMMARY: true
with:
context: .
platforms: linux/amd64,linux/arm64

View File

@ -13,8 +13,11 @@ name: docker-openmetadata-ingestion-base docker
on:
workflow_dispatch:
inputs:
tag:
description: "Input tag"
docker_release_tag:
description: "Ingestion Base Docker Image Tag"
required: true
release_version:
description: "Provide the Release Version"
required: true
push_latest_tag_to_release:
description: "Do you want to update docker image latest tag as well ?"
@ -26,21 +29,24 @@ jobs:
steps:
- name: Check out the Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Prepare for Docker Build&Push
id: prepare
uses: ./.github/actions/prepare-for-docker-build-and-push
with:
image: openmetadata/ingestion-base
tag: ${{ inputs.tag }}
tag: ${{ inputs.docker_release_tag }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
is_ingestion: true
release_version: ${{ inputs.release_version }}
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}
- name: Build and push if event is workflow_dispatch and input is checked
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_NO_SUMMARY: true
with:
context: .
platforms: linux/amd64,linux/arm64

View File

@ -13,11 +13,14 @@ name: docker-openmetadata-ingestion docker
on:
workflow_dispatch:
inputs:
tag:
description: "Input tag"
docker_release_tag:
description: "Ingestion Docker Image Tag"
required: true
release_version:
description: "Provide the Release Version"
required: true
push_latest_tag_to_release:
description: "Do you want to update docker image latest tag as well ?"
description: "Mark this as latest tag as well ?"
type: boolean
jobs:
@ -26,21 +29,24 @@ jobs:
steps:
- name: Check out the Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Prepare for Docker Build&Push
id: prepare
uses: ./.github/actions/prepare-for-docker-build-and-push
with:
image: openmetadata/ingestion
tag: ${{ inputs.tag }}
tag: ${{ inputs.docker_release_tag }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
is_ingestion: true
release_version: ${{ inputs.release_version }}
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}
- name: Build and push if event is workflow_dispatch and input is checked
uses: docker/build-push-action@v3
env:
DOCKER_BUILD_NO_SUMMARY: true
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64

View File

@ -13,8 +13,8 @@ name: docker-openmetadata-postgres-db docker
on:
workflow_dispatch:
inputs:
tag:
description: "Input tag"
docker_release_tag:
description: "OpenMetadata PostgreSQL Docker Image Tag"
required: true
push_latest_tag_to_release:
description: "Do you want to update docker image latest tag as well ?"
@ -26,20 +26,22 @@ jobs:
steps:
- name: Check out the Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Prepare for Docker Build&Push
id: prepare
uses: ./.github/actions/prepare-for-docker-build-and-push
with:
image: openmetadata/postgresql
tag: ${{ inputs.tag }}
tag: ${{ inputs.docker_release_tag }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}
- name: Build and push if event is workflow_dispatch and input is checked
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_NO_SUMMARY: true
with:
context: .
platforms: linux/amd64,linux/arm64

View File

@ -13,8 +13,8 @@ name: docker-openmetadata-server release app
on:
workflow_dispatch:
inputs:
DOCKER_RELEASE_TAG:
description: "Docker Release Tag"
docker_release_tag:
description: "Server Docker Image Tag"
required: true
push_latest_tag_to_release:
description: "Do you want to update docker image latest tag as well ?"
@ -25,10 +25,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
@ -49,7 +49,7 @@ jobs:
mvn -DskipTests clean package
- name: Upload OpenMetadata application to Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openmetadata-binary
path: /home/runner/work/OpenMetadata/OpenMetadata/openmetadata-dist/target/*.tar.gz
@ -69,7 +69,7 @@ jobs:
echo "UPLOAD_URL=$(curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/open-metadata/OpenMetadata/releases/tags/${{ inputs.DOCKER_RELEASE_TAG }}-release | jq .upload_url | tr -d '"' )" >> $GITHUB_OUTPUT
- name: Download application from Artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: openmetadata-binary
@ -86,27 +86,30 @@ jobs:
push_to_docker_hub:
runs-on: ubuntu-latest
if: ${{ always() && contains(join(needs.*.result, ','), 'success') }}
needs: [release-project-event-workflow_dispatch]
needs: [ release-project-event-workflow_dispatch ]
steps:
- name: Check out the Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set build arguments
id: build-args
run: |
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Prepare for Docker Build&Push
id: prepare
uses: ./.github/actions/prepare-for-docker-build-and-push
with:
image: openmetadata/server
tag: ${{ inputs.DOCKER_RELEASE_TAG }}
tag: ${{ inputs.docker_release_tag }}
push_latest: ${{ inputs.push_latest_tag_to_release }}
dockerhub_username: ${{ secrets.DOCKERHUB_OPENMETADATA_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_OPENMETADATA_TOKEN }}
- name: Build and push if event is workflow_dispatch and input is checked
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_NO_SUMMARY: true
with:
context: .
platforms: linux/amd64,linux/arm64
@ -114,5 +117,5 @@ jobs:
tags: ${{ steps.prepare.outputs.tags }}
file: ./docker/docker-compose-quickstart/Dockerfile
build-args: |
BUILD_DATE=${{ env.BUILD_DATE }}
COMMIT_ID=${{ env.github.sha }}
BUILD_DATE=${{ steps.build-args.outputs.BUILD_DATE }}
COMMIT_ID=${{ github.sha }}