Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
28 changes: 28 additions & 0 deletions .github/workflows/docker-netpyne.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Docker Image Build NetPyNE-UI

on:
push:
branches: [ master, dev*, feature/docker*, feature/repo*, osbv2* ]
pull_request:
branches: [ master, dev*, feature/docker*, feature/repo*, osbv2* ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build the Docker image
run: |
./build_docker.sh

- name: Info on Docker image sizes
run: |
docker images

- name: Run the Docker container and list python installs
run: |
docker run -t --rm --entrypoint /bin/bash mynetpyneui -c "pip3 list && python -V"
44 changes: 23 additions & 21 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
# branches:
# - "master"
# - "development"
# - "osbv2*"
# pull_request:
# branches:
# - "master"
# - "development"
# - "osbv2*"

# # A workflow run is made up of one or more jobs that can run sequentially or in parallel
# jobs:
Expand Down Expand Up @@ -80,28 +82,28 @@
# npm run Control_Panel_test
# env:
# CI: true
# Save_and_Open_File-test:
# # The type of runner that the job will run on
# runs-on: ubuntu-20.04
# container: lironavon/docker-puppeteer-container:14.16.0
# Save_and_Open_File-test:
# # The type of runner that the job will run on
# runs-on: ubuntu-20.04
# container: lironavon/docker-puppeteer-container:14.16.0
# env:
# CI: true
# steps:
# - uses: actions/checkout@v1
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# cache-dependency-path: frontend/e2e/tests/package-lock.json
# - name: Test for Opening and Saving a file
# run: |
# cd tests/frontend/e2e
# #install dependencies
# npm ci
# # run Control Panel test
# npm run Save_Open_File_test
# env:
# CI: true
# steps:
# - uses: actions/checkout@v1
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# cache-dependency-path: frontend/e2e/tests/package-lock.json
# - name: Test for Opening and Saving a file
# run: |
# cd tests/frontend/e2e
# #install dependencies
# npm ci
# # run Control Panel test
# npm run Save_Open_File_test
# env:
# CI: true
# CI: true
# RxD-test:
# # The type of runner that the job will run on
# runs-on: ubuntu-20.04
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18 as jsbuild
FROM node:18 AS jsbuild

ENV FOLDER=netpyne

Expand All @@ -12,12 +12,12 @@ COPY webapp .
RUN yarn build-dev

### Download on a separate stage to run in parallel with buildkit
FROM jupyter/base-notebook:hub-1.5.0 as downloads
FROM quay.io/jupyter/base-notebook:python-3.12 AS downloads
USER root
RUN wget --no-check-certificate -O /nyhead.mat https://www.parralab.org/nyhead/sa_nyhead.mat

###
FROM jupyter/base-notebook:hub-1.5.0
FROM quay.io/jupyter/base-notebook:python-3.12
ENV NB_UID=jovyan
ENV FOLDER=netpyne
ENV NP_LFPYKIT_HEAD_FILE=/home/jovyan/nyhead.mat
Expand All @@ -28,13 +28,14 @@ RUN rm -rf /var/lib/apt/lists
RUN apt-get update -qq &&\
apt-get install python3-tk vim nano unzip git make libtool g++ -qq pkg-config libfreetype6-dev libpng-dev libopenmpi-dev -y
RUN apt-get install openjdk-11-jre-headless -y
RUN conda install python=3.7 -y
RUN apt-get install libxml2-dev libxslt-dev -y
# RUN conda install python=3.7 -y


WORKDIR $FOLDER
COPY --chown=1000:1000 requirements.txt requirements.txt
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
pip install -r requirements.txt --prefer-binary
pip install -r requirements.txt


# ToDo: fixme, for now remove the jupyter hub config json file because it overrides the default
Expand Down Expand Up @@ -82,7 +83,7 @@ RUN mv workspace /opt/workspace/tutorials
RUN chown -R $NB_UID /opt/workspace
RUN ln -s /opt/workspace workspace

RUN jupyter labextension disable @jupyterlab/hub-extension
# RUN jupyter labextension disable @jupyterlab/hub-extension

COPY --from=downloads --chown=1000:1000 /nyhead.mat $NP_LFPYKIT_HEAD_FILE
COPY --from=jsbuild --chown=1000:1000 $FOLDER/webapp/build webapp/build
Expand Down
4 changes: 4 additions & 0 deletions build_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

time DOCKER_BUILDKIT=1 docker build -t mynetpyneui -f Dockerfile .
5 changes: 4 additions & 1 deletion netpyne_ui/netpyne_geppetto.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def validate_netParams(self):
for line in summary:
message = message + f" {line}\n"
message = message + "\n"
raise NetpyneValidationError(message)
logging.warning("CONTINUING DESPITE FAILURE....")


def simulateNetPyNEModelInGeppetto(self, args):
Expand Down Expand Up @@ -480,6 +480,7 @@ def loadModel(self, args):
:param args:
:return:
"""
logging.info("=========== Load Model ===========")
if not any([args[option] for option in ['loadNetParams', 'loadSimCfg', 'loadSimData', 'loadNet']]):
return utils.getJSONError("Error while loading data", 'You have to select at least one option')

Expand Down Expand Up @@ -653,6 +654,8 @@ def importModel(self, modelParameters):
os.chdir(owd)

def importNeuroML(self, modelParameters):

logging.info("=========== Importing NeuroML ===========")
from netpyne_ui.helpers import neuroml


Expand Down
2 changes: 1 addition & 1 deletion netpyne_ui/netpyne_model_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def extractPopulations(self, netpyne_model, netpyne_geppetto_library):
index=len(populations[cell['tags']['pop']].defaultValue.elements),
position=Point(
x=float(cell['tags']['x'] * netpyne_model.net.params.cellsVisualizationSpacingMultiplier[0]),
y=-float(cell['tags']['y'] * netpyne_model.net.params.cellsVisualizationSpacingMultiplier[1]),
y=float(cell['tags']['y'] * netpyne_model.net.params.cellsVisualizationSpacingMultiplier[1]),
z=float(cell['tags']['z'] * netpyne_model.net.params.cellsVisualizationSpacingMultiplier[2])
)
)
Expand Down
6 changes: 3 additions & 3 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pytest==4.6.2
pytest-cov==2.7.1
tox==3.12.1
pytest
pytest-cov
tox
Loading