Skip to content

Commit

Permalink
[Bug][docker] fix scaleph-seatunnel image error (#638)
Browse files Browse the repository at this point in the history
* feature: add doris operator

* feature: add web-resource and role relation table

* feature: add web-resource and role relation mapper

* feature: add web-resource and role relation mapper

* fix: seatunnel base image
  • Loading branch information
kalencaya authored Nov 14, 2023
1 parent 242f8be commit e7089f5
Show file tree
Hide file tree
Showing 47 changed files with 1,657 additions and 20 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@
<artifactId>scaleph-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>scaleph-engine-doris</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>scaleph-engine-flink-client</artifactId>
Expand Down
6 changes: 5 additions & 1 deletion scaleph-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@

<dependencies>
<dependency>
<groupId>cn.sliew</groupId>
<groupId>${project.parent.groupId}</groupId>
<artifactId>scaleph-engine-doris</artifactId>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>scaleph-engine-sql-gateway</artifactId>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* 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.security;

import cn.sliew.scaleph.dao.entity.BaseDO;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
* 资源-web与角色关联表
*/
@Data
@TableName("sec_resource_web_role")
@Schema(name = "SecResourceWebRole对象", description = "资源-web与角色关联表")
public class SecResourceWebRole extends BaseDO {

private static final long serialVersionUID = 1L;

@TableField("resource_web_id")
private Long resourceWebId;

@TableField("role_id")
private Long roleId;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* 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.mapper.master.security;

import cn.sliew.scaleph.common.dict.security.RoleStatus;
import cn.sliew.scaleph.dao.entity.master.security.SecResourceWeb;
import cn.sliew.scaleph.dao.entity.master.security.SecResourceWebRole;
import cn.sliew.scaleph.dao.entity.master.security.SecRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
* 资源-web与角色关联表 Mapper 接口
*/
@Repository
public interface SecResourceWebRoleMapper extends BaseMapper<SecResourceWebRole> {

/**
* 查询 资源-web 关联的角色
*/
Page<SecRole> selectRelatedRolesByWebResource(Page page,
@Param("resourceWebId") Long resourceWebId,
@Param("status") RoleStatus status,
@Param("name") String name);

/**
* 查询 资源-web 未关联的角色
*/
Page<SecRole> selectUnrelatedRolesByWebResource(Page page,
@Param("resourceWebId") Long resourceWebId,
@Param("status") RoleStatus status,
@Param("name") String name);

Page<SecResourceWeb> selectAllResourceWebWithAuthorizeStatus(@Param("roleId") Long roleId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

package cn.sliew.scaleph.dao.mapper.master.security;

import java.io.Serializable;
import java.util.List;

import cn.sliew.scaleph.dao.entity.master.security.SecRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.List;

/**
* <p>
* 角色表 Mapper 接口
Expand All @@ -36,6 +36,7 @@
*/
@Repository
public interface SecRoleMapper extends BaseMapper<SecRole> {

/**
* 查询部门对应的角色信息
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?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://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.
-->

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.sliew.scaleph.dao.mapper.master.security.SecResourceWebRoleMapper">

<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.sliew.scaleph.dao.entity.master.security.SecResourceWebRole">
<result column="id" property="id" />
<result column="creator" property="creator" />
<result column="create_time" property="createTime" />
<result column="editor" property="editor" />
<result column="update_time" property="updateTime" />
<result column="resource_web_id" property="resourceWebId" />
<result column="role_id" property="roleId" />
</resultMap>

<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id,
creator,
create_time,
editor,
update_time,
resource_web_id, role_id
</sql>

<select id="selectRelatedRolesByWebResource" resultMap="cn.sliew.scaleph.dao.mapper.master.security.SecRoleMapper.SecRoleMap">
SELECT
t1.*
FROM
sec_role t1
JOIN sec_resource_web_role t2 ON t1.id = t2.role_id
WHERE
t2.resource_web_id = #{resourceWebId}
<if test="status != null">
AND t1.`status` = #{status}
</if>
<if test="name != null and name != ''">
AND t1.`name` like concat('%',#{name},'%')
</if>
ORDER BY
t1.`code`
</select>

<select id="selectUnrelatedRolesByWebResource" resultMap="cn.sliew.scaleph.dao.mapper.master.security.SecRoleMapper.SecRoleMap">
SELECT
t1.*
FROM
sec_role t1
WHERE
<if test="status != null">
AND t1.`status` = #{status}
</if>
<if test="name != null and name != ''">
AND t1.`name` like concat('%',#{name},'%')
</if>
AND NOT EXISTS ( SELECT * FROM sec_resource_web_role t2 WHERE t1.id = t2.role_id AND t2.resource_web_id = #{resourceWebId} )
ORDER BY
t1.`code`
</select>

</mapper>
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
</otherwise>
</choose>
</where>


</select>

</mapper>
1 change: 1 addition & 0 deletions scaleph-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<packaging>pom</packaging>

<modules>
<module>scaleph-engine-doris</module>
<module>scaleph-engine-flink-client</module>
<module>scaleph-engine-seatunnel</module>
<module>scaleph-engine-flink</module>
Expand Down
43 changes: 43 additions & 0 deletions scaleph-engine/scaleph-engine-doris/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?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://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://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.sliew</groupId>
<artifactId>scaleph</artifactId>
<version>1.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>scaleph-engine-doris</artifactId>

<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>scaleph-project</artifactId>
</dependency>

<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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.engine.doris.operator;

import cn.sliew.scaleph.engine.doris.operator.spec.DorisClusterSpec;
import cn.sliew.scaleph.engine.doris.operator.status.DorisClusterStatus;
import io.fabric8.kubernetes.api.model.Namespaced;
import io.fabric8.kubernetes.client.CustomResource;
import io.fabric8.kubernetes.model.annotation.Group;
import io.fabric8.kubernetes.model.annotation.Kind;
import io.fabric8.kubernetes.model.annotation.Version;

@Version("v1")
@Group("doris.selectdb.com")
@Kind("DorisCluster")
public class DorisCluster extends CustomResource<DorisClusterSpec, DorisClusterStatus> implements Namespaced {



}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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.engine.doris.operator.spec;

import lombok.Data;

@Data
public class AdminUser extends BaseSpec {

private String name;
private String password;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 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.engine.doris.operator.spec;

public enum AutoScalerVersion {
v1, v2;
}
Loading

0 comments on commit e7089f5

Please sign in to comment.