-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: funman taskrunner api plumbing (#3411)
- Loading branch information
Showing
4 changed files
with
134 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...c/main/java/software/uncharted/terarium/hmiserver/controller/funman/FunmanController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
.../java/software/uncharted/terarium/hmiserver/service/tasks/ValidateModelConfigHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package software.uncharted.terarium.hmiserver.service.tasks; | ||
|
||
import java.util.UUID; | ||
import lombok.Data; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Component; | ||
import software.uncharted.terarium.hmiserver.models.task.TaskResponse; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
@Slf4j | ||
public class ValidateModelConfigHandler extends TaskResponseHandler { | ||
public static final String NAME = "funman_task:validate_modelconfig"; | ||
|
||
@Override | ||
public String getName() { | ||
return NAME; | ||
} | ||
|
||
@Data | ||
public static class Properties { | ||
UUID simulationId; | ||
} | ||
|
||
@Override | ||
public TaskResponse onSuccess(final TaskResponse resp) { | ||
try { | ||
final Properties props = resp.getAdditionalProperties(Properties.class); | ||
final UUID simulationId = props.getSimulationId(); | ||
|
||
// TODO: | ||
// - Retrive final result json | ||
// - Upload final result into S3 | ||
// - Mark simulation as completed, update result file | ||
System.out.println(""); | ||
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " + simulationId.toString()); | ||
System.out.println(""); | ||
} catch (final Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
return resp; | ||
} | ||
} |