This repository was archived by the owner on Feb 26, 2025. It is now read-only.
File tree 7 files changed +64
-1
lines changed
7 files changed +64
-1
lines changed Original file line number Diff line number Diff line change 1
1
.git
2
2
.tox
3
+ venv /
Original file line number Diff line number Diff line change 7
7
dist /
8
8
doc /build
9
9
doc /source /generated
10
+ venv /
10
11
.tox
Original file line number Diff line number Diff line change 1
- .PHONY : help python_build docker_build_latest run
1
+ .PHONY : help python_build docker_build_latest run install_to_venv
2
2
3
3
IMAGE_NAME? =bbp-workflow
4
4
@@ -23,3 +23,10 @@ docker_build_latest: # python_build
23
23
24
24
run :
25
25
docker run -it --rm --user $$(id -u ) -e DEBUG=True $(IMAGE_NAME )
26
+
27
+ venv :
28
+ if python -m ensurepip --version; then python -m venv $@ ; else virtualenv $@ ; fi
29
+ venv/bin/pip install --upgrade pip
30
+
31
+ install_to_venv : | venv
32
+ venv/bin/pip install --upgrade bbp-workflow
Original file line number Diff line number Diff line change 27
27
pip install tox
28
28
tox
29
29
30
+ Local Run
31
+ =========
32
+
33
+ .. code-block :: bash
34
+
35
+ make install_to_venv
36
+ ./bbp-workflow-launch.sh --config workflows/foo.cfg foo Bar dynamic-param=world
37
+
30
38
Acknowledgements
31
39
================
32
40
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+ source venv/bin/activate
4
+
5
+ WORKFLOWS_DIR=$( realpath workflows)
6
+ if [[ $1 == ' --workflows-dir' ]]; then
7
+ WORKFLOWS_DIR=$( realpath " $2 " )
8
+ shift ; shift
9
+ fi
10
+
11
+ if [[ $1 == ' --config' ]]; then
12
+ export LUIGI_CONFIG_PATH=$( realpath " $2 " )
13
+ shift ; shift
14
+ fi
15
+
16
+ export PYTHONPATH=$WORKFLOWS_DIR
17
+
18
+ if [[ " $1 " ]]; then
19
+ MODULE=$1 ; shift
20
+ else
21
+ echo " No module provided!" ; exit 1
22
+ fi
23
+ if [[ " $1 " ]]; then
24
+ TASK=$1 ; shift
25
+ else
26
+ echo " No task provided!" ; exit 1
27
+ fi
28
+ echo LUIGI_CONFIG_PATH=$LUIGI_CONFIG_PATH
29
+ echo PYTHONPATH=$PYTHONPATH
30
+ for i in " $@ " ; do
31
+ PARAMS=" $PARAMS --${i% =* } ${i#* =} "
32
+ done
33
+
34
+ cd $WORKFLOWS_DIR
35
+ luigi --local-scheduler --module $MODULE $TASK$PARAMS
36
+ echo " exit: $? "
Original file line number Diff line number Diff line change
1
+ [Bar]
2
+ static-param: hello
Original file line number Diff line number Diff line change
1
+ from luigi import Task , Parameter
2
+
3
+
4
+ class Bar (Task ):
5
+ static_param = Parameter ()
6
+ dynamic_param = Parameter ()
7
+ def run (self ):
8
+ print (f"\n >>> { self .static_param } { self .dynamic_param } ! <<<\n " , flush = True )
You can’t perform that action at this time.
0 commit comments