Skip to content

Commit

Permalink
[Bug][docker] fix scaleph-seatunnel docker image build error (#601)
Browse files Browse the repository at this point in the history
* feature: update seatunnel Dockerfile and github actions

* feature: update seatunnel version to 2.3.2

* fix: scaleph seatunnel docker build error
  • Loading branch information
kalencaya authored Aug 16, 2023
1 parent ff8513a commit 631ea2c
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 88 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/docker-seatunnel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ on:
seatunnelVersion:
description: 'seatunnel version'
required: true
default: '2.3.1'
default: '2.3.2'
type: choice
options:
- 2.3.2
- 2.3.1
flinkVersion:
description: 'flink version'
required: true
Expand Down Expand Up @@ -63,13 +62,18 @@ jobs:
platforms: amd64,arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Install SeaTunnel
run: wget https://archive.apache.org/dist/seatunnel/${{ env.SEATUNNEL_VERSION }}/apache-seatunnel-${{ env.SEATUNNEL_VERSION }}-bin.tar.gz ; \
tar -zxf apache-seatunnel-${{ env.SEATUNNEL_VERSION }}-bin.tar.gz ; \
cd apache-seatunnel-${{ env.SEATUNNEL_VERSION }}-bin ; \
sh -x bin/install-plugin.sh ${{ env.SEATUNNEL_VERSION }}
- name: Build image
uses: docker/build-push-action@v4
with:
no-cache: false
push: true
context: .
build-args: FLINK_VERSION=${{ env.FLINK_VERSION }}
build-args: FLINK_VERSION=${{ env.FLINK_VERSION }}, SEATUNNEL_VERSION=${{ env.SEATUNNEL_VERSION }}
platforms: linux/amd64,linux/arm64
file: tools/docker/build/scaleph-seatunnel/Dockerfile
tags: ${{ env.HUB }}:${{ env.SEATUNNEL_VERSION }}-flink-${{ env.FLINK_VERSION }}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SeaTunnelVersion implements DictInstance {

V_2_3_1("2.3.1", "2.3.1"),
V_2_3_2("2.3.2", "2.3.2"),
;

@JsonCreator
Expand Down
35 changes: 3 additions & 32 deletions tools/docker/build/scaleph-seatunnel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG FLINK_VERSION=1.17
ARG BASE_RELEASE_IMAGE=flink:${FLINK_VERSION}
FROM maven:3.8-eclipse-temurin-11 as build

ENV SEATUNNEL_VERSION=2.3.1
ENV SEATUNNEL_HOME=/opt/seatunnel

RUN mkdir -p $SEATUNNEL_HOME

ARG TAR_FILE=apache-seatunnel-incubating-${SEATUNNEL_VERSION}-bin.tar.gz

#COPY $TAR_FILE $SEATUNNEL_HOME/$TAR_FILE
#RUN cd $SEATUNNEL_HOME ; \
# tar -zxf $TAR_FILE --strip 1 -C $SEATUNNEL_HOME \

# forked from seatunnel k8s quick start
RUN wget https://archive.apache.org/dist/incubator/seatunnel/${SEATUNNEL_VERSION}/$TAR_FILE ; \
tar -zxf $TAR_FILE --strip 1 -C $SEATUNNEL_HOME

# strange behavior: replace mvnw by mvn on install-plugin.sh, remove useless comment on plugin_config
RUN rm $SEATUNNEL_HOME/config/plugin_config
COPY tools/docker/build/scaleph-seatunnel/plugin_config $SEATUNNEL_HOME/config

RUN rm $SEATUNNEL_HOME/bin/install-plugin.sh
COPY tools/docker/build/scaleph-seatunnel/install-plugin.sh $SEATUNNEL_HOME/bin

RUN cd $SEATUNNEL_HOME ; \
sh -x bin/install-plugin.sh ${SEATUNNEL_VERSION}

# BASE_RELEASE_IMAGE argument must be defined twice
ARG FLINK_VERSION=1.17
ARG FLINK_VERSION=1.15
ARG BASE_RELEASE_IMAGE=flink:${FLINK_VERSION}
FROM $BASE_RELEASE_IMAGE as release

ENV SEATUNNEL_VERSION=2.3.1
ARG SEATUNNEL_VERSION=2.3.2
ENV SEATUNNEL_HOME=/opt/seatunnel

RUN mkdir -p $SEATUNNEL_HOME

COPY --from=build $SCALEPH_HOME $SCALEPH_HOME/
COPY apache-seatunnel-${SEATUNNEL_VERSION}-bin/* $SCALEPH_HOME/
56 changes: 56 additions & 0 deletions tools/docker/build/scaleph-seatunnel/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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.

ARG FLINK_VERSION=1.17
ARG BASE_RELEASE_IMAGE=flink:${FLINK_VERSION}
FROM maven:3.8-eclipse-temurin-11 as build

ARG SEATUNNEL_VERSION=2.3.2

ENV SEATUNNEL_HOME=/opt/seatunnel

RUN mkdir -p $SEATUNNEL_HOME

ARG TAR_FILE=apache-seatunnel-${SEATUNNEL_VERSION}-bin.tar.gz

#COPY $TAR_FILE $SEATUNNEL_HOME/$TAR_FILE
#RUN cd $SEATUNNEL_HOME ; \
# tar -zxf $TAR_FILE --strip 1 -C $SEATUNNEL_HOME \

# forked from seatunnel k8s quick start
RUN wget https://archive.apache.org/dist/seatunnel/${SEATUNNEL_VERSION}/$TAR_FILE ; \
tar -zxf $TAR_FILE --strip 1 -C $SEATUNNEL_HOME

# strange behavior: replace mvnw by mvn on install-plugin.sh, remove useless comment on plugin_config
RUN rm $SEATUNNEL_HOME/config/plugin_config
COPY tools/docker/build/scaleph-seatunnel/plugin_config $SEATUNNEL_HOME/config

RUN rm $SEATUNNEL_HOME/bin/install-plugin.sh
COPY tools/docker/build/scaleph-seatunnel/install-plugin.sh $SEATUNNEL_HOME/bin

RUN cd $SEATUNNEL_HOME ; \
sh -x bin/install-plugin.sh ${SEATUNNEL_VERSION}

# BASE_RELEASE_IMAGE argument must be defined twice
ARG FLINK_VERSION=1.17
ARG BASE_RELEASE_IMAGE=flink:${FLINK_VERSION}
FROM $BASE_RELEASE_IMAGE as release

ENV SEATUNNEL_HOME=/opt/seatunnel

RUN mkdir -p $SEATUNNEL_HOME

COPY --from=build $SCALEPH_HOME $SCALEPH_HOME/
53 changes: 1 addition & 52 deletions tools/docker/build/scaleph-seatunnel/plugin_config
Original file line number Diff line number Diff line change
@@ -1,53 +1,2 @@
connector-amazondynamodb
connector-assert
connector-cassandra
connector-cdc-mysql
connector-cdc-sqlserver
connector-clickhouse
connector-datahub
connector-dingtalk
connector-doris
connector-elasticsearch
connector-email
connector-file-ftp
connector-file-hadoop
connector-file-local
connector-file-oss
connector-file-oss-jindo
connector-file-s3
connector-file-sftp
connector-google-sheets
connector-hive
connector-http-base
connector-http-feishu
connector-http-gitlab
connector-http-github
connector-http-jira
connector-http-klaviyo
connector-http-lemlist
connector-http-myhours
connector-http-notion
connector-http-onesignal
connector-http-wechat
connector-hudi
connector-iceberg
connector-influxdb
connector-iotdb
connector-jdbc
connector-kafka
connector-kudu
connector-maxcompute
connector-mongodb
connector-neo4j
connector-openmldb
connector-pulsar
connector-rabbitmq
connector-redis
connector-s3-redshift
connector-sentry
connector-slack
connector-socket
connector-starrocks
connector-tablestore
connector-selectdb-cloud
connector-hbase
connector-cassandra

0 comments on commit 631ea2c

Please sign in to comment.