Skip to content

Commit

Permalink
repo-sync-2024-12-31T11:33:59+0800
Browse files Browse the repository at this point in the history
  • Loading branch information
chuzheng59176 committed Dec 31, 2024
1 parent 2d256b0 commit 7d23cbc
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions scripts/update-sf-components.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ COMP_TRANSLATION_FILE="sf_comp_translation.json"

function parse_sf_image_labels() {
echo "=> => parse secretflow image labels"
comp_list=$(docker inspect -f '{{ index .Config.Labels "kuscia.secretflow.comp_list" }}' ${SF_IMAGE})
comp_translation=$(docker inspect -f '{{ index .Config.Labels "kuscia.secretflow.translation" }}' ${SF_IMAGE})
comp_list=$(docker run --rm "${SF_IMAGE}" secretflow component inspect -a)
comp_translation=$(docker run --rm "${SF_IMAGE}" secretflow component get_translation)

if [[ comp_list == "" ]]; then
echo "=> => => label kuscia.secretflow.comp_list can't be empty in sf image"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public class ComponentConstants {

public static final String DATA_PREP_UNION = "data_prep/union";

public static final String DATA_FILTER_SAMPLE = "data_filter/sample";

public static final String DATA_FILTER_EXPR_CONDITION_FILTER = "data_filter/expr_condition_filter";

public static final String STATS_SCQL_ANALYSIS = "stats/scql_analysis";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@
import java.util.*;
import java.util.stream.Collectors;

import static org.secretflow.secretpad.common.constant.ComponentConstants.DATA_FILTER_EXPR_CONDITION_FILTER;
import static org.secretflow.secretpad.common.constant.ComponentConstants.DATA_PREP_UNION;
import static org.secretflow.secretpad.common.constant.ComponentConstants.*;
import static org.secretflow.secretpad.common.constant.Constants.*;

/**
Expand Down Expand Up @@ -162,7 +161,9 @@ public static String removeContentAfterUnderscore(String str, Map<String, Job.Ta
}
}

/** merge process in extra info **/
/**
* merge process in extra info
**/
public static ProjectTaskDO.ExtraInfo mergeExtraInfo(Job.TaskStatus taskStatus, ProjectTaskDO.ExtraInfo extraInfo) {

if (taskStatus == null || taskStatus.getProgress() <= 0.0f) {
Expand All @@ -180,9 +181,6 @@ public static ProjectTaskDO.ExtraInfo mergeExtraInfo(Job.TaskStatus taskStatus,
}





public static Job.TaskStatus mergeKusciaTaskStatus(String rawTaskId, String taskId, Map<String, Job.TaskStatus> map, Job.TaskStatus kusciaTaskStatus) {
Job.TaskStatus.Builder builder = kusciaTaskStatus.toBuilder();
GraphNodeTaskStatus rawGraphNodeTaskStatus = GraphNodeTaskStatus.formKusciaTaskStatus(kusciaTaskStatus.getState());
Expand Down Expand Up @@ -564,7 +562,7 @@ public ProjectJobDO updateJob(Job.WatchJobEventResponse it, ProjectJobDO project
}
task.setStatus(GraphNodeTaskStatus.formKusciaTaskStatus(kusciaTaskStatus.getState()));
task.setErrMsg(kusciaTaskStatus.getErrMsg());
task.setExtraInfo(mergeExtraInfo(kusciaTaskStatus,task.getExtraInfo()));
task.setExtraInfo(mergeExtraInfo(kusciaTaskStatus, task.getExtraInfo()));
syncResult(task);
}
);
Expand Down Expand Up @@ -765,7 +763,9 @@ private boolean syncModelExportJob(Job.WatchJobEventResponse it) {

private void createDomainGrantByUnion(ProjectTaskDO taskDO, String domainDataId) {
String codeName = taskDO.getGraphNode().getCodeName();
if (!DATA_PREP_UNION.equalsIgnoreCase(codeName) && !DATA_FILTER_EXPR_CONDITION_FILTER.equalsIgnoreCase(codeName)) {
if (!DATA_PREP_UNION.equalsIgnoreCase(codeName) && !DATA_FILTER_EXPR_CONDITION_FILTER.equalsIgnoreCase(codeName)
&& !DATA_FILTER_SAMPLE.equalsIgnoreCase(codeName)
) {
return;
}
// Only one node and a union need to create a domain grant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package org.secretflow.secretpad.persistence.repository;

import org.secretflow.secretpad.common.enums.ScheduledStatus;
import org.secretflow.secretpad.persistence.entity.ProjectScheduleDO;

import org.springframework.data.jpa.repository.Modifying;
Expand All @@ -35,5 +34,5 @@ public interface ProjectScheduleRepository extends BaseRepository<ProjectSchedul
@Modifying
@Transactional
@Query(value = "update project_schedule set status = :status where schedule_id = :scheduleId and is_deleted = 0", nativeQuery = true)
void updateStatusByScheduleId(String scheduleId, ScheduledStatus status);
void updateStatusByScheduleId(String scheduleId, String status);
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ public interface ProjectScheduleTaskRepository extends BaseRepository<ProjectSch
@Transactional
@Query(value = "update project_schedule_task set status = :status where schedule_task_id = :scheduleTaskId and is_deleted = 0",
nativeQuery = true)
void updateStatus(String scheduleTaskId, ScheduledStatus status);
void updateStatus(String scheduleTaskId, String status);
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected void executeInternal(JobExecutionContext context) {
} catch (Exception e) {
log.error("SecretpadJob execute error", e);
if (ObjectUtils.isNotEmpty(o)) {
projectScheduleTaskRepository.updateStatus(o.getScheduleTaskId(), ScheduledStatus.FAILED);
projectScheduleTaskRepository.updateStatus(o.getScheduleTaskId(), ScheduledStatus.FAILED.name());
}
}
applicationEventPublisher.publishEvent(new ScheduledJobStartEvent(this, context));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ public GraphNodeOutputVO getResultOutputVO(String nodeId, String resultId) {
GraphNodeOutputVO.OutputResult outputResult;
switch (resultKind) {
case Report:
return getGraphNodeOutputVO(projectId, centerNodeId, outputVO);
return getGraphNodeOutputVO(projectId, centerResultId, outputVO);
case Model:
case Rule:
outputResult = GraphNodeOutputVO.OutputResult.builder().nodeId(centerNodeId).path(centerResultId).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public void offline(ScheduledOfflineRequest request) {
}
checkOwner(projectScheduleDO.getOwner());
secretpadScheduledService.pauseScheduler(request.getScheduleId());
projectScheduleRepository.updateStatusByScheduleId(request.getScheduleId(), ScheduledStatus.DOWN);
projectScheduleRepository.updateStatusByScheduleId(request.getScheduleId(), ScheduledStatus.DOWN.name());
}

@Override
Expand Down Expand Up @@ -347,7 +347,7 @@ public void taskStop(TaskStopScheduledRequest request) {
job.stop();
projectScheduleJobRepository.save(job);
kusciaGrpcClientAdapter.stopJob(Job.StopJobRequest.newBuilder().setJobId(job.getUpk().getJobId()).build());
projectScheduleTaskRepository.updateStatus(request.getScheduleTaskId(), ScheduledStatus.STOPPING);
projectScheduleTaskRepository.updateStatus(request.getScheduleTaskId(), ScheduledStatus.STOPPING.name());
} else {
log.error("taskStop, schedule task status is not running, scheduleTaskId:{}", projectScheduleTaskDO.getScheduleTaskId());
throw SecretpadException.of(ScheduledErrorCode.SCHEDULE_TASK_STATUS_NOT_RUNNING, projectScheduleTaskDO.getStatus().name());
Expand Down

0 comments on commit 7d23cbc

Please sign in to comment.