Skip to content

Commit

Permalink
Merge pull request #19 from kushalbakshi/codespace
Browse files Browse the repository at this point in the history
Add DevContainer and tutorial + fix `Segmentation` make + update docs
  • Loading branch information
ttngu207 authored Apr 9, 2024
2 parents 4f53b14 + 5df1a60 commit b23c44c
Show file tree
Hide file tree
Showing 28 changed files with 1,907 additions and 181 deletions.
188 changes: 168 additions & 20 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,49 +14,197 @@
"flagWords": [],
"allowCompoundWords": true,
"ignorePaths": [
"./element_zstack.egg-info/*",
"./element_array_ephys.egg-info/*",
"./images/*"
],
"words": [
"acorr",
"aggr",
"ascontiguousarray",
"Alessio",
"Andreas",
"apmeta",
"arange",
"arithmatex",
"asarray",
"astype",
"Berens",
"bossdb",
"CICD",
"connectome",
"Connectome",
"connectomics",
"DBURLs",
"autocorrelogram",
"Axona",
"bbins",
"bdist",
"Binarize",
"bouton",
"Brody",
"Bruker",
"bshift",
"Buccino",
"catgt",
"cbar",
"cbin",
"cdat",
"chans",
"Chans",
"chns",
"Clust",
"clusterings",
"cmap",
"cnmf",
"correlogram",
"correlograms",
"curations",
"DANDI",
"decomp",
"deconvolution",
"DISTRO",
"djbase",
"dtype",
"Ecker",
"ecephys",
"Eftychios",
"electrophysiogical",
"elif",
"Ephys",
"Hoenselaar",
"IACUC",
"fluo",
"fneu",
"Fneu",
"gblcar",
"gfix",
"Giovannucci",
"Hakan",
"hdmf",
"HHMI",
"hstack",
"ibllib",
"ifnull",
"imax",
"Imax",
"IMAX",
"imec",
"imread",
"imro",
"imrotbl",
"imshow",
"Inan",
"inlinehilite",
"ipdb",
"iplane",
"ipynb",
"ipywidgets",
"iscell",
"Kavli",
"kcoords",
"Klusta",
"Kwik",
"lfmeta",
"linenums",
"masky",
"mathjax",
"mdict",
"Mesoscale",
"mesoscope",
"mkdocs",
"mkdocstrings",
"ndarrays",
"neuroglancer",
"neuroimaging",
"pngs",
"Moser",
"mtscomp",
"nblocks",
"nchan",
"Nchan",
"nchannels",
"ndarray",
"ndepths",
"ndim",
"ndimage",
"Neuralynx",
"NEURO",
"neuroconv",
"Neurodata",
"Neurolabware",
"neuropil",
"Neuropil",
"Neuropix",
"neuropixel",
"NeuroPixels",
"nfields",
"nframes",
"npix",
"nplanes",
"nrois",
"NTNU",
"nwbfile",
"NWBHDF",
"oebin",
"openephys",
"openpyxl",
"Pachitariu",
"paramsets",
"phylog",
"plotly",
"Pnevmatikakis",
"PSTH",
"pykilosort",
"pymdownx",
"pynwb",
"pyopenephys",
"pyplot",
"pytest",
"quantile",
"Reimer",
"repolarization",
"Roboto",
"roidetect",
"rois",
"ROIs",
"RRID",
"Rxiv",
"Sasaki",
"sbxreader",
"scipy",
"sdist",
"sess",
"SGLX",
"Shen",
"Siapas",
"Sinz",
"Siegle",
"Sitonic",
"spikeglx",
"spkcount",
"spks",
"Stereotaxic",
"Sutter",
"tcat",
"tickvals",
"tofile",
"Tolias",
"tqdm",
"usecs",
"usedb",
"Vidrio's",
"vline",
"vmax",
"Vmax",
"voxel",
"xanchor",
"xaxes",
"xaxis",
"xblock",
"xcoords",
"xcorr",
"xlabel",
"xlim",
"xoff",
"xpix",
"XPOS",
"xtick",
"yanchor",
"Yatsenko",
"Zuckerman"
"yaxes",
"yaxis",
"yblock",
"ycoord",
"ycoords",
"ylabel",
"ylim",
"yoff",
"ypix",
"YPOS",
"yref",
"yticks",
"zpix"
]
}
48 changes: 48 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM python:3.9-slim@sha256:5f0192a4f58a6ce99f732fe05e3b3d00f12ae62e183886bca3ebe3d202686c7f

ENV PATH /usr/local/bin:$PATH
ENV PYTHON_VERSION 3.9.17

RUN \
adduser --system --disabled-password --shell /bin/bash vscode && \
# install docker
apt-get update && \
apt-get install ca-certificates curl gnupg lsb-release -y && \
mkdir -m 0755 -p /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y && \
usermod -aG docker vscode && \
apt-get clean

RUN \
# dev setup
apt update && \
apt-get install sudo git bash-completion graphviz default-mysql-client s3fs procps -y && \
usermod -aG sudo vscode && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
pip install --no-cache-dir --upgrade black pip nbconvert && \
echo '. /etc/bash_completion' >> /home/vscode/.bashrc && \
echo 'export PS1="\[\e[32;1m\]\u\[\e[m\]@\[\e[34;1m\]\H\[\e[m\]:\[\e[33;1m\]\w\[\e[m\]$ "' >> /home/vscode/.bashrc && \
apt-get clean

COPY ./ /tmp/element-zstack/

RUN \
# pipeline dependencies
apt-get install gcc g++ ffmpeg libsm6 libxext6 -y && \
pip install --no-cache-dir -e /tmp/element-zstack[elements,tests] && \
# clean up
rm -rf /tmp/element-zstack && \
apt-get clean

ENV DJ_HOST fakeservices.datajoint.io
ENV DJ_USER root
ENV DJ_PASS simple

ENV VOLUME_ROOT_DATA_DIR /workspaces/element-zstack/example_data
ENV DATABASE_PREFIX neuro_

USER vscode
CMD bash -c "sudo rm /var/run/docker.pid; sudo dockerd"
30 changes: 30 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "Environment + Data",
"dockerComposeFile": "docker-compose.yaml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
},
"onCreateCommand": "mkdir -p ${VOLUME_ROOT_DATA_DIR} && pip install -e .",
"postStartCommand": "docker volume prune -f && s3fs ${DJ_PUBLIC_S3_LOCATION} ${VOLUME_ROOT_DATA_DIR} -o nonempty,multipart_size=530,endpoint=us-east-1,url=http://s3.amazonaws.com,public_bucket=1",
"hostRequirements": {
"cpus": 4,
"memory": "8gb",
"storage": "32gb"
},
"forwardPorts": [
3306
],
"customizations": {
"settings": {
"python.pythonPath": "/usr/local/bin/python"
},
"vscode": {
"extensions": [
"[email protected]",
"[email protected]"
]
}
}
}
25 changes: 25 additions & 0 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: "3"
services:
app:
cpus: 4
mem_limit: 8g
build:
context: ..
dockerfile: ./.devcontainer/Dockerfile
# image: datajoint/element_array_ephys:latest
extra_hosts:
- fakeservices.datajoint.io:127.0.0.1
environment:
- DJ_PUBLIC_S3_LOCATION=djhub.vathes.datapub.elements:/workflow-zstack-v1
devices:
- /dev/fuse
cap_add:
- SYS_ADMIN
security_opt:
- apparmor:unconfined
volumes:
- ..:/workspaces/element-zstack:cached
- docker_data:/var/lib/docker # persist docker images
privileged: true # only because of dind
volumes:
docker_data:
8 changes: 0 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ on:
jobs:
make_github_release:
uses: datajoint/.github/.github/workflows/make_github_release.yaml@main
pypi_release:
needs: make_github_release
uses: datajoint/.github/.github/workflows/pypi_release.yaml@main
secrets:
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
with:
UPLOAD_URL: ${{needs.make_github_release.outputs.release_upload_url}}
mkdocs_release:
uses: datajoint/.github/.github/workflows/mkdocs_release.yaml@main
permissions:
Expand Down
Loading

0 comments on commit b23c44c

Please sign in to comment.