On the direction of the unix step #2226
Replies: 10 comments
-
Embrace unix <pedantry alert>Linux is not Unix</pedantry> The distinction is not important, but I'm commenting on every headline so why not be pedantic. Linux is not Unix certified, so... We're technically talking about POSIX steps. (Imagine we called it a The commands run: python -c "print('hello')" or, for multiline (YAML feature, not something we implement) run: |
echo -e "#!/usr/bin/env python3\nprint('hello')" > my_script
chmod +x my_script
./my_script All such pipeline tools that I know of run the commands in shell mode. As if Take inspiration from Github Actions. They also call this a "step": https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idsteps Transportable commands Script environment While we can't use docker today, I think we should have separation of environments at a very high priority. We could also add a - name: komodo+pytest
image: komodo-py36:stable
addons:
- pytest
env:
AWESOME: "yes" Then they can use it in their code: image: komodo+pytest
run: |
which pytest
echo $AWESOME (The fact that |
Beta Was this translation helpful? Give feedback.
-
On the name The script Environment |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@berland brought up the topic of passing parameter values to a script via the command line. I'm tempted to avoid rendering the scripts if we can, as it potentially blows up the complexity of configuration, parsing configuration and the interaction between the client and compute quite a lot. But, for the unix step it would be natural to be able to pass environment variables that are to be set for the execution. Perhaps something along the lines of:
could be a good solution? |
Beta Was this translation helpful? Give feedback.
-
That could work |
Beta Was this translation helpful? Give feedback.
-
Why populate the environment with something that's just discarded?
|
Beta Was this translation helpful? Give feedback.
-
What do you mean by discarded @jondequinor? |
Beta Was this translation helpful? Give feedback.
-
Another way to say it, why contaminate the process of |
Beta Was this translation helpful? Give feedback.
-
Sorry for the really late response @jondequinor! My thinking was that input to a We can of course also introduce a templating language on top of the script, but this adds some complexity as it then needs to be rendered for each of the realisations individually and it brings it further away from what would be standard usage of the shell. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
After getting some experience with the unix step while setting up the two examples currently in place I have some reflections I would like to share.
Embrace unix
The unix step feels the best, and gets the least in my way when it behaves as a shell script in a unix environment. Since we are now in a position of being able to provide multiple step types I think the unix step should be as true to the unix envision as possible.
The commands
It acts naturally as long as I'm using Python scripts as commands, but whenever I want to run some other type of script it becomes awkward. In the SPE1 example I ended up introducing a Python script named
bash
to be able to run bash commands by addingbash
as a prefix. I think this should be the default way of running the commands. So that I could write:and it will run without any hassle.
Transportable commands
Currently we offer to transport scripts to the compute side to run them. They are then dumped directly within the runpath folder. I think we should treat these in a more standard unix manner. My suggestion would be to create a natural
bin
location within the runpath for these scripts that we add toPATH
.Script environment
I think we should get a clear grip on how the compute environment of the unix step is formed. Maybe it is ok to assume that there is a read-only file system where the core environment is defined? Or do we want to be explicit about the entirety of the environment? But are we then closing in to making a container step? And at some point we want to run steps within a Komodo environment. Is that the unix step, a virtualenv like step or a komodoenv step?
Beta Was this translation helpful? Give feedback.
All reactions