Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some more docs / comments relating to taskrunner #2978

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public void testItCanSendMiraSBMLToPetrinetRequest() throws Exception {

final TaskRequest req = new TaskRequest();
req.setType(TaskType.MIRA);
req.setScript("miar_task:sbml_to_petrinet");
req.setScript("mira_task:sbml_to_petrinet");
kbirk marked this conversation as resolved.
Show resolved Hide resolved
req.setInput(content.getBytes());

final TaskResponse resp = taskService.runTaskSync(req);
Expand Down
36 changes: 36 additions & 0 deletions packages/taskrunner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,42 @@ the `taskrunner` to the `hmi-server`. Use existing tasks as a tempalte for how t
- Merge the changes into the `main` branch of [GoLLM](https://github.com/DARPA-ASKEM/GoLLM/tree/main/tasks)
- Publish a new `gollm-taskrunner` docker image.

# Adding tasks to the `MIRA Taskrunner` from [MIRA](https://github.com/DARPA-ASKEM/terarium/packages/mira):

- The `TaskRunnerInterface` class provides everything necessary for getting input into the task and output back through
the `taskrunner` to the `hmi-server`. Use existing tasks as a tempalte for how this is done.
YohannParis marked this conversation as resolved.
Show resolved Hide resolved
- Add the `task_name.py` to the `tasks` directory in [MIRA](https://github.com/DARPA-ASKEM/terarium/packages/mira/tasks)
- Publish a new `mira-taskrunner` docker image.

# Local Development:

In the `docker-compose-taskrunner.yml` volume mount your local task code:

GoLLM task volume mounting:
```
volumes:
- ../GoLLM:/GoLLM
```

Mira task volume mounting:
```
volumes:
- ./packages/mira:/mira_task
```

Then exec into the container:

```
docker exec -it {IMAGE_TAG} /bin/bash
```

On code changes, re-install the tasks:

```
pip install -e
```


# Building docker image:

From `terarium` root:
Expand Down
3 changes: 3 additions & 0 deletions packages/taskrunner/docker/Dockerfile.GoLLM
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ RUN wget -O gollm.tar.gz https://github.com/DARPA-ASKEM/GoLLM/archive/refs/heads

WORKDIR /GoLLM

# Install GoLLM deps
RUN pip install --no-cache-dir -r requirements.txt

# Install the tasks for GoLLM
RUN pip install -e .

WORKDIR /
Expand Down
4 changes: 3 additions & 1 deletion packages/taskrunner/docker/Dockerfile.Mira
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ COPY --from=taskrunner_builder /taskrunner/build/libs/*.jar /taskrunner.jar
COPY ./packages/taskrunner/src/test/resources/echo.py /echo.py

# Install Mira
RUN echo "Cache bust so we can always pull latest Mira" $(date -u)
RUN echo "Cache bust so we can always pull latest MIRA" $(date -u)
RUN wget -O mira.tar.gz https://github.com/gyorilab/mira/archive/refs/heads/main.tar.gz && \
tar -zxvf mira.tar.gz && \
mv mira-* mira && \
Expand All @@ -37,6 +37,8 @@ RUN wget -O mira.tar.gz https://github.com/gyorilab/mira/archive/refs/heads/main
# Copy the Mira Conversion package
COPY ./packages/mira /mira_task
WORKDIR /mira_task

# Install the tasks for mira
RUN pip install -e .

WORKDIR /
Expand Down
Loading