Skip to content

Commit

Permalink
add pom config for docker-compose and tis-k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
baisui1981 committed May 2, 2024
1 parent 37a5199 commit 8f1a4ec
Show file tree
Hide file tree
Showing 9 changed files with 403 additions and 2 deletions.
1 change: 0 additions & 1 deletion docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ services:
- ${PWD}/config/config.properties:/opt/app/tis-uber/tjs/conf/tis-web-config/config.properties
- ${PWD}/config/config.properties:/opt/app/tis-uber/tis-assemble/conf/tis-web-config/config.properties
- ${PWD}/data:/opt/data
- ${PWD}/data:/opt/data
63 changes: 63 additions & 0 deletions docker-compose/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!--~
~ 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:https://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.
-->
<project xmlns="http:https://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>


<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>docker-compose</artifactId>
<packaging>pom</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}</outputDirectory>
<resources>
<resource>
<directory>src/main/filters</directory>
<includes>
<include>**/*.yaml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

29 changes: 29 additions & 0 deletions docker-compose/src/main/filters/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: "1"
services:
flink:
image: registry.cn-hangzhou.aliyuncs.com/tis/flink:${project.version}
hostname: flink
mem_limit: 2048m
cpus: '1.0'
ports:
- "8081:8081"
command: ["/bin/bash","-c","./bin/start-cluster.sh && tail -f ./log/flink--standalonesession-0-*.log"]
environment:
- TZ=Asia/Shanghai
depends_on:
- tis-console
tis-console:
image: registry.cn-hangzhou.aliyuncs.com/tis/tis-console:${project.version}
hostname: tis-console
mem_limit: "1.5G"
cpus: '2.5'
environment:
- TZ=Asia/Shanghai
- JAVA_JVM_OPTS=-Xms512m -Xmx1G -XX:MetaspaceSize=100m -XX:MaxMetaspaceSize=300m
ports:
- "8080:8080"
- "56432:56432"
volumes:
- ${PWD}/config/config.properties:/opt/app/tis-uber/tjs/conf/tis-web-config/config.properties
- ${PWD}/config/config.properties:/opt/app/tis-uber/tis-assemble/conf/tis-web-config/config.properties
- ${PWD}/data:/opt/data
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

<modules>
<module>xmodifier</module>
<module>docker-compose</module>
<module>datax-config</module>
<module>tis-builder-api</module>
<module>tis-manage-pojo</module>
Expand Down Expand Up @@ -90,6 +91,7 @@
<!-- <module>tis-scala-compiler-dependencies</module>-->

<module>maven-tpi-plugin</module>
<module>tis-k8s</module>
<!-- <module>tis-datax-executor</module>-->
<!-- <module>tis-zeppelin</module>-->

Expand Down
65 changes: 65 additions & 0 deletions tis-k8s/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--~
~ 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:https://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.
-->

<project xmlns="http:https://maven.apache.org/POM/4.0.0"
xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http:https://maven.apache.org/POM/4.0.0 http:https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>tis-k8s</artifactId>
<packaging>pom</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}</outputDirectory>
<resources>
<resource>
<directory>src/main/filters</directory>
<includes>
<include>**/*.yaml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
171 changes: 171 additions & 0 deletions tis-k8s/src/main/filters/tis-console.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# export KUBECONFIG=~/.kube/aliyun
apiVersion: v1
kind: Service
metadata:
name: tis-console-loadbalancer
spec:
ports:
- port: 8080
name: tis-console-8080
protocol: TCP
targetPort: tis-8080
selector:
app: tis-console
type: LoadBalancer
---

apiVersion: v1
kind: Service
metadata:
name: tis-console-cluster-svc
spec:
ports:
- port: 8080
name: tis-console-8080
protocol: TCP
targetPort: tis-8080
- port: 56432
name: tis-console-grpc
protocol: TCP
targetPort: tis-grpc
selector:
app: tis-console
type: ClusterIP
---

#apiVersion: v1
#kind: PersistentVolume
#metadata:
# name: pv-oss
#spec:
# capacity:
# storage: 5Gi
# accessModes:
# - ReadWriteMany
# storageClassName: oss
# flexVolume:
# driver: "alicloud/oss"
# options:
# bucket: "incr-log"
# url: "oss-cn-hangzhou.aliyuncs.com"
# path: "/tis-pv"
# akId: ""
# akSecret: ""
# otherOpts: "-o max_stat_cache_size=0 -o allow_other"
#---
#kind: PersistentVolumeClaim
#apiVersion: v1
#metadata:
# name: tis-console-pvc-oss
#spec:
# storageClassName: oss
# accessModes:
# - ReadWriteMany
# resources:
# requests:
# storage: 5Gi

apiVersion: v1
kind: PersistentVolume
metadata:
name: csi-pv
labels:
alicloud-pvname: disk-pv
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
csi:
driver: diskplugin.csi.alibabacloud.com
volumeHandle: "d-bp15tdr3q90sxxz2l0dz"
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: topology.diskplugin.csi.alibabacloud.com/zone
operator: In
values:
- "cn-hangzhou-k"
---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: disk-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
selector:
matchLabels:
alicloud-pvname: disk-pv
---

apiVersion: v1
kind: ConfigMap
metadata:
name: tis-config
data:
config.properties: |-
project.name=TIS
runtime=daily
#tis.datasource.type=mysql
#tis.datasource.url=192.168.28.200
#tis.datasource.port=3306
#tis.datasource.username=root
#tis.datasource.password=123456
#tis.datasource.dbname=tis_console1
tis.datasource.type=derby
tis.datasource.dbname=tis_console_db
assemble.host=tis-console-cluster-svc.default
tis.host=tis-console-cluster-svc.default
---
# how to use aliyun pv: https://help.aliyun.com/zh/ack/ack-managed-and-ack-dedicated/user-guide/mount-a-statically-provisioned-oss-volume?spm=a2c4g.11186623.0.0.39145057wGt7rB
# 使用 云盘:https://help.aliyun.com/zh/ack/ack-managed-and-ack-dedicated/user-guide/use-a-statically-provisioned-disk-volume?spm=a2c4g.11186623.0.i5
apiVersion: v1
kind: ReplicationController
metadata:
name: tis-console
spec:
replicas: 1
selector:
app: tis-console
template:
metadata:
labels:
app: tis-console
spec:
containers:
- name: tis-console
volumeMounts:
- name: tis-config-volume
mountPath: /opt/app/tis-uber/tjs/conf/tis-web-config/
- name: tis-config-volume
mountPath: /opt/app/tis-uber/tis-assemble/conf/tis-web-config/
- name: tis-console-pvc
mountPath: "/opt/data"
image: registry.cn-hangzhou.aliyuncs.com/tis/tis-console:${project.version}
# command: [ "/bin/sh", "-c", "sleep 1000000" ]
ports:
- name: tis-8080
containerPort: 8080
- name: tis-grpc
containerPort: 56432
volumes:
- name: tis-config-volume
configMap:
name: tis-config
- name: tis-console-pvc
persistentVolumeClaim:
claimName: disk-pvc
---

File renamed without changes.
2 changes: 1 addition & 1 deletion tis-console.yaml → tis-k8s/tis-console.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ spec:
mountPath: /opt/app/tis-uber/tis-assemble/conf/tis-web-config/
- name: tis-console-pvc
mountPath: "/opt/data"
image: registry.cn-hangzhou.aliyuncs.com/tis/tis-console:4.0.0.36
image: registry.cn-hangzhou.aliyuncs.com/tis/tis-console:4.0.0
# command: [ "/bin/sh", "-c", "sleep 1000000" ]
ports:
- name: tis-8080
Expand Down
Loading

0 comments on commit 8f1a4ec

Please sign in to comment.