From 7e2c79350ab6572830865d2fe77323ac907b66e7 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 14:14:49 -0500 Subject: [PATCH 01/15] Install repo --- .devcontainer/Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 5a4a2fe..a88e3d6 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -26,12 +26,15 @@ 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/ + +COPY ./ /tmp/datajoint-tutorials + RUN \ # tutorial dependencies pip install --no-cache-dir black faker ipykernel && \ - pip install --no-cache-dir -r /tmp/requirements.txt && \ - rm /tmp/requirements.txt + pip install --no-cache-dir -e /tmp/datajoint-tutorials && \ + # clean up + rm -rf /tmp/datajoint-tutorials ENV DJ_HOST fakeservices.datajoint.io ENV DJ_USER root From 1c29eb3637f108beafd661920ce8a92f2aa693ce Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 14:15:03 -0500 Subject: [PATCH 02/15] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From bc090fbec5350c37682bb50b46aad27d8e0b43b8 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 14:15:15 -0500 Subject: [PATCH 03/15] Remove comments --- .devcontainer/devcontainer.json | 3 --- 1 file changed, 3 deletions(-) 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": { From affe2c5689f6ffce024df5fff5b82cbe8b4d7a64 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 14:16:34 -0500 Subject: [PATCH 04/15] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aead246..fd88fd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.1.3 - 2023-09-14 + ++ Add - GitHub Actions to build Dev Container ++ Update - Dockerfile to install repository + ## 0.1.2 - 2023-07-13 + Update - Pin versions for VS Code extensions From 7744c2aee95cde5a6b97effdd55009d569659c56 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 14:17:27 -0500 Subject: [PATCH 05/15] Add `test` workflow --- .github/workflows/test.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/test.yaml 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 From c8eafd6474c7a567f9f3a6b3d5145ffde463ee21 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 14:18:09 -0500 Subject: [PATCH 06/15] Add `release` workflow --- .github/workflows/release.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..5109e17 --- /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}} From 0454388fa630a86c0a10757b6455bbb488900883 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 14:19:59 -0500 Subject: [PATCH 07/15] Update Compose file --- .devcontainer/docker-compose.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml index 31db1e1..c154261 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: + # 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: From 5aaf0a9b4bdcab5b6433261208b4a2b2d6ab4361 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 14:37:35 -0500 Subject: [PATCH 08/15] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd88fd8..6f47664 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 0.1.3 - 2023-09-14 -+ Add - GitHub Actions to build Dev Container ++ Add - GitHub Actions to build Docker image and push to DockerHub + Update - Dockerfile to install repository ## 0.1.2 - 2023-07-13 From e895a277c82ea08ec047cae43ed0f98dd78733df Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 14:41:11 -0500 Subject: [PATCH 09/15] Fix path --- .devcontainer/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml index c154261..4d0439b 100644 --- a/.devcontainer/docker-compose.yaml +++ b/.devcontainer/docker-compose.yaml @@ -10,7 +10,7 @@ services: extra_hosts: - fakeservices.datajoint.io:127.0.0.1 volumes: - - ..:/workspaces/datajoint_tutorials:cached + - ..:/workspaces/datajoint-tutorials:cached - docker_data:/var/lib/docker # persist docker images privileged: true # only because of dind volumes: From e30884dff08baa50b70c149ae732dbf0dbcdb3c4 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 19:48:51 +0000 Subject: [PATCH 10/15] Revert install --- .devcontainer/Dockerfile | 7 +++---- CHANGELOG.md | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a88e3d6..15bd4ac 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -27,14 +27,13 @@ RUN \ 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/datajoint-tutorials +COPY ./requirements.txt /tmp/ RUN \ # tutorial dependencies pip install --no-cache-dir black faker ipykernel && \ - pip install --no-cache-dir -e /tmp/datajoint-tutorials && \ - # clean up - rm -rf /tmp/datajoint-tutorials + pip install --no-cache-dir -r /tmp/requirements.txt && \ + rm /tmp/requirements.txt ENV DJ_HOST fakeservices.datajoint.io ENV DJ_USER root diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f47664..22b2172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,6 @@ ## 0.1.3 - 2023-09-14 + Add - GitHub Actions to build Docker image and push to DockerHub -+ Update - Dockerfile to install repository ## 0.1.2 - 2023-07-13 From 62ad72e94f8a915c8f52262311e1a962aad7fd2b Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 19:52:34 +0000 Subject: [PATCH 11/15] Add comment --- .devcontainer/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml index 4d0439b..d5af8ab 100644 --- a/.devcontainer/docker-compose.yaml +++ b/.devcontainer/docker-compose.yaml @@ -3,7 +3,7 @@ services: app: cpus: 2 mem_limit: 4g - # build: + # build: # build context is used when developing locally # context: .. # dockerfile: ./.devcontainer/Dockerfile image: datajoint/datajoint_tutorials:latest From 7566b579e62fe725e27e6841e21a4751a8f9219f Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 20:52:47 +0000 Subject: [PATCH 12/15] Fix token --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5109e17..cd6d006 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,4 +10,4 @@ jobs: uses: datajoint/.github/.github/workflows/devcontainer-publish.yaml@main secrets: DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}} - DOCKERHUB_TOKEN: ${{secrets.DOCKERHUB_TOKEN}} + DOCKERHUB_TOKEN: ${{secrets.DOCKERHUB_TOKEN_FOR_ELEMENTS}} From 59135d99430eb5fa4376f60d87c8430e0f0e238a Mon Sep 17 00:00:00 2001 From: Drew Yang Date: Fri, 15 Sep 2023 15:29:26 -0500 Subject: [PATCH 13/15] =?UTF-8?q?docs:=20=F0=9F=93=9D=20update=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f020f81..0154f3f 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ Here are some options that provide a great experience: - **Local IDE**: - Ensure you have [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - Ensure you have [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 - Ensure you have [VSCode](https://code.visualstudio.com/) - Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) - `git clone` the codebase repository and open it in VSCode From ec741b57d961cc3e76fb4ff6cbeabf10113bb27d Mon Sep 17 00:00:00 2001 From: Drew Yang <31813282+yambottle@users.noreply.github.com> Date: Fri, 15 Sep 2023 15:52:15 -0500 Subject: [PATCH 14/15] Update README.md Co-authored-by: Kabilar Gunalan --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0154f3f..d29c6b4 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Here are some options that provide a great experience: - Ensure you have [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 + - 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 - Ensure you have [VSCode](https://code.visualstudio.com/) - Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) From 1af091e963a30249c6b5ae8d07ab0b103af53d28 Mon Sep 17 00:00:00 2001 From: Drew Yang <31813282+yambottle@users.noreply.github.com> Date: Fri, 15 Sep 2023 15:52:22 -0500 Subject: [PATCH 15/15] Update README.md Co-authored-by: Kabilar Gunalan --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d29c6b4..f6069a0 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Here are some options that provide a great experience: - 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 + - `export DOCKER_DEFAULT_PLATFORM=linux/amd64` in .zshrc or at a shell prompt - Ensure you have [VSCode](https://code.visualstudio.com/) - Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) - `git clone` the codebase repository and open it in VSCode