Commit 6e0ea6cf authored by wangpeng's avatar wangpeng

优化

parent 2a13c503
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
</component> </component>
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" /> <mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="$PROJECT_DIR$/.github/actions/translate-on-issue" vcs="Git" />
</component> </component>
</project> </project>
\ No newline at end of file
ARG FLINK_VERSION
ARG DINKY_VERSION
#FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/flink:${FLINK_VERSION}-scala_2.12-java8 as flink-base
FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/eclipse-temurin:8-jre-jammy
ENV NODE_OPTIONS=--openssl-legacy-provider
ENV UMI_ENV=production
WORKDIR /opt/
ARG FLINK_VERSION
ARG DINKY_VERSION
ENV FLINK_VERSION=${FLINK_VERSION}
ENV DINKY_VERSION=${DINKY_VERSION}
ADD ./build/dinky-release-${FLINK_VERSION}-${DINKY_VERSION}.tar.gz .
RUN mkdir -p /opt/dinky
RUN mv /opt/dinky-release-${FLINK_VERSION}-${DINKY_VERSION}/* /opt/dinky/
RUN rm -rf /opt/dinky-release-${FLINK_VERSION}-${DINKY_VERSION}
#
#FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/eclipse-temurin:8-jre-jammy
##
#ARG FLINK_VERSION
ENV FLINK_VERSION=${FLINK_VERSION}
ENV DINKY_HOME=/opt/dinky/
ENV H2_DB=./tmp/db/h2
##
USER root
##
## RUN rm -f ${DINKY_HOME}extends/flink${FLINK_VERSION}/flink-table-planner-loader*.jar
##
##
RUN mkdir ${DINKY_HOME}customJar && chmod -R 777 ${DINKY_HOME}
##
EXPOSE 8888
##
CMD /opt/dinky/auto.sh startOnPending
\ No newline at end of file
ARG FLINK_VERSION
ARG DINKY_VERSION
FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/flink:1.14.6-scala_2.12-java8 as flink-base
FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/node:18.15.0-alpine3.17 AS ui-build
WORKDIR /build/
ENV NODE_OPTIONS=--openssl-legacy-provider
ENV UMI_ENV=production
# 单独分离 package.json,是为了安装依赖可最大限度利用缓存
#ADD ./dinky-web/package.json /build/package.json
#RUN npm install --legacy-peer-deps
#ADD ./dinky-web .
#RUN npm run build
FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/maven:3.9-eclipse-temurin-8-alpine AS build
WORKDIR /build/
ARG FLINK_VERSION
ARG DINKY_VERSION
ENV FLINK_VERSION=${FLINK_VERSION}
ENV DINKY_VERSION=${DINKY_VERSION}
#ADD . .
#COPY --from=ui-build /build/dist/ /build/dinky-web/dist/
#ADD ./build/dinky-release-${FLINK_VERSION}-${DINKY_VERSION}.tar.gz .
#RUN mkdir -p /opt/dinky
#RUN mv /opt/dinky-release-${FLINK_VERSION}-${DINKY_VERSION}/* /opt/dinky/
#RUN rm -rf /opt/dinky-release-${FLINK_VERSION}-${DINKY_VERSION}
RUN mkdir release
ADD ./build/dinky-release-${FLINK_VERSION}-${DINKY_VERSION}.tar.gz release/
RUN mv release/dinky-release-* release/dinky
FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/eclipse-temurin:8-jre-jammy
ARG FLINK_VERSION
ENV FLINK_VERSION=${FLINK_VERSION}
ENV DINKY_HOME=/opt/dinky/
ENV H2_DB=./tmp/db/h2
WORKDIR /opt/dinky/
USER root
COPY --from=build /build/release/dinky /opt/dinky/
COPY --from=flink-base /opt/flink/lib/*.jar /opt/dinky/extends/flink${FLINK_VERSION}/flink/
RUN rm -f /opt/dinky/extends/flink${FLINK_VERSION}/flink/flink-table-planner-loader*.jar
COPY --from=flink-base /opt/flink/opt/flink-table-planner*.jar /opt/dinky/extends/flink${FLINK_VERSION}/flink/
RUN mkdir /opt/dinky/customJar && chmod -R 777 /opt/dinky/
EXPOSE 8888
CMD ./auto.sh startOnPending
\ No newline at end of file
...@@ -17,29 +17,30 @@ ...@@ -17,29 +17,30 @@
# #
DINKY_VERSION=1.0.3 DINKY_VERSION=1.1.0
FLINK_VERSION=1.17 FLINK_VERSION=1.14
# Customize other dependent paths, # Customize other dependent paths,
# which will be mounted to dinky and flink containers # which will be mounted to dinky and flink containers
# 自定义其他依赖路径,会挂载到dinky和flink容器中 # 自定义其他依赖路径,会挂载到dinky和flink容器中
CUSTOM_JAR_PATH=/opt/dinky/extends/ # CUSTOM_JAR_PATH=/opt/dinky/extends/
CUSTOM_JAR_PATH=/Users/wp/Documents/geek/code/githubcode/build/
FLINK_PROPERTIES="jobmanager.rpc.address: jobmanager" FLINK_PROPERTIES="jobmanager.rpc.address: jobmanager"
TZ=Asia/Shanghai TZ=Asia/Shanghai
# mysql,h2,pgsql # mysql,h2,pgsql
DB_ACTIVE=h2 DB_ACTIVE=mysql
# use h2 db localtion file path # use h2 db localtion file path
H2_DB=./tmp/db/h2 # H2_DB=./tmp/db/h2
## Mysql Config ## Mysql Config
## if ${DB_ACTIVE} use mysql, please config the following ## if ${DB_ACTIVE} use mysql, please config the following
## 如果 DB_ACTIVE 配置为mysaql,请修改下面配置,否则忽略 ## 如果 DB_ACTIVE 配置为mysaql,请修改下面配置,否则忽略
##MYSQL_ADDR=127.0.0.1:3306 MYSQL_ADDR=39.104.54.188:30306
#MYSQL_DATABASE=dinky MYSQL_DATABASE=dinky
#MYSQL_USERNAME=dinky MYSQL_USERNAME=root
#MYSQL_PASSWORD=dinky MYSQL_PASSWORD=mysqlLan2vWfdstv8
## Postgres Config ## Postgres Config
## if ${DB_ACTIVE} use pgsql, please config the following ## if ${DB_ACTIVE} use pgsql, please config the following
......
ARG FLINK_VERSION ARG FLINK_VERSION
ARG DINKY_VERSION ARG DINKY_VERSION
FROM flink:${FLINK_VERSION}-scala_2.12-java8 as flink-base FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/flink:${FLINK_VERSION}-scala_2.12-java8 as flink-base
FROM node:18.15.0-alpine3.17 AS ui-build FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/node:18.15.0-alpine3.17 AS ui-build
WORKDIR /build/ WORKDIR /build/
ENV NODE_OPTIONS=--openssl-legacy-provider ENV NODE_OPTIONS=--openssl-legacy-provider
...@@ -15,7 +15,7 @@ RUN npm install --legacy-peer-deps ...@@ -15,7 +15,7 @@ RUN npm install --legacy-peer-deps
ADD ./dinky-web . ADD ./dinky-web .
RUN npm run build RUN npm run build
FROM maven:3.9-eclipse-temurin-8-alpine AS build FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/maven:3.9-eclipse-temurin-8-alpine AS build
WORKDIR /build/ WORKDIR /build/
ARG FLINK_VERSION ARG FLINK_VERSION
ARG DINKY_VERSION ARG DINKY_VERSION
...@@ -31,7 +31,7 @@ RUN mkdir release && \ ...@@ -31,7 +31,7 @@ RUN mkdir release && \
mv release/dinky-release-* release/dinky mv release/dinky-release-* release/dinky
FROM eclipse-temurin:8-jre-jammy FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/eclipse-temurin:8-jre-jammy
ARG FLINK_VERSION ARG FLINK_VERSION
ENV FLINK_VERSION=${FLINK_VERSION} ENV FLINK_VERSION=${FLINK_VERSION}
......
...@@ -2,17 +2,23 @@ version: "3.9" ...@@ -2,17 +2,23 @@ version: "3.9"
services: services:
dinky: dinky:
image: "ikiler/dinky:${DINKY_VERSION}-flink${FLINK_VERSION}" image: "registry.cn-huhehaote.aliyuncs.com/wangpeng_4/dinky-server:1.1.0-flink1.14"
ports: ports:
- "8888:8888" - "8888:8888"
env_file: .env env_file: .env
networks: networks:
- dinky - dinky
environment:
- DB_ACTIVE=mysql
- MYSQL_ADDR=39.104.54.188:30306
- MYSQL_USER=root
- MYSQL_PASSWORD=mysqlLan2vWfdstv8
- MYSQL_DATABASE=dinky
volumes: volumes:
- ${CUSTOM_JAR_PATH}:/opt/dinky/customJar/ - ${CUSTOM_JAR_PATH}:/opt/dinky/customJar/
jobmanager: jobmanager:
image: flink:${FLINK_VERSION}-scala_2.12-java8 image: "registry.cn-huhehaote.aliyuncs.com/wangpeng_4/flink:1.14.6-scala_2.12-java8"
ports: ports:
- "8081:8081" - "8081:8081"
command: jobmanager command: jobmanager
...@@ -23,7 +29,7 @@ services: ...@@ -23,7 +29,7 @@ services:
- dinky - dinky
taskmanager: taskmanager:
image: flink:${FLINK_VERSION}-scala_2.12-java8 image: "registry.cn-huhehaote.aliyuncs.com/wangpeng_4/flink:1.14.6-scala_2.12-java8"
command: taskmanager command: taskmanager
env_file: .env env_file: .env
volumes: volumes:
......
ARG FLINK_VERSION=1.16.3
FROM registry.cn-huhehaote.aliyuncs.com/wangpeng_4/flink:${FLINK_VERSION}-scala_2.12-java8
ADD . /opt/flink/lib
RUN rm -rf /opt/flink/lib/flink-table-planner-loader-*.jar
\ No newline at end of file
#flink-operator-repo
# helm repo add flink-operator-repo https://downloads.apache.org/flink/flink-kubernetes-operator-1.9.0/
# helm repo add stable http://mirror.azure.cn/kubernetes/charts
# helm repo add bitnami https://charts.bitnami.com/bitnami
# helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
# local:///opt/flink/lib/dinky-app-1.16-1.1.0-jar-with-dependencies.jar
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-flink-jar
namespace: flink
labels:
pv: nfs-client-provisioner-jar
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Recycle
storageClassName: managed-nfs-storage
nfs:
path: /data/flink/jar
server: 172.27.84.85
---
# 创建PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-flink-jar
namespace: flink
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: managed-nfs-storage
selector:
matchLabels:
pv: nfs-client-provisioner-jar
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-flink-log
namespace: flink
labels:
pv: nfs-client-provisioner-log
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Recycle
storageClassName: managed-nfs-storage
nfs:
path: /data/flink/log #需要将PVC对应的路径权限设置为chmod -R 777 /data/flink/log
server: 172.27.84.85
---
# 创建PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-flink-log
namespace: flink
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: managed-nfs-storage
selector:
matchLabels:
pv: nfs-client-provisioner-log
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-flink-checkpoints
namespace: flink
labels:
pv: nfs-client-provisioner-checkpoints
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Recycle
storageClassName: managed-nfs-storage
nfs:
path: /data/flink/checkpoints #需要将PVC对应的路径权限设置为chmod -R 777 /data/flink/log
server: 172.27.84.85
---
# 创建PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-flink-checkpoints
namespace: flink
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: managed-nfs-storage
selector:
matchLabels:
pv: nfs-client-provisioner-checkpoints
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-flink-recovery
namespace: flink
labels:
pv: nfs-client-provisioner-recovery
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Recycle
storageClassName: managed-nfs-storage
nfs:
path: /data/flink/flink_recovery #需要将PVC对应的路径权限设置为chmod -R 777 /data/flink/log
server: 172.27.84.85
---
# 创建PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-flink-recovery
namespace: flink
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: managed-nfs-storage
selector:
matchLabels:
pv: nfs-client-provisioner-recovery
---
# Flink Session集群
apiVersion: flink.apache.org/v1beta1
kind: FlinkDeployment
metadata:
namespace: flink
name: session-deployment-only
spec:
image: registry.cn-huhehaote.aliyuncs.com/wangpeng_4/dinky-flink:1.0.0-1.16.3
flinkVersion: v1_16
imagePullPolicy: IfNotPresent # 镜像拉取策略,本地没有则从仓库拉取
ingress: # ingress配置,用于访问flink web页面
template: "flink.k8s.io/{{namespace}}/{{name}}(/|$)(.*)"
className: "nginx"
annotations:
nginx.ingress.kubernetes.io/rewrite-target: "/$2"
flinkConfiguration:
taskmanager.numberOfTaskSlots: "1"
state.checkpoints.dir: file:///opt/flink/checkpoints
high-availability.type: kubernetes
high-availability: org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory
high-availability.storageDir: file:///opt/flink/flink_recovery
serviceAccount: flink
jobManager: # jobManager 配置
replicas: 1
resource:
memory: "1024m"
cpu: 1
taskManager: # taskManager配置
replicas: 1
resource:
memory: "1024m"
cpu: 1
podTemplate:
spec:
containers:
- name: flink-main-container
env:
- name: TZ
value: Asia/Shanghai
volumeMounts:
- name: flink-log # 挂载log
mountPath: /opt/flink/log # 记住这是容器内部文件夹路径
- name: flink-checkpoints # 挂载log
mountPath: /opt/flink/checkpoints
- name: flink-jar # 挂载log
mountPath: /opt/flink/jar
- name: flink-recovery # 挂载log
mountPath: /opt/flink/flink_recovery
volumes:
- name: flink-log
persistentVolumeClaim:
claimName: nfs-flink-log
- name: flink-checkpoints
persistentVolumeClaim:
claimName: nfs-flink-checkpoints
- name: flink-jar
persistentVolumeClaim:
claimName: nfs-flink-jar
- name: flink-recovery
persistentVolumeClaim:
claimName: nfs-flink-recovery
\ No newline at end of file
apiVersion: v1
kind: Pod
metadata:
name: jobmanager-pod-template
spec:
initContainers:
- name: artifacts-fetcher
image: registry.cn-huhehaote.aliyuncs.com/wangpeng_4/dinky-flink:1.0.0-1.16.3
# Use wget or other tools to get user jars from remote storage
# command: [ 'wget', 'https://path/of/StateMachineExample.jar', '-O', '/flink-artifact/myjob.jar' ]
volumeMounts:
- mountPath: /flink-artifact
name: flink-artifact
containers:
# Do not change the main container name
- name: flink-main-container
resources:
requests:
ephemeral-storage: 2048Mi
limits:
ephemeral-storage: 2048Mi
volumeMounts:
- mountPath: /opt/flink/volumes/hostpath
name: flink-volume-hostpath
- mountPath: /opt/flink/artifacts
name: flink-artifact
- mountPath: /opt/flink/log
name: flink-logs
# Use sidecar container to push logs to remote storage or do some other debugging things
# - name: sidecar-log-collector
# image: registry.cn-huhehaote.aliyuncs.com/wangpeng_4/dinky-flink:1.0.0-1.16.3
# command: [ 'command-to-upload', '/remote/path/of/flink-logs/' ]
# volumeMounts:
# - mountPath: /flink-logs
# name: flink-logs
volumes:
- name: flink-volume-hostpath
hostPath:
path: /tmp
type: Directory
- name: flink-artifact
emptyDir: { }
- name: flink-logs
emptyDir: { }
\ No newline at end of file
...@@ -97,7 +97,7 @@ spec: ...@@ -97,7 +97,7 @@ spec:
- /bin/bash - /bin/bash
- '-c' - '-c'
- >- - >-
/dinky/auto.sh startOnPending {{ .Values.spec.extraEnv.flinkVersion}} /opt/dinky/auto.sh startOnPending {{ .Values.spec.extraEnv.flinkVersion}}
args: args:
{{- if .Values.spec.livenessProbe.enabled }} {{- if .Values.spec.livenessProbe.enabled }}
livenessProbe: livenessProbe:
......
...@@ -22,18 +22,18 @@ nameOverride: "" ...@@ -22,18 +22,18 @@ nameOverride: ""
fullnameOverride: "" fullnameOverride: ""
image: image:
repository: "docker.dinky.org.cn:32451/dinky/dev/dinky-txh" repository: "registry.cn-huhehaote.aliyuncs.com/wangpeng_4/dinky-server"
pullPolicy: "Always" pullPolicy: "Always"
tag: "1.0.2" tag: "1.1.0-flink1.14"
pullSecret: "" pullSecret: ""
mysql: mysql:
enabled: false enabled: false
url: "172.168.1.111:31476" url: "39.104.54.188:30306"
auth: auth:
username: "dinky" username: "root"
password: "bigdata123!@#" password: "mysqlLan2vWfdstv8"
database: "dinky-dev-1-17" database: "dinky"
postgresql: postgresql:
enabled: false enabled: false
...@@ -46,19 +46,19 @@ postgresql: ...@@ -46,19 +46,19 @@ postgresql:
externalDatabase: externalDatabase:
enabled: true enabled: true
type: "mysql" type: "mysql"
url: "10.43.2.12:3306" url: "39.104.54.188:30306"
auth: auth:
username: "root" username: "root"
password: "Dinky@1234567!" password: "mysqlLan2vWfdstv8"
database: "dinky" database: "dinky"
externalDatabaseService: externalDatabaseService:
clusterIP: 10.43.2.12 clusterIP: 10.233.146.227 # 这里可以通过kubectl -n common-tools get svc命令查看内网clusterIP
port: 3306 port: 3306
externalDatabaseEndpoints: externalDatabaseEndpoints:
ip: 172.168.1.110 ip: 39.104.54.188 #这里外网NodePoint暴露的IP和端口号
port: 3306 port: 30306
rbac: rbac:
create: true create: true
...@@ -68,7 +68,7 @@ spec: ...@@ -68,7 +68,7 @@ spec:
containerPort: 8888 containerPort: 8888
name: rest name: rest
extraEnv: extraEnv:
flinkVersion: "1.17" flinkVersion: "1.14"
affinity: {} affinity: {}
nodeSelector: {} nodeSelector: {}
...@@ -113,8 +113,9 @@ ingress: ...@@ -113,8 +113,9 @@ ingress:
service: service:
## type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer ## type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer
type: "ClusterIP" type: "NodePort"
name: "dinky" name: "dinky"
containerPort: 8888
dinkyDefaultConfiguration: dinkyDefaultConfiguration:
create: true create: true
......
...@@ -50,8 +50,8 @@ ...@@ -50,8 +50,8 @@
<nodeVersion>v18.15.0</nodeVersion> <nodeVersion>v18.15.0</nodeVersion>
<npmVersion>10.5.0</npmVersion> <npmVersion>10.5.0</npmVersion>
<!-- 国内node下载加速 --> <!-- 国内node下载加速 -->
<!--<nodeDownloadRoot>https://mirrors.huaweicloud.com/nodejs/</nodeDownloadRoot>--> <nodeDownloadRoot>https://mirrors.huaweicloud.com/nodejs/</nodeDownloadRoot>
<!--<npmDownloadRoot>https://repo.huaweicloud.com/npm-software/</npmDownloadRoot>--> <npmDownloadRoot>https://repo.huaweicloud.com/npm-software/</npmDownloadRoot>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</goals> </goals>
<configuration> <configuration>
<!-- 国内npm源加速可在后面加入(去掉空格) - -registry https://repo.huaweicloud.com/repository/npm/ --> <!-- 国内npm源加速可在后面加入(去掉空格) - -registry https://repo.huaweicloud.com/repository/npm/ -->
<arguments>install --force</arguments> <arguments>install --force --registry https://repo.huaweicloud.com/repository/npm/</arguments>
</configuration> </configuration>
</execution> </execution>
<execution> <execution>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment