Skip to content

Commit 16d712f

Browse files
authored
Merge pull request #7 from datazip-inc/feat/fusion-releaser
feat: releaser for fusion
1 parent 3db632b commit 16d712f

46 files changed

Lines changed: 1641 additions & 321 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docker-images.yml

Lines changed: 55 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,46 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17+
# Modified by Datazip Inc. in 2026
1718

1819

19-
# This workflow will build docker images when commit merged or pushed to master.
20-
# or tags pushed.
20+
# Build and publish Docker images. Triggered by push (dev-v3) or workflow_call with tag (e.g. release).
2121

2222
name: Publish Docker Image
2323

2424
on:
25-
push:
26-
branches:
27-
- "master"
28-
tags:
29-
- "v*"
25+
workflow_call:
26+
inputs:
27+
tag:
28+
description: 'Version tag for the image (e.g. v1.0.0).'
29+
type: string
30+
required: true
31+
# Use org-level or repo-level secrets; caller must pass with secrets: inherit
32+
secrets:
33+
DOCKER_USERNAME:
34+
description: 'Docker Hub username (org or repo secret)'
35+
required: true
36+
DOCKER_PASSWORD:
37+
description: 'Docker Hub password or token (org or repo secret)'
38+
required: true
3039

3140

3241
concurrency:
3342
group: ${{ github.workflow }}-${{ github.ref }}
3443
cancel-in-progress: true
3544

3645
jobs:
37-
docker-amoro:
38-
name: Push Amoro Docker Image to Docker Hub
46+
docker-fusion:
47+
name: Push Fusion Docker Image
3948
runs-on: ubuntu-latest
40-
if: ${{ startsWith(github.repository, 'apache/') }}
41-
strategy:
42-
matrix:
43-
hadoop: [ "v2", "v3" ]
49+
environment: docker publish
50+
if: ${{ startsWith(github.repository, 'datazip-inc/') }}
4451
steps:
4552
- uses: actions/checkout@v3
46-
- name: Set up JDK 11
53+
- name: Set up JDK 17
4754
uses: actions/setup-java@v3
4855
with:
49-
java-version: '11'
56+
java-version: '17'
5057
distribution: 'temurin'
5158
cache: maven
5259
check-latest: false
@@ -56,40 +63,30 @@ jobs:
5663
- name: Set up Docker Buildx
5764
uses: docker/setup-buildx-action@v2
5865

59-
- name: Set up Docker tags
60-
uses: docker/metadata-action@v5
66+
- name: Set Docker tags
6167
id: meta
62-
with:
63-
flavor: |
64-
latest=false
65-
images: |
66-
name=apache/amoro
67-
tags: |
68-
type=ref,event=branch,enable=${{ matrix.hadoop == 'v3' }},suffix=-snapshot
69-
type=ref,event=branch,enable=${{ matrix.hadoop == 'v2' }},suffix=-snapshot-hadoop2
70-
type=raw,enable=${{ matrix.hadoop == 'v3' && startsWith(github.ref, 'refs/tags/v') }},value=latest
71-
type=semver,event=tag,enable=${{ matrix.hadoop == 'v3' }},pattern={{version}}
72-
type=semver,event=tag,enable=${{ matrix.hadoop == 'v3' }},pattern={{version}}, suffix=-hadoop3
73-
type=semver,event=tag,enable=${{ matrix.hadoop == 'v2' }},pattern={{version}}, suffix=-hadoop2
68+
run: |
69+
VERSION_TAG="${{ github.event_name == 'workflow_call' && inputs.tag || 'dev-v3' }}"
70+
if [ "${{ github.ref }}" = "refs/heads/master" ]; then
71+
case "${VERSION_TAG}" in v*) ;; *) echo "::error::On master branch, version tag must start with 'v' (e.g. v1.0.0). Got: ${VERSION_TAG}"; exit 1 ;; esac
72+
echo "tags=olakego/fusion:latest,olakego/fusion:${VERSION_TAG}" >> $GITHUB_OUTPUT
73+
else
74+
echo "tags=olakego/fusion:latest-${VERSION_TAG},olakego/fusion:${VERSION_TAG}" >> $GITHUB_OUTPUT
75+
fi
7476
7577
- name: Print tags
7678
run: echo '${{ steps.meta.outputs.tags }}'
7779

7880
- name: Login to Docker Hub
7981
uses: docker/login-action@v2
8082
with:
81-
username: ${{ secrets.DOCKERHUB_USER }}
82-
password: ${{ secrets.DOCKERHUB_TOKEN }}
83-
84-
- name: Set Maven Build Properties
85-
if: ${{ matrix.hadoop == 'v2' }}
86-
run: |
87-
echo "MVN_HADOOP=-Phadoop2" >> $GITHUB_ENV
83+
username: ${{ secrets.DOCKER_USERNAME }}
84+
password: ${{ secrets.DOCKER_PASSWORD }}
8885

8986
- name: Build dist module with Maven
90-
run: ./mvnw clean package -pl 'dist' -am -e ${MVN_HADOOP} -DskipTests -B -ntp -Psupport-all-formats -Pno-extended-disk-storage -Pno-plugin-bin
87+
run: ./mvnw clean package -pl 'dist' -am -e -DskipTests -B -ntp -Psupport-all-formats -Pno-extended-disk-storage -Pno-plugin-bin
9188

92-
- name: Build and Push Amoro Docker Image
89+
- name: Build and Push Fusion Docker Image to olakego/fusion
9390
uses: docker/build-push-action@v4
9491
with:
9592
context: .
@@ -98,19 +95,21 @@ jobs:
9895
platforms: linux/amd64,linux/arm64
9996
tags: ${{ steps.meta.outputs.tags }}
10097

101-
docker-optimizer-flink:
102-
name: Push Amoro Optimizer-Flink Docker Image to Docker Hub
98+
docker-optimizer-spark:
99+
name: Push Fusion Spark Optimizer Docker Image to olakego/fusion-spark
103100
runs-on: ubuntu-latest
104-
if: ${{ startsWith(github.repository, 'apache/') }}
101+
environment: docker publish
102+
if: ${{ startsWith(github.repository, 'datazip-inc/') }}
105103
strategy:
106104
matrix:
107-
flink: [ "1.14.6", "1.20.0" ]
105+
spark: [ "3.5.8" ] # spark version supported
106+
scala: [ "2.13.18" ] # scala version supported
108107
steps:
109108
- uses: actions/checkout@v3
110-
- name: Set up JDK 11
109+
- name: Set up JDK 17
111110
uses: actions/setup-java@v3
112111
with:
113-
java-version: '11'
112+
java-version: '17'
114113
distribution: 'temurin'
115114
cache: maven
116115
check-latest: false
@@ -120,112 +119,25 @@ jobs:
120119
- name: Set up Docker Buildx
121120
uses: docker/setup-buildx-action@v2
122121

123-
- name: Set up Docker tags
124-
uses: docker/metadata-action@v5
122+
- name: Set Docker tags
125123
id: meta
126-
with:
127-
flavor: |
128-
latest=false
129-
images: |
130-
name=apache/amoro-flink-optimizer
131-
tags: |
132-
type=ref,event=branch,enable=${{ matrix.flink == '1.14.6' }},suffix=-snapshot
133-
type=ref,event=branch,enable=${{ matrix.flink == '1.14.6' }},suffix=-snapshot-flink1.14
134-
type=ref,event=branch,enable=${{ matrix.flink == '1.20.0' }},suffix=-snapshot-flink1.20
135-
type=raw,enable=${{ matrix.hadoop == '1.14.6' && startsWith(github.ref, 'refs/tags/v') }},value=latest
136-
type=semver,enable=${{ matrix.flink == '1.14.6' }},pattern={{version}}
137-
type=semver,enable=${{ matrix.flink == '1.14.6' }},pattern={{version}}, suffix=-flink1.14
138-
type=semver,enable=${{ matrix.flink == '1.20.0' }},pattern={{version}}, suffix=-flink1.20
139-
140-
- name: Print tags
141-
run: echo '${{ steps.meta.outputs.tags }}'
142-
143-
- name: Login to Docker Hub
144-
uses: docker/login-action@v2
145-
with:
146-
username: ${{ secrets.DOCKERHUB_USER }}
147-
password: ${{ secrets.DOCKERHUB_TOKEN }}
148-
149-
- name: Set optimizer flink version
150124
run: |
151-
OPTIMIZER_FLINK=${{ matrix.flink }} && \
152-
echo "OPTIMIZER_FLINK=-Dflink-optimizer.flink-version${OPTIMIZER_FLINK}" >> $GITHUB_ENV
153-
if [[ "$OPTIMIZER_FLINK" < "1.15" ]]; then
154-
echo "Adding -Pflink-optimizer-pre-1.15 for Flink version less than 1.15"
155-
echo "OPTIMIZER_FLINK=-Pflink-optimizer-pre-1.15 -Dflink-optimizer.flink-version=${OPTIMIZER_FLINK}" >> $GITHUB_ENV
125+
VERSION_TAG="${{ github.event_name == 'workflow_call' && inputs.tag || 'dev-v3' }}"
126+
if [ "${{ github.ref }}" = "refs/heads/master" ]; then
127+
case "${VERSION_TAG}" in v*) ;; *) echo "::error::On master branch, version tag must start with 'v' (e.g. v1.0.0). Got: ${VERSION_TAG}"; exit 1 ;; esac
128+
echo "tags=olakego/fusion-spark:latest,olakego/fusion-spark:${VERSION_TAG}" >> $GITHUB_OUTPUT
129+
else
130+
echo "tags=olakego/fusion-spark:latest-${VERSION_TAG},olakego/fusion-spark:${VERSION_TAG}" >> $GITHUB_OUTPUT
156131
fi
157132
158-
- name: Set ENV Amoro version
159-
id: version
160-
run: |
161-
AMORO_VERSION=`cat pom.xml | grep 'amoro-parent' -C 3 | grep -Eo '<version>.*</version>' | awk -F'[><]' '{print $3}'` \
162-
&& echo "$AMORO_VERSION" \
163-
&& echo "AMORO_VERSION=${AMORO_VERSION}" >> $GITHUB_ENV \
164-
&& echo "AMORO_VERSION=${AMORO_VERSION}" >> $GITHUB_OUTPUT
165-
166-
- name: Build optimizer module with Maven
167-
run: ./mvnw clean package -pl 'amoro-optimizer/amoro-optimizer-flink' -am -e ${OPTIMIZER_FLINK} -DskipTests -B -ntp
168-
169-
- name: Build and Push Flink Optimizer Docker Image
170-
uses: docker/build-push-action@v4
171-
env:
172-
AMORO_VERSION: ${{ steps.version.outputs.AMORO_VERSION }}
173-
with:
174-
context: .
175-
push: true
176-
file: docker/optimizer-flink/Dockerfile
177-
platforms: linux/amd64,linux/arm64
178-
tags: ${{ steps.meta.outputs.tags }}
179-
build-args: |
180-
FLINK_VERSION=${{ matrix.flink }}
181-
OPTIMIZER_JOB=amoro-optimizer/amoro-optimizer-flink/target/amoro-optimizer-flink-${{ env.AMORO_VERSION }}-jar-with-dependencies.jar
182-
183-
docker-optimizer-spark:
184-
name: Push Amoro Optimizer-Spark Docker Image to Docker Hub
185-
runs-on: ubuntu-latest
186-
if: ${{ startsWith(github.repository, 'apache/') }}
187-
strategy:
188-
matrix:
189-
spark: [ "3.5.7" ]
190-
scala: [ "2.12.15" ]
191-
steps:
192-
- uses: actions/checkout@v3
193-
- name: Set up JDK 11
194-
uses: actions/setup-java@v3
195-
with:
196-
java-version: '11'
197-
distribution: 'temurin'
198-
cache: maven
199-
check-latest: false
200-
- name: Set up QEMU
201-
uses: docker/setup-qemu-action@v2
202-
203-
- name: Set up Docker Buildx
204-
uses: docker/setup-buildx-action@v2
205-
206-
- name: Set up Docker tags
207-
uses: docker/metadata-action@v5
208-
id: meta
209-
with:
210-
flavor: |
211-
latest=false
212-
images: |
213-
name=apache/amoro-spark-optimizer
214-
tags: |
215-
type=ref,event=branch,enable=${{ matrix.spark == '3.5.7' }},suffix=-snapshot
216-
type=ref,event=branch,enable=${{ matrix.spark == '3.5.7' }},suffix=-snapshot-spark3.5
217-
type=raw,enable=${{ matrix.hadoop == '3.5.7' && startsWith(github.ref, 'refs/tags/v') }},value=latest
218-
type=semver,enable=${{ matrix.spark == '3.5.7' }},pattern={{version}}
219-
type=semver,enable=${{ matrix.spark == '3.5.7' }},pattern={{version}}, suffix=-spark3.5
220-
221133
- name: Print tags
222134
run: echo '${{ steps.meta.outputs.tags }}'
223135

224136
- name: Login to Docker Hub
225137
uses: docker/login-action@v2
226138
with:
227-
username: ${{ secrets.DOCKERHUB_USER }}
228-
password: ${{ secrets.DOCKERHUB_TOKEN }}
139+
username: ${{ secrets.DOCKER_USERNAME }}
140+
password: ${{ secrets.DOCKER_PASSWORD }}
229141

230142
- name: Set optimizer spark version and extract versions
231143
id: versions
@@ -245,9 +157,9 @@ jobs:
245157
&& echo "AMORO_VERSION=${AMORO_VERSION}" >> $GITHUB_OUTPUT
246158
247159
- name: Build optimizer module with Maven
248-
run: ./mvnw clean package -pl 'amoro-optimizer/amoro-optimizer-spark' -am -e ${SPARK_VERSION} -DskipTests -B -ntp
160+
run: ./mvnw clean package -pl 'amoro-optimizer/amoro-optimizer-spark' -am -e ${SPARK_VERSION} -Dscala.version=${{ matrix.scala }} -Dscala.binary.version=${{ steps.versions.outputs.SCALA_BINARY_VERSION }} -DskipTests -B -ntp
249161

250-
- name: Build and Push Spark Optimizer Docker Image
162+
- name: Build and Push Spark Optimizer Docker Image to olakego/fusion-spark
251163
uses: docker/build-push-action@v4
252164
env:
253165
AMORO_VERSION: ${{ steps.version.outputs.AMORO_VERSION }}
@@ -261,6 +173,7 @@ jobs:
261173
tags: ${{ steps.meta.outputs.tags }}
262174
build-args: |
263175
SPARK_VERSION=${{ matrix.spark }}
176+
SPARK_JAVA_TAG=${{ matrix.spark }}-java17
264177
OPTIMIZER_JOB=amoro-optimizer/amoro-optimizer-spark/target/amoro-optimizer-spark-${{ env.SPARK_MAJOR_VERSION}}_${{ env.SCALA_BINARY_VERSION}}-${{ env.AMORO_VERSION }}-jar-with-dependencies.jar
265178
266179
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# Modified by Datazip Inc. in 2026
18+
19+
name: Draft Releaser From Master
20+
21+
on:
22+
pull_request:
23+
types: [closed]
24+
branches:
25+
- master
26+
27+
jobs:
28+
create_draft_release:
29+
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.ref == 'staging'
30+
name: Create Draft Release
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: write
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Get latest release
41+
id: latest-release
42+
run: |
43+
latest_tag=$(git tag -l | sort -V | tail -1)
44+
echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
45+
46+
- name: Generate next version
47+
id: generate-next-version
48+
run: |
49+
if [ -z "$LATEST_TAG" ]; then
50+
next_version="v0.0.0"
51+
else
52+
# Remove 'v' prefix and split version into array
53+
version=${LATEST_TAG#v}
54+
IFS='.' read -ra VERSION_PARTS <<< "$version"
55+
56+
# Increment the last number (patch version)
57+
VERSION_PARTS[2]=$((VERSION_PARTS[2] + 1))
58+
59+
# Reconstruct the version with 'v' prefix
60+
next_version="v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}"
61+
fi
62+
echo "NEXT_VERSION=$next_version" >> $GITHUB_ENV
63+
64+
- name: Create draft release
65+
id: create-draft-release
66+
uses: ncipollo/release-action@v1
67+
with:
68+
tag: ${{ env.NEXT_VERSION }}
69+
generateReleaseNotes: true
70+
draft: true
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/modification-header-check.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616
#
1717

18-
# Modified by Datazip Pvt. Ltd. in 2026
18+
# Modified by Datazip Inc. in 2026
1919
# Original work Copyright The Apache Software Foundation (ASF)
2020

2121
name: Modification-Header-Check
@@ -42,15 +42,19 @@ jobs:
4242
4343
BASE_BRANCH=${{ github.base_ref }}
4444
CHANGED_FILES=$(git diff --name-only origin/$BASE_BRANCH...HEAD)
45-
DATAZIP_MODIFICATION_YEAR_REGEX="Modified by Datazip Pvt\. Ltd\. in [0-9]{4}"
46-
ASF_ORIGINAL_WORK_NOTICE_REGEX="Original work Copyright The Apache Software Foundation \\(ASF\\)"
45+
DATAZIP_MODIFICATION_YEAR_REGEX="Modified by Datazip Inc\. in [0-9]{4}"
4746
NOT_MODIFIED_FILES=""
47+
LICENSE_REGEX="Licensed to the Apache Software Foundation|Apache License|SPDX-License-Identifier"
4848
for file in $CHANGED_FILES; do
4949
if [[ ! -f "$file" ]]; then
5050
continue
5151
fi
5252
53-
if ! head -40 "$file" | grep -q -E "$DATAZIP_MODIFICATION_YEAR_REGEX" || ! head -40 "$file" | grep -q -E "$ASF_ORIGINAL_WORK_NOTICE_REGEX"; then
53+
if ! head -40 "$file" | grep -q -E "$LICENSE_REGEX"; then
54+
continue
55+
fi
56+
57+
if ! head -40 "$file" | grep -q -E "$DATAZIP_MODIFICATION_YEAR_REGEX"; then
5458
NOT_MODIFIED_FILES+="$file"$'\n'
5559
fi
5660
done

0 commit comments

Comments
 (0)