Skip to content

Commit 1dea4e4

Browse files
authored
Merge pull request #2 from MilagrosMarin/first_release
Initial Release for `element-moseq`
2 parents c7dce57 + 9f22796 commit 1dea4e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+9013
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM python:3.9-slim@sha256:5f0192a4f58a6ce99f732fe05e3b3d00f12ae62e183886bca3ebe3d202686c7f
2+
3+
ENV PATH /usr/local/bin:$PATH
4+
ENV PYTHON_VERSION 3.9.17
5+
6+
RUN \
7+
adduser --system --disabled-password --shell /bin/bash vscode && \
8+
# install docker
9+
apt-get update && \
10+
apt-get install ca-certificates curl gnupg lsb-release -y && \
11+
mkdir -m 0755 -p /etc/apt/keyrings && \
12+
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
13+
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 && \
14+
apt-get update && \
15+
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y && \
16+
usermod -aG docker vscode && \
17+
apt-get clean
18+
19+
RUN \
20+
# dev setup
21+
apt update && \
22+
apt-get install sudo git bash-completion graphviz default-mysql-client s3fs procps -y && \
23+
usermod -aG sudo vscode && \
24+
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
25+
pip install --no-cache-dir --upgrade black pip nbconvert && \
26+
echo '. /etc/bash_completion' >> /home/vscode/.bashrc && \
27+
echo 'export PS1="\[\e[32;1m\]\u\[\e[m\]@\[\e[34;1m\]\H\[\e[m\]:\[\e[33;1m\]\w\[\e[m\]$ "' >> /home/vscode/.bashrc && \
28+
apt-get clean
29+
30+
COPY ./ /tmp/element-moseq/
31+
32+
RUN \
33+
# pipeline dependencies
34+
apt-get install gcc g++ ffmpeg libsm6 libxext6 libgl1 libegl1 -y && \
35+
pip install --no-cache-dir -e /tmp/element-moseq[elements,tests] && \
36+
# clean up
37+
rm -rf /tmp/element-moseq/ && \
38+
apt-get clean
39+
40+
# Install Keypoint-MoSeq (CPU version)
41+
RUN pip install "jax[cpu]==0.3.22" -f https://storage.googleapis.com/jax-releases/jax_releases.html
42+
43+
ENV DJ_HOST fakeservices.datajoint.io
44+
ENV DJ_USER root
45+
ENV DJ_PASS simple
46+
47+
ENV KPMS_ROOT_DATA_DIR /workspaces/element-moseq/example_data/inbox
48+
ENV KPMS_ROOT_OUTPUT_DIR /workspaces/element-moseq/example_data/outbox
49+
ENV DATABASE_PREFIX neuro_
50+
51+
USER vscode
52+
CMD bash -c "sudo rm /var/run/docker.pid; sudo dockerd"
53+
54+
ENV LD_LIBRARY_PATH="/lib:/opt/conda/lib"

.devcontainer/devcontainer.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "Environment + Data",
3+
"dockerComposeFile": "docker-compose.yaml",
4+
"service": "app",
5+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
6+
"remoteEnv": {
7+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
8+
},
9+
"onCreateCommand": "mkdir -p ${KPMS_ROOT_DATA_DIR} && pip install -e .",
10+
"postStartCommand": "docker volume prune -f && s3fs ${DJ_PUBLIC_S3_LOCATION} ${KPMS_ROOT_DATA_DIR} -o nonempty,multipart_size=530,endpoint=us-east-1,url=http://s3.amazonaws.com,public_bucket=1",
11+
"hostRequirements": {
12+
"cpus": 4,
13+
"memory": "8gb",
14+
"storage": "32gb"
15+
},
16+
"forwardPorts": [
17+
3306
18+
],
19+
"customizations": {
20+
"settings": {
21+
"python.pythonPath": "/usr/local/bin/python"
22+
},
23+
"vscode": {
24+
"extensions": [
25+
26+
27+
]
28+
}
29+
}
30+
}

.devcontainer/docker-compose.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: "3"
2+
services:
3+
app:
4+
cpus: 4
5+
mem_limit: 8g
6+
build:
7+
context: ..
8+
dockerfile: ./.devcontainer/Dockerfile
9+
# image: datajoint/element_moseq:latest
10+
extra_hosts:
11+
- fakeservices.datajoint.io:127.0.0.1
12+
environment:
13+
- DJ_PUBLIC_S3_LOCATION=djhub.vathes.datapub.elements:/workflow-moseq/v1
14+
devices:
15+
- /dev/fuse
16+
cap_add:
17+
- SYS_ADMIN
18+
security_opt:
19+
- apparmor:unconfined
20+
volumes:
21+
- ..:/workspaces/element-moseq:cached
22+
- docker_data:/var/lib/docker # persist docker images
23+
privileged: true # only because of dind
24+
volumes:
25+
docker_data:
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
## Bug Report
11+
12+
### Description
13+
14+
A clear and concise description of what is the overall operation that is intended to be
15+
performed that resulted in an error.
16+
17+
### Reproducibility
18+
Include:
19+
- OS (WIN | MACOS | Linux)
20+
- DataJoint Element Version
21+
- MySQL Version
22+
- MySQL Deployment Strategy (local-native | local-docker | remote)
23+
- Minimum number of steps to reliably reproduce the issue
24+
- Complete error stack as a result of evaluating the above steps
25+
26+
### Expected Behavior
27+
A clear and concise description of what you expected to happen.
28+
29+
### Screenshots
30+
If applicable, add screenshots to help explain your problem.
31+
32+
### Additional Research and Context
33+
Add any additional research or context that was conducted in creating this report.
34+
35+
For example:
36+
- Related GitHub issues and PR's either within this repository or in other relevant
37+
repositories.
38+
- Specific links to specific lines or a focus within source code.
39+
- Relevant summary of Maintainers development meetings, milestones, projects, etc.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: DataJoint Contribution Guideline
4+
url: https://datajoint.com/docs/community/contribute/
5+
about: Please make sure to review the DataJoint Contribution Guidelines
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for a new feature
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
## Feature Request
11+
12+
### Problem
13+
14+
A clear and concise description how this idea has manifested and the context. Elaborate
15+
on the need for this feature and/or what could be improved. Ex. I'm always frustrated
16+
when [...]
17+
18+
### Requirements
19+
20+
A clear and concise description of the requirements to satisfy the new feature. Detail
21+
what you expect from a successful implementation of the feature. Ex. When using this
22+
feature, it should [...]
23+
24+
### Justification
25+
26+
Provide the key benefits in making this a supported feature. Ex. Adding support for this
27+
feature would ensure [...]
28+
29+
### Alternative Considerations
30+
31+
Do you currently have a work-around for this? Provide any alternative solutions or
32+
features you've considered.
33+
34+
### Related Errors
35+
Add any errors as a direct result of not exposing this feature.
36+
37+
Please include steps to reproduce provided errors as follows:
38+
- OS (WIN | MACOS | Linux)
39+
- DataJoint Element Version
40+
- MySQL Version
41+
- MySQL Deployment Strategy (local-native | local-docker | remote)
42+
- Minimum number of steps to reliably reproduce the issue
43+
- Complete error stack as a result of evaluating the above steps
44+
45+
### Screenshots
46+
If applicable, add screenshots to help explain your feature.
47+
48+
### Additional Research and Context
49+
Add any additional research or context that was conducted in creating this feature request.
50+
51+
For example:
52+
- Related GitHub issues and PR's either within this repository or in other relevant
53+
repositories.
54+
- Specific links to specific lines or a focus within source code.
55+
- Relevant summary of Maintainers development meetings, milestones, projects, etc.
56+
- Any additional supplemental web references or links that would further justify this
57+
feature request.

.github/workflows/release.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
make_github_release:
6+
uses: datajoint/.github/.github/workflows/make_github_release.yaml@main
7+
pypi_release:
8+
needs: make_github_release
9+
uses: datajoint/.github/.github/workflows/pypi_release.yaml@main
10+
secrets:
11+
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
12+
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
13+
with:
14+
UPLOAD_URL: ${{needs.make_github_release.outputs.release_upload_url}}
15+
mkdocs_release:
16+
uses: datajoint/.github/.github/workflows/mkdocs_release.yaml@main
17+
permissions:
18+
contents: write
19+
devcontainer-build:
20+
uses: datajoint/.github/.github/workflows/devcontainer-build.yaml@main
21+
devcontainer-publish:
22+
needs:
23+
- devcontainer-build
24+
uses: datajoint/.github/.github/workflows/devcontainer-publish.yaml@main
25+
secrets:
26+
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
27+
DOCKERHUB_TOKEN: ${{secrets.DOCKERHUB_TOKEN_FOR_ELEMENTS}}

.github/workflows/test.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: "0 8 * * 1"
8+
jobs:
9+
devcontainer-build:
10+
uses: datajoint/.github/.github/workflows/devcontainer-build.yaml@main
11+
tests:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
py_ver: ["3.9", "3.10"]
16+
mysql_ver: ["8.0", "5.7"]
17+
include:
18+
- py_ver: "3.8"
19+
mysql_ver: "5.7"
20+
- py_ver: "3.7"
21+
mysql_ver: "5.7"
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Set up Python ${{matrix.py_ver}}
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: ${{matrix.py_ver}}
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install flake8 "black[jupyter]"
32+
- name: Run style tests
33+
run: |
34+
python_version=${{matrix.py_ver}}
35+
black element_moseq --check --verbose --target-version py${python_version//.}
36+
black notebooks --check --verbose --target-version py${python_version//.}
37+

0 commit comments

Comments
 (0)