Skip to content

Commit

Permalink
Merge pull request #178 from jmchilton/coexecutor
Browse files Browse the repository at this point in the history
Revisions to Kubernetes coexecution pods.
  • Loading branch information
jmchilton committed May 4, 2019
2 parents 6e713a2 + f2be4ce commit 0e7eb72
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docker/coexecutor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ RUN apt-get update \

RUN pip install -U pip && pip install wheel

ADD pulsar_app-0.9.0-py2.py3-none-any.whl /pulsar_app-0.9.0-py2.py3-none-any.whl
ADD pulsar_app-0.10.0.dev0-py2.py3-none-any.whl /pulsar_app-0.10.0.dev0-py2.py3-none-any.whl

RUN pip install /pulsar_app-0.9.0-py2.py3-none-any.whl
RUN pip install /pulsar_app-0.10.0.dev0-py2.py3-none-any.whl

RUN pip install kombu pykube poster
6 changes: 4 additions & 2 deletions pulsar/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
TOOL_EXECUTION_CONTAINER_COMMAND_TEMPLATE = """
path='%s/command_line';
while [ ! -e $path ];
do sleep 1; echo 'waiting for job script...';
do sleep 1; echo "waiting for job script $path";
done;
echo 'running script';
sh $path;
Expand Down Expand Up @@ -396,6 +396,8 @@ def launch(self, command_line, dependencies_description=None, env=[], remote_sta
{"mountPath": "/pulsar_staging", "name": "staging-directory"},
]
tool_container_image = container # TODO: this isn't right at all...
if not container:
raise Exception("Must declare a container for kubernetes job execution.")
pulsar_container_dict = {
"name": "pulsar-container",
"image": pulsar_container_image,
Expand All @@ -408,7 +410,7 @@ def launch(self, command_line, dependencies_description=None, env=[], remote_sta
tool_container_spec = {
"name": "tool-container",
"image": tool_container_image,
"command": ["bash"],
"command": ["sh"],
"args": ["-c", command],
"workingDir": "/",
"volumeMounts": volume_mounts,
Expand Down
3 changes: 1 addition & 2 deletions pulsar/managers/unqueued.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,9 @@ class CoexecutionManager(BaseUnqueuedManager):

def __init__(self, name, app, **kwds):
super(CoexecutionManager, self).__init__(name, app, **kwds)
self.singleton_job_id = "0"

def setup_job(self, input_job_id, tool_id, tool_version):
return self._setup_job_for_job_id(self.singleton_job_id, tool_id, tool_version)
return self._setup_job_for_job_id(input_job_id, tool_id, tool_version)

def get_status(self, job_id):
return self._get_status(job_id)
Expand Down
1 change: 0 additions & 1 deletion test/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ def test_integration_kubernetes(self):
k8s_enabled=True,
container="conda/miniconda2",
remote_pulsar_app_config=remote_pulsar_app_config,
job_id="0",
**self.default_kwargs
)

Expand Down
4 changes: 1 addition & 3 deletions test/manager_coexecution_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ def __init__(self, manager):
self.command_line = None

def monitor(self):
singleton_job_id = "0"

while not self.has_command_line:
try:
command_line = self.manager.read_command_line(singleton_job_id)
command_line = self.manager.read_command_line("123")
except (IOError, ValueError):
continue
if not command_line:
Expand Down

0 comments on commit 0e7eb72

Please sign in to comment.