Commit 55c52ba7 authored by Wout De Nolf's avatar Wout De Nolf
Browse files

prepare demo

parent 1041c089
Pipeline #68726 failed with stages
in 3 minutes and 47 seconds
from dahu.plugin import Plugin
from dahu.factory import register
@register
class AddNumbers(Plugin):
def process(self):
self.output["sum"] = self.input["a"] + self.input["b"]
......@@ -9,5 +9,6 @@ class ExecuteGraph(Plugin):
kwargs = {
k: v for k, v in self.input.items() if k not in ("job_id", "plugin_name")
}
kwargs["execinfo"] = {"job_id": self.input.job_id}
execute_graph(**kwargs)
# self.output["result"] = ...
......@@ -12,7 +12,7 @@ function main {
# install dahu
local dahu_source=$HOME/dev/dahu
find $dahu_source| grep -E "(__pycache__|\.pyc|\.pyo|\.egg-info$)" | xargs rm -rf
python -m pip install -e $dahu_source
python -m pip install $dahu_source # NO DEV INSTALLATION!
# install the demo project
python -m pip install -e $SCRIPT_ROOT/..
......
python=3.8
pytango
numpy
# dev:
black
flake8
pytest
\ No newline at end of file
import json
from time import sleep
from tango import DeviceProxy
from ewokscore.tests.examples.graphs import get_graph
plugin = "workflow.executegraph"
workflow, _ = get_graph("acyclic1")
varinfo = {"root_uri": "results"}
kwargs = {"graph": workflow, "binding": None, "varinfo": varinfo}
plugin = "math.addnumbers"
kwargs = {"a": 1, "b": 2}
proxy = DeviceProxy("tango://localhost:10000/id00/dahu/1")
pid = proxy.startJob([plugin, json.dumps(kwargs)])
......
#!/bin/bash
SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${SCRIPT_ROOT}/utils.sh
function main {
source $(conda_root)/bin/activate $(conda_env)
python ${SCRIPT_ROOT}/run.py
}
main
\ No newline at end of file
import json
from time import sleep
from tango import DeviceProxy
from ewokscore.tests.examples.graphs import get_graph
plugin = "workflow.executegraph"
workflow, _ = get_graph("acyclic1")
varinfo = {"root_uri": "results"}
kwargs = {"graph": workflow, "binding": None, "varinfo": varinfo}
proxy = DeviceProxy("tango://localhost:10000/id00/dahu/1")
pid = proxy.startJob([plugin, json.dumps(kwargs)])
while proxy.getJobState(pid) == "starting":
sleep(0.01)
proxy.waitJob(pid)
print("Output: %s" % proxy.getJobOutput(pid))
#!/bin/bash
export TANGO_HOST=localhost:10000
export DAHU_PLUGINS=$(python -c "from dahu_demo import plugins;print(plugins.__path__[0])")
dahu-register --instance dahu
dahu-server dahu -v3
SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${SCRIPT_ROOT}/utils.sh
function main {
source $(conda_root)/bin/activate $(conda_env)
export TANGO_HOST=localhost:10000
export DAHU_PLUGINS=$(python -c "from dahu_demo import plugins;print(plugins.__path__[0])")
dahu-register --instance dahu --member 1
dahu-server dahu -v3
}
main
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment