Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…oard into develop-2.0.0
  • Loading branch information
idwenwen committed Dec 6, 2023
2 parents cd92f5e + 34488cc commit 77b84c2
Show file tree
Hide file tree
Showing 8 changed files with 587 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ public ResponseResult getDetailInfo(@Valid @RequestBody ComponentQueryDTO compon
paramMap.put(Dict.JOBID, componentQueryDTO.getJob_id() );
paramMap.put(Dict.TASK_ID, taskId);

//todo
String result = null;
try {
result = flowFeign.get(Dict.URL_TASK_DATAVIEW,paramMap);
Expand All @@ -168,14 +167,38 @@ public ResponseResult getDetailInfo(@Valid @RequestBody ComponentQueryDTO compon
}
JSONObject resultObject = JSON.parseObject(result);
Integer retcode = resultObject.getInteger(Dict.CODE);
String msg = resultObject.getString(Dict.REMOTE_RETURN_MSG);

// JSONObject data = resultObject.getJSONObject(Dict.DATA);
String msg = resultObject.getString(Dict.RETMSG);

JSONObject detail = (JSONObject)resultObject.getJSONArray(Dict.DATA).get(0);
JSONObject newData = detail.getJSONObject(Dict.COMPONENT_PARAMETERS);

// String dataWithNull = JSON.toJSONString(data, SerializerFeature.WriteMapNullValue);
if (newData != null) {
JSONObject conf = newData.getJSONObject("conf");
if (conf != null) {
JSONObject federation = conf.getJSONObject("federation");
if (federation != null) {
JSONObject metadata = federation.getJSONObject("metadata");
if (metadata != null) {
JSONObject rollSiteConfig = metadata.getJSONObject("rollsite_config");
if (rollSiteConfig != null) {
String host = rollSiteConfig.getString("host");
if (null != host) {
newData.getJSONObject("conf").getJSONObject("federation").getJSONObject("metadata").getJSONObject("rollsite_config").put("host","xxx.xxx.xxx.xxx");
}
}
}
}
}
JSONObject mlmd = newData.getJSONObject("mlmd");
if (null != mlmd) {
JSONObject metadata = mlmd.getJSONObject("metadata");
if (null != metadata) {
String host = metadata.getString("host");
newData.getJSONObject("mlmd").getJSONObject("metadata").put("host","xxx.xxx.xxx.xxx");
}
}
}

String dataWithNull = JSON.toJSONString(newData, SerializerFeature.WriteMapNullValue);

return new ResponseResult<>(retcode, msg, dataWithNull);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public ResponseResult updateJobById(@Valid @RequestBody UpdateNotesDTO updateNot
}

Preconditions.checkArgument(LogFileService.checkPathParameters(updateNotesDTO.getJob_id(), updateNotesDTO.getRole(), updateNotesDTO.getParty_id()));
Preconditions.checkArgument(LogFileService.checkParameters("^[0-9a-zA-Z\\-_\\u4e00-\\u9fa5\\s]+$", updateNotesDTO.getNotes()));
Preconditions.checkArgument(LogFileService.checkParameters("^[0-9a-zA-Z,.。\\-_\\u4e00-\\u9fa5\\s]+$", updateNotesDTO.getNotes()));

String result;
try {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/fedai/fate/board/global/Dict.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public class Dict {
static public final String JOB_PROCESS = "process";
static public final String JOB_DURATION = "duration";
static public final String JOB_STATUS = "status";
static public final String REMOTE_RETURN_MSG = "retmsg";

static public final String URL_COPONENT_METRIC_DATA = "/v2/output/metric/key/query";
static public final String URL_COPONENT_METRIC = "/v2/output/metric/query";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,10 @@ public class JobDetailService {
@Value("${fateflow.url}")
String fateUrl;

@Value("${component.config.dir}")
String componentConfigPath;


public String getComponentStaticInfo(String componentName) throws Exception {
String projectDir = System.getProperty("user.dir");
String jsonData = "";
String yamlFilePath = componentConfigPath + File.separator + componentName + ".yaml";
String yamlFilePath = projectDir + File.separator + "dag" + File.separator +componentName + ".yaml";
File file = new File(yamlFilePath);
if (!file.exists()) {
logger.error("no this file find: {} ", yamlFilePath);
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ server.servlet.session.cookie.max-age=4h
management.endpoints.web.exposure.exclude=*
feign.client.config.default.connectTimeout=10000
feign.client.config.default.readTimeout=10000
component.config.dir=/data/projects/fate/fateboard/dag
155 changes: 155 additions & 0 deletions static/hetero_nn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
component:
name: hetero_nn
description: ''
provider: fate
version: 2.0.0-beta
labels: []
roles:
- guest
- host
parameters:
runner_module:
type: str
default: hetero_default_runner
optional: true
description: name of your runner script
type_meta:
title: str
type: string
default:
description: path to your runner script folder
runner_class:
type: str
default: DefaultRunner
optional: true
description: class name of your runner class
type_meta:
title: str
type: string
default:
description: path to your runner script folder
runner_conf:
type: dict
default: {}
optional: true
description: the parameter dict of the NN runner class
type_meta:
title: dict
type: object
default: {}
description: the parameter dict of the NN runner class
source:
type: str
default:
optional: true
description: path to your runner script folder
type_meta:
title: str
type: string
default:
description: path to your runner script folder
input_artifacts:
data:
train_data:
types:
- dataframe
optional: false
stages:
- train
roles:
- guest
- host
description: ''
is_multi: false
validate_data:
types:
- dataframe
optional: true
stages:
- train
roles:
- guest
- host
description: ''
is_multi: false
test_data:
types:
- dataframe
optional: false
stages:
- predict
roles:
- guest
- host
description: ''
is_multi: false
model:
train_model_input:
types:
- model_directory
optional: true
stages:
- train
roles:
- guest
- host
description: ''
is_multi: false
predict_model_input:
types:
- model_directory
optional: false
stages:
- predict
roles:
- guest
- host
description: ''
is_multi: false
output_artifacts:
data:
train_data_output:
types:
- dataframe
optional: true
stages:
- train
roles:
- guest
- host
description: ''
is_multi: false
predict_data_output:
types:
- dataframe
optional: true
stages:
- predict
roles:
- guest
- host
description: ''
is_multi: false
model:
train_model_output:
types:
- model_directory
optional: true
stages:
- train
roles:
- guest
- host
description: ''
is_multi: false
metric:
metric:
types:
- json_metric
optional: false
stages: []
roles: []
description: metric, invisible for user
is_multi: false
schema_version: v1

Loading

0 comments on commit 77b84c2

Please sign in to comment.