Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ssa/workspaces
1 result
Show changes
...@@ -7,11 +7,10 @@ Then, back in services/workflow, run: ...@@ -7,11 +7,10 @@ Then, back in services/workflow, run:
`python setup.py develop` `python setup.py develop`
Then you should be able to run this with: Then you should be able to run this with:
`env CAPO_PROFILE=local pserve --reload development.ini` `env CAPO_PROFILE=local pserve --reload dev.ini`
Once there, try the following URLs: Once there, try the following URLs:
- http://0.0.0.0:3456/workflows/requests/94 - http://0.0.0.0:3456/workflows/requests/94
- http://0.0.0.0:3456/workflows - http://0.0.0.0:3456/workflows
- http://0.0.0.0:3456/workflows/0 - http://0.0.0.0:3456/workflows/0
...@@ -26,5 +26,9 @@ done ...@@ -26,5 +26,9 @@ done
# Return to base /code directory # Return to base /code directory
cd /code cd /code
# Start pserve normally # Start Pyramid server
pserve --reload development.ini if [ "${CAPO_PROFILE}" = "dsoc-prod" ]; then
pserve --reload prod.ini
else
pserve --reload dev.ini
fi
...@@ -16,7 +16,45 @@ pyramid.debug_routematch = false ...@@ -16,7 +16,45 @@ pyramid.debug_routematch = false
pyramid.default_locale_name = en pyramid.default_locale_name = en
pyramid.includes = pyramid_tm pyramid.includes = pyramid_tm
retry.attempts = 3
[server:main] [server:main]
use = egg:waitress#main use = egg:waitress#main
listen = 0.0.0.0:6543 listen = 0.0.0.0:3456
###
# logging configuration
# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html
###
[loggers]
keys = root, workflow, sqlalchemy
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = WARN
handlers = console
[logger_workflow]
level = WARN
handlers =
qualname = workflow
[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s
...@@ -25,7 +25,7 @@ class WorkflowInfo(WorkflowInfoIF): ...@@ -25,7 +25,7 @@ class WorkflowInfo(WorkflowInfoIF):
return self.session.query(Workflow).get(name) return self.session.query(Workflow).get(name)
def lookup_workflow_request(self, request_id: int) -> WorkflowRequest: def lookup_workflow_request(self, request_id: int) -> WorkflowRequest:
return self.session.query(WorkflowRequest).get(request_id) return self.session.query(WorkflowRequest).filter_by(workflow_request_id=request_id).first()
def lookup_workflow_templates_for(self, workflow_name: str) -> List[WorkflowTemplate]: def lookup_workflow_templates_for(self, workflow_name: str) -> List[WorkflowTemplate]:
""" """
...@@ -62,7 +62,7 @@ class WorkflowInfo(WorkflowInfoIF): ...@@ -62,7 +62,7 @@ class WorkflowInfo(WorkflowInfoIF):
# otherwise, the argument must be already be a string # otherwise, the argument must be already be a string
workflow_name = workflow.workflow_name if hasattr(workflow, "workflow_name") else workflow workflow_name = workflow.workflow_name if hasattr(workflow, "workflow_name") else workflow
if any(item in workflow_name for item in ["null", "download", "ingest"]): if any(item in workflow_name for item in ["null", "download"]):
argument["need_project_metadata"] = False argument["need_project_metadata"] = False
else: else:
argument["need_project_metadata"] = True argument["need_project_metadata"] = True
......
...@@ -262,6 +262,18 @@ class WorkflowService(WorkflowServiceIF): ...@@ -262,6 +262,18 @@ class WorkflowService(WorkflowServiceIF):
wrest_type = "-si" wrest_type = "-si"
argument = wf_request.argument["sdmId"] argument = wf_request.argument["sdmId"]
argument2 = [] argument2 = []
elif "ingest" in name:
wrest_type = "-aux"
parent_req = self.info.lookup_workflow_request(
wf_request.argument["parent_wf_request_id"]
)
eb = (
parent_req.argument["product_locator"]
if "product_locator" in parent_req.argument
else parent_req.argument["sdmId"]
)
argument = eb
argument2 = []
else: else:
logger.info(f"No wrester found for workflow {name}. Does it actually require metadata?") logger.info(f"No wrester found for workflow {name}. Does it actually require metadata?")
return wf_request return wf_request
......