Skip to content

Commit

Permalink
Merge pull request #33 from kabilar/readme
Browse files Browse the repository at this point in the history
Add GitHub Actions to pre-build Docker image for faster environment launch
  • Loading branch information
dimitri-yatsenko authored Sep 14, 2023
2 parents 69b28b0 + 62ad72e commit 0c8f186
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 8 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}}
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
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 0c8f186

Please sign in to comment.