Skip to content

Commit 0c8f186

Browse files
Merge pull request #33 from kabilar/readme
Add GitHub Actions to pre-build Docker image for faster environment launch
2 parents 69b28b0 + 62ad72e commit 0c8f186

File tree

7 files changed

+35
-8
lines changed

7 files changed

+35
-8
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ RUN \
2626
echo '. /etc/bash_completion' >> /home/vscode/.bashrc && \
2727
echo 'export PS1="\[\e[32;1m\]\u\[\e[m\]@\[\e[34;1m\]\H\[\e[m\]:\[\e[33;1m\]\w\[\e[m\]$ "' >> /home/vscode/.bashrc && \
2828
apt-get clean
29+
2930
COPY ./requirements.txt /tmp/
31+
3032
RUN \
3133
# tutorial dependencies
3234
pip install --no-cache-dir black faker ipykernel && \

.devcontainer/devcontainer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
// For format details, see https://aka.ms/devcontainer.json.
21
{
32
"name": "DataJoint Tutorial",
43
"dockerComposeFile": "docker-compose.yaml",
54
"service": "app",
65
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
7-
// Use this environment variable if you need to bind mount your local source code into a new container.
86
"remoteEnv": {
97
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
108
},
11-
// https://containers.dev/features
129
"onCreateCommand": "pip install -e . && MYSQL_VER=8.0 docker compose down && MYSQL_VER=8.0 docker compose up --build --wait",
1310
"postStartCommand": "docker volume prune -f",
1411
"hostRequirements": {

.devcontainer/docker-compose.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ services:
33
app:
44
cpus: 2
55
mem_limit: 4g
6-
build:
7-
context: ..
8-
dockerfile: ./.devcontainer/Dockerfile
6+
# build: # build context is used when developing locally
7+
# context: ..
8+
# dockerfile: ./.devcontainer/Dockerfile
9+
image: datajoint/datajoint_tutorials:latest
910
extra_hosts:
1011
- fakeservices.datajoint.io:127.0.0.1
1112
volumes:
12-
- ../..:/workspaces:cached
13+
- ..:/workspaces/datajoint-tutorials:cached
1314
- docker_data:/var/lib/docker # persist docker images
1415
privileged: true # only because of dind
1516
volumes:

.github/workflows/release.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
devcontainer-build:
6+
uses: datajoint/.github/.github/workflows/devcontainer-build.yaml@main
7+
devcontainer-publish:
8+
needs:
9+
- devcontainer-build
10+
uses: datajoint/.github/.github/workflows/devcontainer-publish.yaml@main
11+
secrets:
12+
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
13+
DOCKERHUB_TOKEN: ${{secrets.DOCKERHUB_TOKEN}}

.github/workflows/test.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Test
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: "0 8 * * 1"
8+
jobs:
9+
devcontainer-build:
10+
uses: datajoint/.github/.github/workflows/devcontainer-build.yaml@main

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.1.3 - 2023-09-14
4+
5+
+ Add - GitHub Actions to build Docker image and push to DockerHub
6+
37
## 0.1.2 - 2023-07-13
48

59
+ Update - Pin versions for VS Code extensions

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name="datajoint-tutorials",
15-
version="0.1.2",
15+
version="0.1.3",
1616
description="DataJoint interactive tutorials",
1717
long_description=long_description,
1818
author="DataJoint",

0 commit comments

Comments
 (0)