2021-07-14 17:15:03 +02:00
|
|
|
{
|
|
|
|
"ownerApp" : "Orchestrator",
|
|
|
|
"name" : "da_cache_to_shub",
|
|
|
|
"createBy" : "Marco Lettere",
|
|
|
|
"description": "Workflow for streaming da_cache files to storage hub",
|
|
|
|
"version" : 1,
|
|
|
|
"ownerEmail" : "marco.lettere@nubisware.com",
|
|
|
|
"inputParameters" : ["token", "descriptor"],
|
|
|
|
"tasks" : [
|
|
|
|
{
|
2021-07-16 10:46:36 +02:00
|
|
|
"name": "LAMBDA_TASK",
|
|
|
|
"taskReferenceName": "build_transfer_tasks",
|
|
|
|
"type": "LAMBDA",
|
|
|
|
"inputParameters": {
|
2021-07-16 11:21:55 +02:00
|
|
|
"downloads" : "${workflow.input.descriptor.downloads.*}",
|
2021-07-16 10:46:36 +02:00
|
|
|
"upload" : "https://workspace-repository.dev.d4science.org/storagehub/workspace/items/68e30cd7-8728-429e-9a98-50039e309095/create/FILE",
|
|
|
|
"auth" : "Bearer ${workflow.input.token}",
|
|
|
|
"description" : "${workflow.input.descriptor.order_name}",
|
2021-07-16 11:21:55 +02:00
|
|
|
"scriptExpression": "inputs={};tasks=[];for(var i=0;i<$.downloads.length;i++)download=$.downloads[i],tasks.push({name:'pyrestbridge',type:'SIMPLE',taskReferenceName:'bridge_'+i}),inputs['bridge_'+i]={ datamap : { place: 'files', name : 'file'}, endpoint1 : { url: download.url}, endpoint2 : { url: $.upload, headers: { Authorization : $.auth}, files: { name : 'file' + download.number, description : $.description[0]}} };return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};"
|
2021-07-16 10:46:36 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name" : "fork_dynamic",
|
|
|
|
"type" : "FORK_JOIN_DYNAMIC",
|
|
|
|
"taskReferenceName" : "parallel_downloads",
|
|
|
|
"inputParameters" : {
|
|
|
|
"tasks" : "${build_transfer_tasks.output.result.tasks}",
|
|
|
|
"inputs" : "${build_transfer_tasks.output.result.inputs}"
|
|
|
|
},
|
|
|
|
"dynamicForkTasksParam": "tasks",
|
|
|
|
"dynamicForkTasksInputParamName": "inputs"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name" : "join",
|
|
|
|
"type" : "JOIN",
|
|
|
|
"taskReferenceName" : "join_parallel_downloads"
|
2021-07-14 17:15:03 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|