Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/datajoint_pipeline' into dataj…
Browse files Browse the repository at this point in the history
…oint_pipeline
  • Loading branch information
ttngu207 committed Apr 4, 2024
2 parents 28e5397 + b8f76d4 commit e6ed4af
Show file tree
Hide file tree
Showing 5 changed files with 718 additions and 13 deletions.
8 changes: 5 additions & 3 deletions aeon/dj_pipeline/analysis/block_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
from matplotlib import path as mpl_path

from aeon.analysis import utils as analysis_utils
from aeon.dj_pipeline import acquisition, fetch_stream, get_schema_name, streams, tracking
from aeon.dj_pipeline.analysis.visit import filter_out_maintenance_periods, get_maintenance_periods
from aeon.dj_pipeline import (acquisition, fetch_stream, get_schema_name,
streams, tracking)
from aeon.dj_pipeline.analysis.visit import (filter_out_maintenance_periods,
get_maintenance_periods)

schema = dj.schema(get_schema_name("block_analysis"))
logger = dj.logger
Expand Down Expand Up @@ -516,7 +518,7 @@ def make(self, key):
)

block_query = acquisition.Environment.BlockState & chunk_restriction
block_df = fetch_stream(block_query)[previous_block_start:chunk_end]
block_df = fetch_stream(block_query).sort_index()[previous_block_start:chunk_end]

block_ends = block_df[block_df.pellet_ct.diff() < 0]

Expand Down
5 changes: 3 additions & 2 deletions aeon/dj_pipeline/webapps/sciviz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ HOST_UID=$(id -u) docker-compose -f docker-compose-local.yaml up
```

#### Verify the deployment
- In your web browser, navigate to: [https://localhost/login](https://localhost/login)
- In your web browser, navigate to: [https://localhost/](https://localhost/)
- Set `Username` and `Password` to your own database user account (if you need one, please contact Project Aeon admin team).
- Click `Connect`.
- To stop the application, docker compose down with the following:
Expand All @@ -52,7 +52,8 @@ HOST_UID=$(id -u) docker-compose -f docker-compose-remote.yaml up -d

---
## Dynamic spec sheet
Sci-Viz is used to build visualization dashboards, this is done through a single spec sheet. The one for this deployment is called `specsheet.yaml`
Sci-Viz is used to build visualization dashboards, this is done through a single spec sheet. The one used in production is called `specsheet.yaml`,
and the one used locally is called `specsheet-local.yaml`.

Some notes about the spec sheet if you plan to tweak the website yourself:
- Page names under pages must have a unique name without spaces
Expand Down
16 changes: 8 additions & 8 deletions aeon/dj_pipeline/webapps/sciviz/docker-compose-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ services:
pharus:
cpus: 2.0
mem_limit: 4g
image: jverswijver/pharus:0.8.5-PY_VER-3.9
image: datajoint/pharus:0.8.10-py3.9
environment:
# - FLASK_ENV=development # enables logging to console from Flask
- PHARUS_SPEC_PATH=/main/specsheet.yaml # for dynamic utils spec
- PHARUS_SPEC_PATH=/main/specsheet-local.yaml # for dynamic utils spec
- PHARUS_MODE=DEV
user: root
volumes:
- ./specsheet.yaml:/main/specsheet.yaml #copy the spec over to /main/specs/YOUR_SPEC_NAME
- ./specsheet-local.yaml:/main/specsheet-local.yaml #copy the spec over to /main/specs/YOUR_SPEC_NAME
- ./apk_requirements.txt:/tmp/apk_requirements.txt
- /ceph/aeon/aeon:/ceph/aeon/aeon
command:
Expand All @@ -23,12 +23,12 @@ services:
- |
apk add --update git g++ &&
git clone -b datajoint_pipeline https://github.com/SainsburyWellcomeCentre/aeon_mecha.git &&
pip install -e ./aeon_mecha &&
pip install -e ./aeon_mecha --ignore-requires-python &&
pharus_update() {
[ -z "$$GUNICORN_PID" ] || kill $$GUNICORN_PID
gunicorn --bind 0.0.0.0:$${PHARUS_PORT} pharus.server:app &
GUNICORN_PID=$$!
}
} &&
pharus_update
echo "[$$(date -u '+%Y-%m-%d %H:%M:%S')][DataJoint]: Monitoring Pharus updates..."
INIT_TIME=$$(date +%s)
Expand All @@ -52,16 +52,16 @@ services:
sci-viz:
cpus: 2.0
mem_limit: 16g
image: jverswijver/sci-viz:2.3.3-hotfix3
image: jverswijver/sci-viz:2.3.5-beta
environment:
- CHOKIDAR_USEPOLLING=true
- REACT_APP_DJSCIVIZ_BACKEND_PREFIX=/api
- DJSCIVIZ_SPEC_PATH=/main/specsheet.yaml
- DJSCIVIZ_SPEC_PATH=/main/specsheet-local.yaml
- DJSCIVIZ_MODE=DEV
- NODE_OPTIONS="--max-old-space-size=12000"
user: root
volumes:
- ./specsheet.yaml:/main/specsheet.yaml
- ./specsheet-local.yaml:/main/specsheet-local.yaml
# ports:
# - "3000:3000"
command:
Expand Down
Loading

0 comments on commit e6ed4af

Please sign in to comment.