Created
August 15, 2022 20:36
-
-
Save S0PEX/138e7331f1c552a2076b8df60a9b89de to your computer and use it in GitHub Desktop.
Argo Workflow with wolume claim
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
const workflow: HttpWorkflowsArgoprojIoWorkflowsJson = { | |
metadata: { | |
name: `${pipelineSchema.title.replace(/\s/g, '-').toLowerCase()}-${id}`, | |
namespace: 'default', | |
labels: { | |
id, | |
}, | |
}, | |
spec: { | |
entrypoint: 'workflow', | |
volumeClaimTemplates: [ | |
{ | |
metadata: { name: 'workdir' }, | |
spec: { | |
accessModes: ['ReadWriteOnce'], | |
resources: { | |
requests: { | |
storage: '100Gi', | |
}, | |
}, | |
}, | |
}, | |
], | |
templates: [ | |
...pipelineSchema.steps.map(({ image, commands }, index) => ({ | |
name: index.toString(), | |
script: { | |
image, | |
env: [{ name: 'workdir', value: '/mnt/share/' }], | |
volumeMounts: [ | |
{ | |
name: 'workdir', | |
mountPath: '/mnt/share', | |
}, | |
], | |
command: ['bash'], | |
source: commands.join(';'), | |
}, | |
/*outputs: { | |
artifacts: [ | |
{ | |
name: 'Output', | |
path: '/xyz', | |
url: https://mywebhdfsprovider.com/webhdfs/v1/file.txt?op=CREATE&overwrite=true | |
}, | |
], | |
},*/ | |
})), | |
{ | |
name: 'workflow', | |
steps: [ | |
Array.from({ length: pipelineSchema.steps.length }, (_x, i) => ({ | |
name: `${id}-step-${i}`, | |
template: `${i}`, | |
})), | |
], | |
}, | |
], | |
ttlStrategy: { | |
secondsAfterCompletion: 200, | |
}, | |
podGC: { | |
strategy: PodGcStrategies.OnWorkflowSuccess, | |
}, | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment