From 7e2c79350ab6572830865d2fe77323ac907b66e7 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Thu, 14 Sep 2023 14:14:49 -0500 Subject: [PATCH 01/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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