Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ab2964d
added scoring model
uhbrar Feb 23, 2026
6167713
update worker requirements
uhbrar Feb 23, 2026
7eae783
add classifier weights
uhbrar Feb 23, 2026
f1d0f34
Update pathfinder predicates
maximusunc Feb 21, 2026
6373d84
Update Gandalf and gc
maximusunc Feb 21, 2026
c5d23e7
Bump patch version
maximusunc Feb 21, 2026
46556c2
make scoring model work in docker
uhbrar Feb 24, 2026
092b5b1
use gpu for embedding
uhbrar Feb 24, 2026
16a095f
update predicates
uhbrar Feb 24, 2026
495cdb7
respect timeout
uhbrar Feb 24, 2026
469e70c
Merge branch 'main' into scoring_model
uhbrar Feb 24, 2026
4af90ea
handle no paths
uhbrar Feb 24, 2026
a44ccd3
add gandalf folder to gitignore
uhbrar Feb 24, 2026
d0bdbc4
make gpu optional
uhbrar Feb 25, 2026
2996ee5
fix vram persistence
uhbrar Feb 27, 2026
7e36023
address pr comments
uhbrar Mar 5, 2026
8bd48bc
remove extra logging
uhbrar Mar 5, 2026
a027551
styling
uhbrar Mar 5, 2026
fedb9c2
fix analysis indexing
uhbrar Mar 5, 2026
0e9cc63
use threadpoolexecutor with lock
uhbrar Mar 11, 2026
25b5313
add error handling
uhbrar Mar 11, 2026
56e4ee8
Merge branch 'main' into scoring_model
uhbrar Mar 12, 2026
c0af0fd
Update scorer to main updates and fix some linting
maximusunc Mar 12, 2026
2de5f7b
add checks for empty results
uhbrar Mar 12, 2026
dc4ed24
change task_limit
uhbrar Mar 12, 2026
09a0001
load model first
uhbrar Mar 12, 2026
c9728f4
black
uhbrar Mar 12, 2026
4b121ad
fix model loading
uhbrar Mar 13, 2026
38885c3
Make development on non-gpu machines more bearable
maximusunc Mar 13, 2026
d78c0ef
Bump minor version
maximusunc Mar 13, 2026
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

gandalf_mmap/
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ The main entrypoint is `./compose.yml` and will spin everything up.

- In the root folder, run `docker compose up --build`

If you want to add a new operation/worker, add a new service in `compose.yml` under `services`.
If you would like to run workers with gpu access, you can use the `./compose.gpu.yml` override file. Otherwise, workers will be restricted to cpu only.
- In the root folder, run `docker compose -f compose.yml -f compose.gpu.yml up --build`

If you want to add a new operation/worker, add a new service in `compose.yml` under `services`. If you want to add a new operation/worker that can utilize a gpu, add the service without the gpu deployment into `compose.yml` and then use the override file `compose.gpu.yml` to add the gpu as a resource so it may be accessible within the container.

### Worker

Expand Down
12 changes: 12 additions & 0 deletions compose.gpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
score_paths:
build:
args:
DEVICE: gpu
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
3 changes: 2 additions & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ services:
build:
context: .
dockerfile: workers/score_paths/Dockerfile
args:
DEVICE: cpu
restart: unless-stopped
depends_on:
shepherd_db:
Expand All @@ -204,7 +206,6 @@ services:
- ./logs:/app/logs
- ./.env:/app/.env


######### Example ARA
example_ara:
container_name: example_ara
Expand Down
4 changes: 3 additions & 1 deletion shepherd_server/base_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ async def run_sync_query(
query_id, response_id, logger = await run_query(target, query_dict)
start = time.time()
now = start
while now <= start + 360:
timeout = query_dict.get("parameters", {}).get("timeout", 360)
logger.info(f"Query running with {timeout} second timeout.")
while now <= start + timeout:
now = time.time()
# poll for completed status
query_state = await get_query_state(query_id, logger)
Expand Down
2 changes: 1 addition & 1 deletion shepherd_server/openapi-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ contact:
x-id: https://github.com/maximusunc
x-role: responsible developer
description: '<img src="/static/favicon.png" width="200px"><br /><br />Shepherd: Translator Autonomous Relay Agent Platform'
version: 0.6.9
version: 0.7.0
servers:
- description: Default server
url: https://shepherd.renci.org
Expand Down
12 changes: 9 additions & 3 deletions workers/aragorn_pathfinder/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@ async def shadowfax(task, logger: logging.Logger):
"subject": pinned_node_keys[0],
"object": "intermediate_0",
"predicates": [
"biolink:physically_interacts_with",
"biolink:genetically_interacts_with",
"biolink:contributes_to",
"biolink:contribution_from",
"biolink:affects",
"biolink:affected_by",
"biolink:interacts_with",
"biolink:acts_upstream_of",
"biolink:has_upstream_actor",
"biolink:enables",
Expand All @@ -115,17 +116,19 @@ async def shadowfax(task, logger: logging.Logger):
"biolink:translation_of",
"biolink:has_gene_product",
"biolink:gene_product_of",
"biolink:genetically_associated_with",
],
},
"e1": {
"subject": "intermediate_0",
"object": "intermediate_1",
"predicates": [
"biolink:physically_interacts_with",
"biolink:genetically_interacts_with",
"biolink:contributes_to",
"biolink:contribution_from",
"biolink:affects",
"biolink:affected_by",
"biolink:interacts_with",
"biolink:acts_upstream_of",
"biolink:has_upstream_actor",
"biolink:enables",
Expand All @@ -142,17 +145,19 @@ async def shadowfax(task, logger: logging.Logger):
"biolink:translation_of",
"biolink:has_gene_product",
"biolink:gene_product_of",
"biolink:genetically_associated_with",
],
},
"e2": {
"subject": "intermediate_1",
"object": pinned_node_keys[1],
"predicates": [
"biolink:physically_interacts_with",
"biolink:genetically_interacts_with",
"biolink:contributes_to",
"biolink:contribution_from",
"biolink:affects",
"biolink:affected_by",
"biolink:interacts_with",
"biolink:acts_upstream_of",
"biolink:has_upstream_actor",
"biolink:enables",
Expand All @@ -169,6 +174,7 @@ async def shadowfax(task, logger: logging.Logger):
"biolink:translation_of",
"biolink:has_gene_product",
"biolink:gene_product_of",
"biolink:genetically_associated_with",
],
},
},
Expand Down
19 changes: 11 additions & 8 deletions workers/score_paths/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,30 @@ FROM ghcr.io/translatorsri/renci-python-image:3.11.5
# Add image info
LABEL org.opencontainers.image.source https://github.com/BioPack-team/shepherd

ARG DEVICE=gpu

ENV PYTHONHASHSEED=0
ENV HF_HOME=/app/hf_cache

# set up requirements
WORKDIR /app

# make sure all is writeable for the nru USER later on
RUN chmod -R 777 .
COPY ./workers/score_paths/requirements-cpu.txt ./workers/score_paths/requirements-gpu.txt ./
RUN pip install --no-cache-dir --timeout=300 --retries=5 -r requirements-${DEVICE}.txt
# pre-download the model
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('cambridgeltl/SapBERT-from-PubMedBERT-fulltext')"

# Install requirements
# Install shared utilities
COPY ./shepherd_utils ./shepherd_utils
COPY ./pyproject.toml .
RUN pip install .

COPY ./workers/score_paths/requirements.txt .
RUN pip install -r requirements.txt
# Copy in files and make sure they are readable
COPY ./workers/score_paths .
RUN chmod -R 777 .

# switch to the non-root user (nru). defined in the base image
USER nru

# Copy in files
COPY ./workers/score_paths .

# Variables that can be overriden
CMD ["python", "worker.py"]

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions workers/score_paths/requirements-cpu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
xgboost>=3.2.0
sentence-transformers>=5.2.3
--extra-index-url https://download.pytorch.org/whl/cpu
torch>=2.10.0
bmt>=1.4.6
4 changes: 4 additions & 0 deletions workers/score_paths/requirements-gpu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
xgboost>=3.2.0
sentence-transformers>=5.2.3
torch>=2.10.0
bmt>=1.4.6
Empty file.
Loading
Loading