-
The script example is a bit simplistic - I'm curious of recommendations where I need to modify the OS and the Python libraries before the script is executed. Below is a snippet of my attempt as an example, but it doesn't seem to take in the actual 'source'. What would be better approach? (I've also posted this in slack argo-workflows.) script:
name: main
image: 'python:3'
command:
- sh
- '-c'
args:
- >-
apk add git gcc libc-dev && python -m pip install -r /work/requirements.txt && python
source: |
import os
key = 'MY_ENV_VAR'
value1 = os.getEnv(key)
print( "Got my env: ", value |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
In chatting in slack - it was noted I'm combining the script and container template syntax ... My issue may more reside in my attempt to combine them. It was suggested by @mac9416 that instead I use a shell script to embed the needed python code instead. |
Beta Was this translation helpful? Give feedback.
-
It might be better to build a new image based on the python3 image with the additional dependencies pre-installed before running your Python script. |
Beta Was this translation helpful? Give feedback.
In chatting in slack - it was noted I'm combining the script and container template syntax ... My issue may more reside in my attempt to combine them. It was suggested by @mac9416 that instead I use a shell script to embed the needed python code instead.