diff --git a/Makefile b/Makefile
index fe239f2b..406b7bc2 100644
--- a/Makefile
+++ b/Makefile
@@ -58,8 +58,7 @@ run-dev: migrate
run-staging: migrate
make run-django-staging & \
make run-celery & \
- make run-celery-beat & \
- make run-virgo-staging
+ make run-celery-beat
django-migrate: migrations migrate
@@ -85,7 +84,7 @@ run-celery:
celery -A scidash.main worker -l info --concurrency=5 --maxtasksperchild=20
run-celery-beat:
- celery -A scidash.main beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
+ celery -A scidash.main beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler --pidfile=
run-virgo-staging:
/bin/bash /opt/virgo/bin/startup.sh
diff --git a/requirements.in b/requirements.in
index 755ab266..04185443 100644
--- a/requirements.in
+++ b/requirements.in
@@ -13,3 +13,4 @@ celery[redis]
django-celery-beat
django-celery-results
django-db-logger
+git+git://github.com/ddelpiano/neuronunit@4.0.0#egg=neuronunit
diff --git a/requirements.txt b/requirements.txt
index 746f70bf..813c6d41 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile
# To update, run:
#
-# pip-compile
+# pip-compile
#
amqp==2.4.2 # via kombu
asgiref==2.3.2 # via channels
@@ -27,6 +27,7 @@ django==1.11.7
djangorestframework-jwt==1.11.0
djangorestframework==3.7.1
drf-writable-nested==0.5.1
+git+git://github.com/ddelpiano/neuronunit@4.0.0#egg=neuronunit
hyperlink==18.0.0 # via twisted
idna==2.8 # via hyperlink
incremental==17.5.0 # via twisted
diff --git a/scidash/sciunittests/migrations/0046_auto_20190827_0221.py b/scidash/sciunittests/migrations/0046_auto_20190827_0221.py
new file mode 100644
index 00000000..7e28b229
--- /dev/null
+++ b/scidash/sciunittests/migrations/0046_auto_20190827_0221.py
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.7 on 2019-12-11 01:56
+from __future__ import unicode_literals
+
+import datetime
+import django.contrib.postgres.fields.jsonb
+from django.db import migrations, models
+import scidash.sciunittests.models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('sciunittests', '0045_auto_20190712_1041'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='testclass',
+ name='default_params',
+ field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, encoder=scidash.sciunittests.models.JSONEncoder, null=True),
+ ),
+ migrations.AlterField(
+ model_name='scoreinstance',
+ name='timestamp',
+ field=models.DateTimeField(default=datetime.datetime.today),
+ ),
+ migrations.AlterField(
+ model_name='testinstance',
+ name='timestamp',
+ field=models.DateTimeField(auto_now=True),
+ ),
+ migrations.AlterField(
+ model_name='testsuite',
+ name='timestamp',
+ field=models.DateTimeField(default=datetime.datetime.today),
+ ),
+ ]
diff --git a/scidash/sciunittests/views.py b/scidash/sciunittests/views.py
index a70d419c..99e91b50 100644
--- a/scidash/sciunittests/views.py
+++ b/scidash/sciunittests/views.py
@@ -17,16 +17,10 @@ def get(self, request, *args, **kwargs):
day=current_date.day
)
- three_month_ago = current_date_iso - three_month_period
- six_month_ago = three_month_ago - three_month_period
- nine_month_ago = six_month_ago - three_month_period
- tvelwe_month_ago = nine_month_ago - three_month_period
-
acceptable_period = None
- for period in [
- three_month_ago, six_month_ago, nine_month_ago, tvelwe_month_ago
- ]:
+ for quarter in range(1, s.SCIDASH_INITIAL_SEARCH_QUARTERS + 1):
+ period = current_date_iso - quarter*three_month_period
count = ScoreInstance.objects.filter(
timestamp__gte=period, timestamp__lt=current_date_iso
).count()
@@ -36,7 +30,7 @@ def get(self, request, *args, **kwargs):
break
if acceptable_period is None:
- acceptable_period = tvelwe_month_ago
+ acceptable_period = period
return Response(
{
diff --git a/service/deployment/docker-compose.yml b/service/deployment/docker-compose.yml
index bcb082aa..1d0810c8 100644
--- a/service/deployment/docker-compose.yml
+++ b/service/deployment/docker-compose.yml
@@ -4,21 +4,29 @@ services:
scidash-redis:
image: redis
expose:
- - "6379"
+ - 6379
scidash-postgres:
image: metacell/scidash_db:latest
expose:
- - "5432"
+ - 5432
volumes:
- ./database:/var/lib/postgresql/
- scidash:
- image: metacell/scidash:latest
+ scidash-virgo:
+ image: metacell/scidash_virgo:v1.0.0
+ expose:
+ - 8080
mem_reservation: 5120m
mem_limit: 10240m
- priviliged: true
+ privileged: true
shm_size: 512M
- expose:
- - "8000"
depends_on:
- scidash-redis
- scidash-postgres
+ scidash:
+ image: metacell/scidash:latest
+ ports:
+ - 8000:8000
+ depends_on:
+ - scidash-redis
+ - scidash-postgres
+ - scidash-virgo
diff --git a/service/docker/Dockerfile-scidash b/service/docker/Dockerfile-scidash
index bcdc6ff3..93aa6cbf 100644
--- a/service/docker/Dockerfile-scidash
+++ b/service/docker/Dockerfile-scidash
@@ -1,6 +1,6 @@
-FROM metacell/scidash_virgo:v1.0.0
+FROM python:3.6
-USER root
+USER root
# BUILD VARIABLES
ARG ROOT=/
@@ -9,32 +9,31 @@ ARG NRN_SYMLINK=/Applications/NEURON-7.6/nrn/
ARG DOTENV_FILE=env-docker
ARG STATIC_DIR=$APP_DIR/scidash/static
ARG GEPPETTO_DIR=$STATIC_DIR/org.geppetto.frontend/src/main/webapp
-ARG SCIDASH_BRANCH=4.0.1
+ARG SCIDASH_BRANCH=feature/400
ENV SERVER_HOME $APP_DIR/virgo-tomcat-server
-WORKDIR $ROOT
+RUN useradd -ms /bin/bash developer
+ENV HOME /home/developer
-#COPYING PROJECT
-WORKDIR $APP_DIR
-RUN git clone -b $SCIDASH_BRANCH https://github.com/MetaCell/scidash
+WORKDIR $ROOT
# INSTALLING REQUIREMENTS
-RUN apt-get install -y curl wget lsof
+RUN apt-get install -y curl wget
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash
RUN apt-get update && apt-get -y install nodejs
+RUN curl https://www.npmjs.com/install.sh | sh
+
+#COPYING PROJECT
+WORKDIR $APP_DIR
+RUN git clone -b $SCIDASH_BRANCH https://github.com/MetaCell/scidash
-WORKDIR /nrn
-RUN chown -R developer ./
WORKDIR $APP_DIR/scidash
-RUN pip install virtualenv
+RUN pip install virtualenv
RUN virtualenv venv-py -p python3.6
-WORKDIR /usr/local/nrn/src/nrnpython
-RUN python setup.py install
WORKDIR $APP_DIR/scidash
RUN make install-backend-with-env
-RUN make install-sciunit-neuronunit
RUN make install-frontend
WORKDIR $GEPPETTO_DIR
@@ -42,8 +41,8 @@ RUN ls -la
RUN npm run build-dev-noTest
WORKDIR $APP_DIR/scidash
-RUN rm -rf .git &&\
- rm -rf static/org.geppetto.frontend/.git &&\
+RUN rm -rf .git &&\
+ rm -rf static/org.geppetto.frontend/.git &&\
rm -rf static/org.geppetto.frontend/extension/geppetto-scidash/.git &&\
rm -rf sciunit/.git &&\
rm -rf neuronunit/.git
@@ -51,5 +50,4 @@ RUN chown -R developer ./
RUN cp ./service/dotenv/scidash_env .env
USER developer
-
CMD ./service/scripts/run.sh
diff --git a/service/docker/Dockerfile-virgo b/service/docker/Dockerfile-virgo
index d65d2bc7..a8b0f34d 100644
--- a/service/docker/Dockerfile-virgo
+++ b/service/docker/Dockerfile-virgo
@@ -14,6 +14,7 @@ ARG SCIDASH_BRANCH=development
WORKDIR /
RUN useradd -ms /bin/bash developer
ENV HOME /home/developer
+RUN printf "\ndeb http://deb.debian.org/debian/ sid main\n" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant && \
@@ -80,14 +81,14 @@ RUN ls -l /usr/local/nrn/
# -== INSTALL VIRGO ==-
RUN mkdir $VIRGO_DIR
-RUN apt-get install curl
+RUN apt-get -y install curl
RUN curl -L 'http://www.eclipse.org/downloads/download.php?file=/virgo/release/VP/3.7.2.RELEASE/virgo-tomcat-server-3.7.2.RELEASE.zip&r=1' > virgo.zip
RUN unzip virgo.zip
RUN cp -r ./virgo-tomcat-server-3.7.2.RELEASE/* $VIRGO_DIR
RUN rm $VIRGO_DIR/configuration/java-server.profile
RUN cp /git/scidash/service/geppetto/java-server.profile $VIRGO_DIR/configuration/
RUN rm $VIRGO_DIR/configuration/tomcat-server.xml
-RUN cp /git/scidash/service/geppetto/tomcat-server.xml $VIRGO_DIR/configuration/
+RUN cat /git/scidash/service/geppetto/tomcat-server.xml | sed 's/127.0.0.1/0.0.0.0/' > $VIRGO_DIR/configuration/tomcat-server.xml
RUN chmod u+x $VIRGO_DIR/bin/*.sh
ENV SERVER_HOME $VIRGO_DIR
RUN chmod 777 -R $VIRGO_DIR
diff --git a/service/dotenv/env-docker b/service/dotenv/env-docker
index 86631363..9965aa72 100644
--- a/service/dotenv/env-docker
+++ b/service/dotenv/env-docker
@@ -12,6 +12,12 @@ STATIC_DIR=static
REDIS_URL=redis://scidash-redis:6379
-GEPPETTO_SERVLET_URL='ws://localhost:8080/org.geppetto.frontend/GeppettoServlet'
-GEPPETTO_BASE_URL='http://localhost:8080/org.geppetto.frontend/geppetto'
-BASE_PROJECT_FILES_HOST='http://localhost:8000/static/projects/'
+# for localhost
+# GEPPETTO_HOST=localhost
+# for docker
+GEPPETTO_HOST=scidash-virgo
+GEPPETTO_PORT=8080
+GEPPETTO_SERVLET_URL=ws://${GEPPETTO_HOST}:${GEPPETTO_PORT}/org.geppetto.frontend/GeppettoServlet
+GEPPETTO_BASE_URL=http://${GEPPETTO_HOST}:${GEPPETTO_PORT}/org.geppetto.frontend/geppetto
+
+BASE_PROJECT_FILES_HOST='http://scidash:8000/static/projects/'
diff --git a/service/dotenv/scidash_env b/service/dotenv/scidash_env
index 66526853..9e12c06d 100644
--- a/service/dotenv/scidash_env
+++ b/service/dotenv/scidash_env
@@ -12,6 +12,12 @@ REDIS_URL=redis://scidash-redis:6379
STATIC_URL='/static/'
STATIC_DIR='static'
-# GEPPETTO_SERVLET_URL='ws://scidash-virgo:8080/org.geppetto.frontend/GeppettoServlet'
-# GEPPETTO_BASE_URL='http://scidash-virgo:8080/org.geppetto.frontend/geppetto'
-# BASE_PROJECT_FILES_HOST='http://scidash-virgo:8000/static/projects/'
+# for localhost
+# GEPPETTO_HOST=localhost
+# for docker
+GEPPETTO_HOST=scidash-virgo
+GEPPETTO_PORT=8080
+GEPPETTO_SERVLET_URL=ws://${GEPPETTO_HOST}:${GEPPETTO_PORT}/org.geppetto.frontend/GeppettoServlet
+GEPPETTO_BASE_URL=http://${GEPPETTO_HOST}:${GEPPETTO_PORT}/org.geppetto.frontend/geppetto
+
+BASE_PROJECT_FILES_HOST='http://scidash:8000/static/projects/'
diff --git a/service/geppetto/GeppettoConfiguration.json b/service/geppetto/GeppettoConfiguration.json
index 5b8a1b8b..e336de2e 100644
--- a/service/geppetto/GeppettoConfiguration.json
+++ b/service/geppetto/GeppettoConfiguration.json
@@ -1,7 +1,7 @@
{
"_README": "http://docs.geppetto.org/en/latest/build.html",
"contextPath": "org.geppetto.frontend",
- "useSsl": true,
+ "useSsl": false,
"embedded": false,
"embedderURL": ["/"],
"rootRedirect": "",
diff --git a/service/geppetto/tomcat-server.xml b/service/geppetto/tomcat-server.xml
index 53aabe37..8e88d374 100644
--- a/service/geppetto/tomcat-server.xml
+++ b/service/geppetto/tomcat-server.xml
@@ -27,7 +27,7 @@
-
diff --git a/service/scripts/db-create-psql.sh b/service/scripts/db-create-psql.sh
index 96a146f3..0c9a6a0c 100755
--- a/service/scripts/db-create-psql.sh
+++ b/service/scripts/db-create-psql.sh
@@ -1,17 +1,8 @@
#!/bin/bash
-psql -d template1 -c 'create extension hstore;'
-
-psql <