Open leo-schick opened 2 years ago
the BashExecutionContext
and SshBashExecutionContext
works, but logging should be optimized
local_config.py
from mara_pipelines.contexts.bash import BashExecutionContext, SshBashExecutionContext
patch(mara_pipelines.config.execution_contexts)(lambda: {
'bash': BashExecutionContext(),
'srv-mara-2': SshBashExecutionContext(
host='srv-mara-2'
),
})
test.py
from mara_pipelines.pipelines import Pipeline, Task
from mara_pipelines.commands.bash import RunBash
test_pipeline = Pipeline(
id='test',
description="",
context='srv-mara-2')
test_pipeline.add(
Task(id='ls',
description="",
commands=[
RunBash('ls -l')
]))
test_pipeline.add(
Task(id='ls2',
description="",
commands=[
RunBash('ls -l .venv')
],
context='bash'),
upstreams=['ls'])
print
, see mara_pipelines.execution.py
__enter__
Currently known issue: when a execution context is used which is not defined in the configuration the pipeline execution does not throw any message and just hangs
In WIP feature discussion in #68