Skip to content

Commit

Permalink
Merge branch main of datajoint/datajoint-tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
MilagrosMarin committed Sep 17, 2023
2 parents b39409a + 2bc9705 commit 8a70bf9
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ RUN \
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 ./requirements.txt /tmp/

RUN \
# tutorial dependencies
pip install --no-cache-dir black faker ipykernel && \
Expand Down
3 changes: 0 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "DataJoint Tutorial",
"dockerComposeFile": "docker-compose.yaml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Use this environment variable if you need to bind mount your local source code into a new container.
"remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
},
// https://containers.dev/features
"onCreateCommand": "pip install -e . && MYSQL_VER=8.0 docker compose down && MYSQL_VER=8.0 docker compose up --build --wait",
"postStartCommand": "docker volume prune -f",
"hostRequirements": {
Expand Down
9 changes: 5 additions & 4 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ services:
app:
cpus: 2
mem_limit: 4g
build:
context: ..
dockerfile: ./.devcontainer/Dockerfile
# build: # build context is used when developing locally
# context: ..
# dockerfile: ./.devcontainer/Dockerfile
image: datajoint/datajoint_tutorials:latest
extra_hosts:
- fakeservices.datajoint.io:127.0.0.1
volumes:
- ../..:/workspaces:cached
- ..:/workspaces/datajoint-tutorials:cached
- docker_data:/var/lib/docker # persist docker images
privileged: true # only because of dind
volumes:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Release
on:
workflow_dispatch:
jobs:
devcontainer-build:
uses: datajoint/.github/.github/workflows/devcontainer-build.yaml@main
devcontainer-publish:
needs:
- devcontainer-build
uses: datajoint/.github/.github/workflows/devcontainer-publish.yaml@main
secrets:
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
DOCKERHUB_TOKEN: ${{secrets.DOCKERHUB_TOKEN_FOR_ELEMENTS}}
10 changes: 10 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Test
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 8 * * 1"
jobs:
devcontainer-build:
uses: datajoint/.github/.github/workflows/devcontainer-build.yaml@main
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.1.3 - 2023-09-14

+ Add - GitHub Actions to build Docker image and push to DockerHub

## 0.1.2 - 2023-07-13

+ Update - Pin versions for VS Code extensions
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ DataJoint tutorials are easily accessible using an **interactive environment** t
- We highly recommend this option for users that who want to apply DataJoint to **their own neuroscience experiments** and lab research after exploring the tutorials. Additionally, this option is particularly advantageous for those who have a keen interest in **other modules of the DataJoint Elements Library** (e.g., Miniscope, DeepLabCut). For this option, ensure you have the following:
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [Docker](https://docs.docker.com/get-docker/)
- On M1/M2 Mac, you have to:
- enable Rosetta 2 on Docker advanced/experimental settings
- ensure Rosetta is installed by typing `softwareupdate --install-rosetta` at a shell prompt
- `export DOCKER_DEFAULT_PLATFORM=linux/amd64` in .zshrc or at a shell prompt
- [Microsoft's Visual Studio Code (VS Code)](https://code.visualstudio.com/)
- [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
- [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
- `git clone` the codebase repository and open it in VSCode.
- To begin, navigate to the notebooks directory located in the left panel and proceed through the sequentially organized Jupyter notebooks, labeled by numbers. Execute the cells in the notebooks to begin your walkthrough of the tutorial.
- Once you are done, see the options in the menu in the bottom-left corner. When running DevContainer on your machine, you can `Reopen folder locally`. By default, GitHub will also automatically stop the Codespaces after 30 minutes of inactivity.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name="datajoint-tutorials",
version="0.1.2",
version="0.1.3",
description="DataJoint interactive tutorials",
long_description=long_description,
author="DataJoint",
Expand Down

0 comments on commit 8a70bf9

Please sign in to comment.