Skip to content

Commit

Permalink
[Feature][scaleph-datasource] init scaleph datasource to gravitino (#711
Browse files Browse the repository at this point in the history
)

* fix: seatunnel dag delete edge error

* feature: update dag instance, step and link schema

* feature: update dag instance, step and link mapper

* feature: update dag instance, step and link mapper

* feature: update dag instance, step and link dto

* feature: scaleph-gravitino dockerfile

* feature: scaleph-gravitino dockerfile

* feature: add dag instance, step and link service

* feature: add dag instance, step and link service

* feature: update dag instance statemachine

* feature: update dag step instance statemachine

* feature: update workflow instance and task instance statemachine

* feature: update datasource type

* feature: update datasource type

* feature: update local docker-compose README

---------

Co-authored-by: wangqi <wangqi@xinxuan.net>
  • Loading branch information
kalencaya and wangqi authored May 5, 2024
1 parent 4056d1c commit 624d8d6
Show file tree
Hide file tree
Showing 77 changed files with 1,205 additions and 794 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/release-manual-docker-gravitino.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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.

name: Release-Docker-Gravitino

on:
workflow_dispatch:
inputs:
gravitinoVersion:
description: 'gravitino version'
required: true
default: '0.5.0'
type: choice
options:
- 0.5.0
env:
HUB: ghcr.io/flowerfine/scaleph-gravitino
GRAVITINO_VERSION: ${{ inputs.gravitinoVersion }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
timeout-minutes: 360
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.HUB }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: amd64,arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v5
with:
no-cache: false
cache-from: type=gha
cache-to: type=gha
push: true
context: .
build-args: |
GRAVITINO_VERSION=${{ env.GRAVITINO_VERSION }}
platforms: linux/amd64,linux/arm64
file: tools/docker/build/scaleph-gravitino/Dockerfile
tags: ${{ env.HUB }}:${{ env.GRAVITINO_VERSION }}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import cn.sliew.scaleph.workflow.service.WorkflowInstanceService;
import cn.sliew.scaleph.workflow.service.WorkflowTaskInstanceService;
import cn.sliew.scaleph.workflow.service.dto.WorkflowDefinitionDTO;
import cn.sliew.scaleph.workflow.service.dto.WorkflowTaskDefinitionDTO2;
import cn.sliew.scaleph.workflow.service.dto.WorkflowTaskDefinitionDTO;
import cn.sliew.scaleph.workflow.service.param.WorkflowDefinitionListParam;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.graph.Graph;
Expand Down Expand Up @@ -64,8 +64,8 @@ public ResponseEntity<Page<WorkflowDefinitionDTO>> listWorkflowDefinitions(@Vali
@Logging
@GetMapping("{workflowDefinitionId}")
@Operation(summary = "查询 workflow 定义列表", description = "查询 workflow 定义列表")
public ResponseEntity<ResponseVO<Set<WorkflowTaskDefinitionDTO2>>> listWorkflowTaskDefinitions(@PathVariable("workflowDefinitionId") Long workflowDefinitionId) {
Graph<WorkflowTaskDefinitionDTO2> dag = workflowDefinitionService.getDag(workflowDefinitionId);
public ResponseEntity<ResponseVO<Set<WorkflowTaskDefinitionDTO>>> listWorkflowTaskDefinitions(@PathVariable("workflowDefinitionId") Long workflowDefinitionId) {
Graph<WorkflowTaskDefinitionDTO> dag = workflowDefinitionService.getDag(workflowDefinitionId);
return new ResponseEntity<>(ResponseVO.success(dag.nodes()), HttpStatus.OK);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,54 +28,54 @@
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum DataSourceType implements DictInstance {

MYSQL("MySQL", "MySQL"),
ORACLE("Oracle", "Oracle"),
POSTGRESQL("PostgreSQL", "PostgreSQL"),
SQLSERVER("SQLServer", "SQLServer"),
DMDB("DmDB", "DmDB"),
GBASE8A("GBase8a", "GBase8a"),
GREENPLUM("Greenplum", "Greenplum"),
PHOENIX("Phoenix", "Phoenix"),

REDIS("Redis", "Redis"),
ELASTICSEARCH("Elasticsearch", "Elasticsearch"),
SOLR("Solr", "Solr"),
MONGODB("MongoDB", "MongoDB"),
TIDB("TiDB", "TiDB"),
CASSANDRA("Cassandra", "Cassandra"),

KAFKA("Kafka", "Kafka"),
PULSAR("Pulsar", "Pulsar"),
DATAHUB("DataHub", "DataHub"),

FTP("Ftp", "Ftp"),
SFTP("Sftp", "Sftp"),
OSS("OSS", "OSS"),
OSSJINDO("OSSJindo", "OSSJindo"),
S3("S3", "S3"),
HDFS("HDFS", "HDFS"),

HIVE("Hive", "Hive"),
HBASE("HBase", "HBase"),
IMPALA("Impala", "Impala"),
DORIS("Doris", "Doris"),
STARROCKS("StarRocks", "StarRocks"),
CLICKHOUSE("ClickHouse", "ClickHouse"),
KUDU("Kudu", "Kudu"),
KYLIN("Kylin", "Kylin"),
DRUID("Druid", "Druid"),
MAXCOMPUTE("MaxCompute", "MaxCompute"),

IOTDB("IoTDB", "IoTDB"),
NEO4J("Neo4j", "Neo4j"),

HUDI("Hudi", "Hudi"),
ICEBERG("Iceberg", "Iceberg"),

INFLUXDB("InfluxDB", "InfluxDB"),
EMAIL("Email", "Email"),
SOCKET("Socket", "Socket"),
HTTP("Http", "Http"),
MYSQL("MySQL", "MySQL", "mysql remark"),
ORACLE("Oracle", "Oracle", null),
POSTGRESQL("PostgreSQL", "PostgreSQL", null),
SQLSERVER("SQLServer", "SQLServer", null),
DMDB("DmDB", "DmDB", null),
GBASE8A("GBase8a", "GBase8a", null),
GREENPLUM("Greenplum", "Greenplum", null),
PHOENIX("Phoenix", "Phoenix", null),

REDIS("Redis", "Redis", null),
ELASTICSEARCH("Elasticsearch", "Elasticsearch", null),
SOLR("Solr", "Solr", null),
MONGODB("MongoDB", "MongoDB", null),
TIDB("TiDB", "TiDB", null),
CASSANDRA("Cassandra", "Cassandra", null),

KAFKA("Kafka", "Kafka", null),
PULSAR("Pulsar", "Pulsar", null),
DATAHUB("DataHub", "DataHub", null),

FTP("Ftp", "Ftp", null),
SFTP("Sftp", "Sftp", null),
OSS("OSS", "OSS", null),
OSSJINDO("OSSJindo", "OSSJindo", null),
S3("S3", "S3", null),
HDFS("HDFS", "HDFS", null),

HIVE("Hive", "Hive", null),
HBASE("HBase", "HBase", null),
IMPALA("Impala", "Impala", null),
DORIS("Doris", "Doris", null),
STARROCKS("StarRocks", "StarRocks", null),
CLICKHOUSE("ClickHouse", "ClickHouse", null),
KUDU("Kudu", "Kudu", null),
KYLIN("Kylin", "Kylin", null),
DRUID("Druid", "Druid", null),
MAXCOMPUTE("MaxCompute", "MaxCompute", null),

IOTDB("IoTDB", "IoTDB", null),
NEO4J("Neo4j", "Neo4j", null),

HUDI("Hudi", "Hudi", null),
ICEBERG("Iceberg", "Iceberg", null),

INFLUXDB("InfluxDB", "InfluxDB", null),
EMAIL("Email", "Email", null),
SOCKET("Socket", "Socket", null),
HTTP("Http", "Http", null),
;

@JsonCreator
Expand All @@ -88,10 +88,12 @@ public static DataSourceType of(String value) {
@EnumValue
private String value;
private String label;
private String remark;

DataSourceType(String value, String label) {
DataSourceType(String value, String label, String remark) {
this.value = value;
this.label = label;
this.remark = remark;
}

@Override
Expand All @@ -103,4 +105,9 @@ public String getValue() {
public String getLabel() {
return label;
}

@Override
public String getRemark() {
return remark;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
* DAG 实例
*/
Expand All @@ -32,9 +34,24 @@ public class DagInstance extends BaseDO {

private static final long serialVersionUID = 1L;

@TableField("dag_meta")
private String dagMeta;
@TableField("dag_config_id")
private Long dagConfigId;

@TableField("instance_id")
private String instanceId;

@TableField("inputs")
private String inputs;

@TableField("outputs")
private String outputs;

@TableField("`status`")
private String status;

@TableField("start_time")
private Date startTime;

@TableField("dag_attrs")
private String dagAttrs;
@TableField("end_time")
private Date endTime;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
* DAG 连线
*/
Expand All @@ -32,24 +34,27 @@ public class DagLink extends BaseDO {

private static final long serialVersionUID = 1L;

@TableField("dag_id")
private Long dagId;
@TableField("dag_instance_id")
private Long dagInstanceId;

@TableField("dag_config_link_id")
private Long dagConfigLinkId;

@TableField("link_id")
private String linkId;
@TableField("instance_id")
private String instanceId;

@TableField("link_name")
private String linkName;
@TableField("inputs")
private String inputs;

@TableField("from_step_id")
private String fromStepId;
@TableField("outputs")
private String outputs;

@TableField("to_step_id")
private String toStepId;
@TableField("`status`")
private String status;

@TableField("link_meta")
private String linkMeta;
@TableField("start_time")
private Date startTime;

@TableField("link_attrs")
private String linkAttrs;
@TableField("end_time")
private Date endTime;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* 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.
*/

package cn.sliew.scaleph.dao.entity.master.dag;

import cn.sliew.scaleph.dao.entity.BaseDO;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
* DAG 连线
*/
@Data
@TableName("dag_link")
public class DagLinkVO extends BaseDO {

private static final long serialVersionUID = 1L;

@TableField("dag_instance_id")
private Long dagInstanceId;

@TableField(value = "dag_config_link_id", exist = false)
private DagConfigLink dagConfigLink;

@TableField("instance_id")
private String instanceId;

@TableField("inputs")
private String inputs;

@TableField("outputs")
private String outputs;

@TableField("`status`")
private String status;

@TableField("start_time")
private Date startTime;

@TableField("end_time")
private Date endTime;
}
Loading

0 comments on commit 624d8d6

Please sign in to comment.