Skip to content

Commit

Permalink
Merge pull request #5 from biosimulators/main
Browse files Browse the repository at this point in the history
updated poetry lock and configs for version
  • Loading branch information
AlexPatrie authored Mar 1, 2024
2 parents b3e8189 + 237aca7 commit 75bb234
Show file tree
Hide file tree
Showing 42 changed files with 2,765 additions and 11,424 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ submit-biosimulators-container.sh
._vagrant
.THIS-IS-FOR-CONTAINER-DEV-ONLY
buildDockerImage.yml
.env
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ ENV DEBIAN_FRONTEND=noninteractive \
WORKDIR /app

# copy and make dirs
COPY ./biosimulator_processes/processes /app/biosimulator_processes
COPY ./biosimulator_processes /app/biosimulator_processes
COPY ./notebooks /app/notebooks

# copy files
COPY ./pyproject.toml ./poetry.lock ./data ./scripts/trust-notebooks.sh /app/
COPY ./scripts/xvfb-startup.sh /xvfb-startup.sh

VOLUME /app/data

RUN apt-get update && apt-get install -y --no-install-recommends \
python3.10 \
python3-pip \
python3-dev \
build-essential \
libncurses5 \
cmake \
Expand All @@ -46,18 +49,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --upgrade pip && pip install poetry \
&& poetry config virtualenvs.in-project true \
# && poetry run pip install psutil \
&& poetry update \
&& poetry install \
&& chmod +x ./trust-notebooks.sh \
&& ./trust-notebooks.sh \
&& rm ./trust-notebooks.sh

VOLUME /app/data

CMD ["poetry", "run", "jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]


# PLEASE NOTE: We do not need to add a USER in the Dockerfile as Singularity will handle
# such logic in conversion on the HPC.
# such logic in conversion on the HPC.

# type imports
# dist
Expand Down
19 changes: 8 additions & 11 deletions biosimulator_processes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
from process_bigraph import process_registry
from builder import ProcessTypes


# Define a list of processes to attempt to import and register
processes_to_register = [
PROCESSES_TO_REGISTER = [
('cobra', 'cobra_process.CobraProcess'),
('copasi', 'copasi_process.CopasiProcess'),
('smoldyn', 'smoldyn_process.SmoldynProcess'),
('tellurium', 'tellurium_process.TelluriumProcess'),
]

for process_name, process_path in processes_to_register:
CORE = ProcessTypes()

for process_name, process_path in PROCESSES_TO_REGISTER:
module_name, class_name = process_path.rsplit('.', 1)
try:
# Dynamically import the module
process_module = __import__(f'biosimulator_processes.{module_name}', fromlist=[class_name])
process_module = __import__(
f'biosimulator_processes.processes.{module_name}', fromlist=[class_name])
# Get the class from the module
process_class = getattr(process_module, class_name)

# Register the process
process_registry.register(process_name, process_class)
CORE.process_registry.register(class_name, process_class)
print(f"{class_name} registered successfully.")
except ImportError as e:
print(f"{class_name} not available. Error: {e}")


from biosimulator_processes.copasi_process import CopasiProcess
from biosimulator_processes.smoldyn_process import SmoldynProcess
from biosimulator_processes.cobra_process import CobraProcess
from biosimulator_processes.tellurium_process import TelluriumProcess
9 changes: 9 additions & 0 deletions biosimulator_processes/biosimulator_builder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from typing import *
from builder import Builder
from biosimulator_processes import CORE


class BiosimulatorBuilder(Builder):
def __init__(self, schema: Dict, tree: Dict, filepath: str):
super().__init__(schema=schema, tree=tree, file_path=filepath, core=CORE)

157 changes: 0 additions & 157 deletions biosimulator_processes/cobra_process.py

This file was deleted.

72 changes: 0 additions & 72 deletions biosimulator_processes/container-assets/Dockerfile-base

This file was deleted.

Loading

0 comments on commit 75bb234

Please sign in to comment.