Skip to content

Commit 75fd1b9

Browse files
committed
Merge remote-tracking branch 'origin/dev-1.14.0' into dev-1.15.0
2 parents ba8588b + 6aeb37b commit 75fd1b9

File tree

14 files changed

+127
-21
lines changed

14 files changed

+127
-21
lines changed

dss-appconn/appconns/dss-workflow-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/workflow/opertion/WorkflowRefCopyOperation.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public RefJobContentResponseRef copyRef(ThirdlyRequestRef.CopyWitContextRequestR
4747
String contextIdStr = workflowCopyRequestRef.getContextId();
4848
String projectName = workflowCopyRequestRef.getProjectName();
4949
List<String> enableNodeList = (List<String>) workflowCopyRequestRef.getRefJobContent().get(OrchestratorRefConstant.ORCHESTRATION_ENABLE_NODE);
50+
String flowProxyUser = (String) workflowCopyRequestRef.getRefJobContent().get(OrchestratorRefConstant.FLOW_PROXY_USER);
5051
//插入version
5152
String version = workflowCopyRequestRef.getNewVersion();
5253
String description = (String) workflowCopyRequestRef.getRefJobContent().get(OrchestratorRefConstant.ORCHESTRATION_DESCRIPTION);
@@ -57,7 +58,7 @@ public RefJobContentResponseRef copyRef(ThirdlyRequestRef.CopyWitContextRequestR
5758
workflowCopyRequestRef.getWorkspace(), appId, contextIdStr,
5859
projectName, version, description, workflowCopyRequestRef.getDSSLabels(),
5960
targetProjectId, (String) nodeSuffix.orElse(null), (String) newFlowName.orElse(null),
60-
enableNodeList);
61+
enableNodeList,flowProxyUser);
6162
List<DSSLabel> dssLabels = workflowCopyRequestRef.getDSSLabels();
6263
Sender tempSend = DSSSenderServiceFactory.getOrCreateServiceInstance().getWorkflowSender(dssLabels);
6364
ResponseCopyWorkflow responseCopyWorkflow = RpcAskUtils.processAskException(tempSend.ask(requestCopyWorkflow),

dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/entity/request/EncryptCopyOrchestratorRequest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public class EncryptCopyOrchestratorRequest {
2323
// 查看用户
2424
private String accessUser;
2525

26+
private String flowProxyUser;
27+
2628
public Long getWorkspaceId() {
2729
return workspaceId;
2830
}
@@ -88,6 +90,13 @@ public void setAccessUser(String accessUser) {
8890
this.accessUser = accessUser;
8991
}
9092

93+
public String getFlowProxyUser() {
94+
return flowProxyUser;
95+
}
96+
97+
public void setFlowProxyUser(String flowProxyUser) {
98+
this.flowProxyUser = flowProxyUser;
99+
}
91100

92101
@Override
93102
public String toString() {
@@ -100,6 +109,7 @@ public String toString() {
100109
", copyFlowSuffix='" + copyFlowSuffix + '\'' +
101110
", copyNodeSuffix='" + copyNodeSuffix + '\'' +
102111
", accessUser='" + accessUser + '\'' +
112+
", flowProxyUser='" + flowProxyUser + '\'' +
103113
'}';
104114
}
105115
}

dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/entity/vo/OrchestratorCopyVo.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public class OrchestratorCopyVo implements Serializable {
2626

2727
private List<String> enableNodeIdList;
2828

29+
private String flowProxyUser;
30+
2931
private OrchestratorCopyVo(Builder builder) {
3032
this.username = builder.username;
3133
this.sourceProjectId = builder.sourceProjectId;
@@ -40,6 +42,7 @@ private OrchestratorCopyVo(Builder builder) {
4042
this.copyTaskId = builder.copyTaskId;
4143
this.instanceName = builder.instanceName;
4244
this.enableNodeIdList = builder.enableNodeIdList;
45+
this.flowProxyUser = builder.flowProxyUser;
4346
}
4447

4548

@@ -60,6 +63,8 @@ public static class Builder {
6063

6164
private List<String> enableNodeIdList;
6265

66+
private String flowProxyUser;
67+
6368
public Builder(String username, Long sourceProjectId, String sourceProjectName, Long targetProjectId,
6469
String targetProjectName, DSSOrchestratorInfo orchestrator, String targetOrchestratorName,
6570
String workflowNodeSuffix, DSSLabel dssLabel, Workspace workspace, String instanceName) {
@@ -80,7 +85,7 @@ public Builder(String username, Long sourceProjectId, String sourceProjectName,
8085
public Builder(String username, Long sourceProjectId, String sourceProjectName, Long targetProjectId,
8186
String targetProjectName, DSSOrchestratorInfo orchestrator, String targetOrchestratorName,
8287
String workflowNodeSuffix, DSSLabel dssLabel, Workspace workspace, String instanceName,
83-
List<String> enableNodeIdList) {
88+
List<String> enableNodeIdList,String flowProxyUser) {
8489

8590
this.username = username;
8691
this.sourceProjectId = sourceProjectId;
@@ -94,6 +99,7 @@ public Builder(String username, Long sourceProjectId, String sourceProjectName,
9499
this.workspace = workspace;
95100
this.instanceName = instanceName;
96101
this.enableNodeIdList = enableNodeIdList;
102+
this.flowProxyUser = flowProxyUser;
97103
}
98104

99105

@@ -163,5 +169,13 @@ public List<String> getEnableNodeIdList() {
163169
public void setEnableNodeIdList(List<String> enableNodeIdList) {
164170
this.enableNodeIdList = enableNodeIdList;
165171
}
172+
173+
public String getFlowProxyUser() {
174+
return flowProxyUser;
175+
}
176+
177+
public void setFlowProxyUser(String flowProxyUser) {
178+
this.flowProxyUser = flowProxyUser;
179+
}
166180
}
167181

dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/job/OrchestratorCopyJob.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private void copyOrchestrator() {
7676
try {
7777
doOrchestratorCopy(orchestratorCopyVo.getUsername(), orchestratorCopyVo.getWorkspace(), newOrchestrator,
7878
orchestratorCopyVo.getTargetProjectName(), Lists.newArrayList(orchestratorCopyVo.getDssLabel()), appId,
79-
orchestratorCopyVo.getEnableNodeIdList());
79+
orchestratorCopyVo.getEnableNodeIdList(),orchestratorCopyVo.getFlowProxyUser());
8080
} catch (Exception e) {
8181
//保存错误信息
8282
String errorMsg = "CopyOrcError: " + e.getMessage();
@@ -105,7 +105,8 @@ private void doOrchestratorCopy(String userName,
105105
DSSOrchestratorInfo dssOrchestratorInfo,
106106
String projectName,
107107
List<DSSLabel> dssLabels, Long appId,
108-
List<String> enableNodeIdList) throws Exception {
108+
List<String> enableNodeIdList,
109+
String flowProxyUser) throws Exception {
109110
String copyInitVersion = OrchestratorUtils.generateNewCopyVersion(orchestratorCopyVo.getWorkflowNodeSuffix());
110111
String contextId = orchestratorCopyEnv.getContextService().createContextID(workspace.getWorkspaceName(), projectName, dssOrchestratorInfo.getName(), copyInitVersion, userName);
111112
DSSOrchestratorVersion dssOrchestratorVersion = new DSSOrchestratorVersion();
@@ -133,6 +134,8 @@ private void doOrchestratorCopy(String userName,
133134
refJobContent.put(OrchestratorRefConstant.ORCHESTRATION_NODE_SUFFIX, orchestratorCopyVo.getWorkflowNodeSuffix());
134135
// 添加启用节点ID列表
135136
refJobContent.put(OrchestratorRefConstant.ORCHESTRATION_ENABLE_NODE, enableNodeIdList);
137+
// 添加copy工作流的代理用户
138+
refJobContent.put(OrchestratorRefConstant.FLOW_PROXY_USER,flowProxyUser);
136139
requestRef.setNewVersion(dssOrchestratorVersion.getVersion()).setRefJobContent(refJobContent);
137140
return ((RefCopyOperation) developmentOperation).copyRef(requestRef);
138141
}, "copy");

dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/restful/DSSFrameworkOrchestratorRestful.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public Message copyOrchestrator(@RequestBody OrchestratorCopyRequest orchestrato
230230
return Message.error("当前工作流正在被复制,不允许再次复制");
231231
}
232232

233-
String copyJobId = orchestratorFrameworkService.copyOrchestrator(username, orchestratorCopyRequest, workspace,null);
233+
String copyJobId = orchestratorFrameworkService.copyOrchestrator(username, orchestratorCopyRequest, workspace,null,null);
234234
AuditLogUtils.printLog(username, workspace.getWorkspaceId(), workspace.getWorkspaceName(), TargetTypeEnum.ORCHESTRATOR,
235235
orchestratorCopyRequest.getSourceOrchestratorId(), orchestratorCopyRequest.getSourceOrchestratorName(), OperateTypeEnum.COPY, orchestratorCopyRequest);
236236

@@ -803,10 +803,12 @@ public Message encryptCopyOrchestrator(@RequestBody EncryptCopyOrchestratorReque
803803
String username = SecurityFilter.getLoginUsername(httpServletRequest);
804804
Workspace workspace = SSOHelper.getWorkspace(httpServletRequest);
805805
encryptCopyOrchestratorRequest.setUsername(username);
806-
encryptCopyOrchestratorRequest.setAccessUser("hadoop");
807-
encryptCopyOrchestratorRequest.setWorkspaceId(workspace.getWorkspaceId());
808806

807+
if(StringUtils.isEmpty(encryptCopyOrchestratorRequest.getAccessUser())){
808+
encryptCopyOrchestratorRequest.setAccessUser("hadoop");
809+
}
809810

811+
encryptCopyOrchestratorRequest.setWorkspaceId(workspace.getWorkspaceId());
810812

811813
LOGGER.info("request encryptCopyOrchestrator body is {}",encryptCopyOrchestratorRequest);
812814

dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/OrchestratorFrameworkService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public interface OrchestratorFrameworkService {
4343

4444
OrchestratorUnlockVo unlockOrchestrator(String username, Workspace workspace, OrchestratorUnlockRequest request) throws DSSErrorException;
4545

46-
String copyOrchestrator(String username, OrchestratorCopyRequest orchestratorCopyRequest, Workspace workspace,List<String> enableNodeIdList) throws Exception;
46+
String copyOrchestrator(String username, OrchestratorCopyRequest orchestratorCopyRequest, Workspace workspace,List<String> enableNodeIdList,String flowProxyUser) throws Exception;
4747

4848
Pair<Long, List<OrchestratorCopyHistory>> getOrchestratorCopyHistory(String username, Workspace workspace, Long orchestratorId, Integer currentPage, Integer pageSize) throws Exception;
4949

dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/impl/OrchestratorFrameworkServiceImpl.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ public DSSOrchestratorVersion getLatestOrchestratorVersion(Long orchestratorId)
408408
}
409409

410410
@Override
411-
public String copyOrchestrator(String username, OrchestratorCopyRequest orchestratorCopyRequest, Workspace workspace, List<String> enableNodeIdList) throws Exception {
411+
public String copyOrchestrator(String username, OrchestratorCopyRequest orchestratorCopyRequest, Workspace workspace,
412+
List<String> enableNodeIdList,String flowProxyUser) throws Exception {
412413
if (orchestratorCopyRequest.getTargetOrchestratorName().length() > MAX_NAME_LENGTH) {
413414
DSSFrameworkErrorException.dealErrorException(60000, "编排名称过长,请限制在" + MAX_NAME_LENGTH + "以内");
414415
}
@@ -437,7 +438,7 @@ public String copyOrchestrator(String username, OrchestratorCopyRequest orchestr
437438
OrchestratorCopyVo orchestratorCopyVo = new OrchestratorCopyVo.Builder(username, sourceProject.getId(), sourceProject.getName(), targetProject.getId(),
438439
targetProject.getName(), sourceOrchestratorInfo, orchestratorCopyRequest.getTargetOrchestratorName(),
439440
orchestratorCopyRequest.getWorkflowNodeSuffix(), new EnvDSSLabel(dssLabel),
440-
workspace, Sender.getThisInstance(), enableNodeIdList).setCopyTaskId(null).build();
441+
workspace, Sender.getThisInstance(), enableNodeIdList, flowProxyUser).setCopyTaskId(null).build();
441442
OrchestratorCopyJob orchestratorCopyJob = new OrchestratorCopyJob();
442443
orchestratorCopyJob.setTargetProject(targetProject);
443444
orchestratorCopyJob.setOrchestratorCopyVo(orchestratorCopyVo);
@@ -1049,7 +1050,7 @@ public DSSOrchestratorCopyInfo encryptCopyOrchestrator(EncryptCopyOrchestratorRe
10491050
orchestratorCopyRequest.setTargetProjectName(dssProject.getName());
10501051
orchestratorCopyRequest.setWorkflowNodeSuffix(request.getCopyNodeSuffix());
10511052

1052-
String copyJobId = copyOrchestrator(username, orchestratorCopyRequest, workspace, enableNodeIdList);
1053+
String copyJobId = copyOrchestrator(username, orchestratorCopyRequest, workspace, enableNodeIdList,request.getFlowProxyUser());
10531054

10541055
DSSOrchestratorCopyInfo dssOrchestratorCopyInfo = new DSSOrchestratorCopyInfo();
10551056
dssOrchestratorCopyInfo.setId(copyJobId);

dss-orchestrator/dss-orchestrator-common/src/main/java/com/webank/wedatasphere/dss/orchestrator/common/ref/OrchestratorRefConstant.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,6 @@ public interface OrchestratorRefConstant {
6363

6464
public static final String ORCHESTRATION_ENABLE_NODE = "autoEnableNodeId";
6565

66+
public static final String FLOW_PROXY_USER="flowProxyUser";
67+
6668
}

dss-orchestrator/orchestrators/dss-workflow/dss-workflow-common/src/main/java/com/webank/wedatasphere/dss/workflow/common/protocol/RequestCopyWorkflow.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public class RequestCopyWorkflow {
3838

3939
private List<String> enableNodeList;
4040

41+
private String flowProxyUser;
42+
4143
public RequestCopyWorkflow(String userName,
4244
Workspace workspace,
4345
Long rootFlowId,
@@ -76,7 +78,8 @@ public RequestCopyWorkflow(String userName,
7678
Long targetProjectId,
7779
String nodeSuffix,
7880
String newFlowName,
79-
List<String> enableNodeList) {
81+
List<String> enableNodeList,
82+
String flowProxyUser) {
8083

8184
this.userName = userName;
8285
this.workspace = workspace;
@@ -90,6 +93,7 @@ public RequestCopyWorkflow(String userName,
9093
this.nodeSuffix = nodeSuffix;
9194
this.newFlowName = newFlowName;
9295
this.enableNodeList = enableNodeList;
96+
this.flowProxyUser = flowProxyUser;
9397

9498
}
9599

@@ -188,4 +192,12 @@ public List<String> getEnableNodeList() {
188192
public void setEnableNodeList(List<String> enableNodeList) {
189193
this.enableNodeList = enableNodeList;
190194
}
195+
196+
public String getFlowProxyUser() {
197+
return flowProxyUser;
198+
}
199+
200+
public void setFlowProxyUser(String flowProxyUser) {
201+
this.flowProxyUser = flowProxyUser;
202+
}
191203
}

dss-orchestrator/orchestrators/dss-workflow/dss-workflow-server/src/main/java/com/webank/wedatasphere/dss/workflow/DefaultWorkFlowManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,11 @@ public DSSFlow createWorkflow(String userName,
164164
public DSSFlow copyRootFlowWithSubFlows(String userName, Long rootFlowId, Workspace workspace,
165165
String projectName, String contextIdStr, String orcVersion,
166166
String description, List<DSSLabel> dssLabels, String nodeSuffix,
167-
String newFlowName, Long newProjectId,List<String> enableNodeList) throws DSSErrorException, IOException {
167+
String newFlowName, Long newProjectId,List<String> enableNodeList,
168+
String flowProxyUser) throws DSSErrorException, IOException {
168169
return flowService.copyRootFlow(rootFlowId, userName, workspace, projectName,
169170
orcVersion, contextIdStr, description, dssLabels, nodeSuffix, newFlowName, newProjectId,
170-
enableNodeList);
171+
enableNodeList,flowProxyUser);
171172
}
172173

173174
@Override

0 commit comments

Comments
 (0)