diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0ef41ce..9f20b37 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -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 && \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 43da260..6425d12 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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": { diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml index 31db1e1..d5af8ab 100644 --- a/.devcontainer/docker-compose.yaml +++ b/.devcontainer/docker-compose.yaml @@ -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: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..cd6d006 --- /dev/null +++ b/.github/workflows/release.yaml @@ -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}} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..22449fc --- /dev/null +++ b/.github/workflows/test.yaml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index aead246..22b2172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index d58143b..09a8d61 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/setup.py b/setup.py index e2d3921..37a4b56 100644 --- a/setup.py +++ b/setup.py @@ -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",