Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link to postgres database with hibernate + import job on status succe… #137

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Samiasa
Copy link
Collaborator

@Samiasa Samiasa commented May 21, 2020

…eded

What does this PR do?

Link to Postgres database with JPA manager for argo workflow data storage
import succeeded jobs even if the whole workflow failed

Related issues

#86
@MyleneSimon

@MyleneSimon MyleneSimon added the feature New feature or request label May 26, 2020
@MyleneSimon MyleneSimon added this to the 3.0.0-RC1 milestone May 26, 2020
@@ -40,6 +40,7 @@
@Component
public class WorkflowConverter {
private Workflow workflow;
private gov.nist.itl.ssd.wipp.backend.argo.workflows.persistence.ArgoWorkflow argoWorkflow;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it used in this class?

Comment on lines +30 to +40
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
<scope>compile</scope>
</dependency>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why two versions?

Comment on lines +16 to +17
#spring.datasource.url= jdbc:postgresql://localhost:5432/postgres
spring.datasource.url= jdbc:postgresql://localhost:7000/postgres
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you create a new property in the pom to set the url?
Something like @postgres.url@ that in then set in the wipp-backend-application pom for both profiles

Comment on lines +101 to +110
JSONObject jsonWorkflow = new JSONObject(argoWorkflow.getWorkflow());
JSONObject jsonStatus = jsonWorkflow.getJSONObject("status");
JSONObject jsonNodes = jsonStatus.getJSONObject("nodes");
Iterator<String> keys = jsonNodes.keys();
while (keys.hasNext()){
String key = keys.next();
JSONObject job = jsonNodes.getJSONObject(key);

// check that the job is neither the DAG nor the exit handler
if (job.getString("type").equals("Pod") && !job.getString("templateName").equals("exit-handler")){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could map the object into actual java classes?
We could generate them using Swagger Codegen and the Argo OpenAPI spec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants