Skip to content

Commit 0f84560

Browse files
author
Thinh Nguyen
committed
Merge branch 'master' into populate_success_count
2 parents 9480435 + 4360b17 commit 0f84560

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2234
-1318
lines changed

.devcontainer/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Note: You can use any Debian/Ubuntu based image you want.
2+
FROM mcr.microsoft.com/devcontainers/python:3.7-bullseye
3+
4+
RUN \
5+
apt update && \
6+
apt-get install bash-completion graphviz default-mysql-client -y && \
7+
pip install flake8 black faker ipykernel nose nose-cov datajoint && \
8+
pip uninstall datajoint -y
9+
10+
ENV DJ_HOST fakeservices.datajoint.io
11+
ENV DJ_USER root
12+
ENV DJ_PASS simple

.devcontainer/devcontainer.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
{
3+
"name": "Development",
4+
"dockerComposeFile": "docker-compose.yaml",
5+
"service": "app",
6+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
7+
// Use this environment variable if you need to bind mount your local source code into a new container.
8+
"remoteEnv": {
9+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
10+
},
11+
// https://containers.dev/features
12+
"features": {
13+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
14+
"ghcr.io/devcontainers/features/git:1": {},
15+
"ghcr.io/eitsupi/devcontainer-features/jq-likes:1": {},
16+
"ghcr.io/guiyomh/features/vim:0": {}
17+
},
18+
"onCreateCommand": "pip install -e .",
19+
"postStartCommand": "MYSQL_VER=8.0 MINIO_VER=RELEASE.2022-08-11T04-37-28Z docker compose -f local-docker-compose.yml down && MYSQL_VER=8.0 MINIO_VER=RELEASE.2022-08-11T04-37-28Z docker compose -f local-docker-compose.yml up --build --wait",
20+
"forwardPorts": [
21+
80,
22+
443,
23+
3306,
24+
8080,
25+
9000
26+
],
27+
"customizations": {
28+
"vscode": {
29+
"extensions": [
30+
"ms-python.python"
31+
]
32+
}
33+
}
34+
}

.devcontainer/docker-compose.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: "3"
2+
services:
3+
app:
4+
build: .
5+
extra_hosts:
6+
- fakeservices.datajoint.io:127.0.0.1
7+
volumes:
8+
- ../..:/workspaces:cached
9+
entrypoint: /usr/local/share/docker-init.sh
10+
command: tail -f /dev/null

.github/workflows/development.yaml

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ name: Development
22
on:
33
push:
44
branches:
5-
- '**' # every branch
6-
- '!gh-pages' # exclude gh-pages branch
7-
- '!stage*' # exclude branches beginning with stage
5+
- "**" # every branch
6+
- "!gh-pages" # exclude gh-pages branch
7+
- "!stage*" # exclude branches beginning with stage
88
tags:
99
- '\d+\.\d+\.\d+' # only semver tags
1010
pull_request:
1111
branches:
12-
- '**' # every branch
13-
- '!gh-pages' # exclude gh-pages branch
14-
- '!stage*' # exclude branches beginning with stage
12+
- "**" # every branch
13+
- "!gh-pages" # exclude gh-pages branch
14+
- "!stage*" # exclude branches beginning with stage
1515
jobs:
1616
build:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
2020
include:
21-
- py_ver: 3.8
22-
distro: alpine
21+
- py_ver: "3.9"
22+
distro: debian
2323
image: djbase
2424
env:
2525
PY_VER: ${{matrix.py_ver}}
@@ -28,7 +28,7 @@ jobs:
2828
DOCKER_CLIENT_TIMEOUT: "120"
2929
COMPOSE_HTTP_TIMEOUT: "120"
3030
steps:
31-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
3232
- name: Validate version and release notes
3333
run: |
3434
DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py)
@@ -44,9 +44,9 @@ jobs:
4444
export HOST_UID=$(id -u)
4545
docker-compose -f docker-compose-build.yaml up --exit-code-from app --build
4646
echo "DJ_VERSION=${DJ_VERSION}" >> $GITHUB_ENV
47-
- if: matrix.py_ver == '3.8' && matrix.distro == 'alpine'
47+
- if: matrix.py_ver == '3.9' && matrix.distro == 'debian'
4848
name: Add pip artifacts
49-
uses: actions/upload-artifact@v2
49+
uses: actions/upload-artifact@v3
5050
with:
5151
name: pip-datajoint-${{env.DJ_VERSION}}
5252
path: dist
@@ -55,13 +55,15 @@ jobs:
5555
runs-on: ubuntu-latest
5656
strategy:
5757
matrix:
58-
py_ver: ["3.8"]
58+
py_ver: ["3.9"]
5959
mysql_ver: ["8.0", "5.7"]
6060
include:
61+
- py_ver: "3.8"
62+
mysql_ver: "5.7"
6163
- py_ver: "3.7"
6264
mysql_ver: "5.7"
6365
steps:
64-
- uses: actions/checkout@v2
66+
- uses: actions/checkout@v3
6567
- name: Set up Python ${{matrix.py_ver}}
6668
uses: actions/setup-python@v4
6769
with:
@@ -75,15 +77,14 @@ jobs:
7577
- name: Run primary tests
7678
env:
7779
PY_VER: ${{matrix.py_ver}}
80+
DJ_PASS: simple
7881
MYSQL_VER: ${{matrix.mysql_ver}}
79-
ALPINE_VER: "3.10"
82+
DISTRO: alpine
8083
MINIO_VER: RELEASE.2021-09-03T03-56-13Z
84+
DOCKER_CLIENT_TIMEOUT: "120"
8185
COMPOSE_HTTP_TIMEOUT: "120"
82-
COVERALLS_SERVICE_NAME: travis-ci
83-
COVERALLS_REPO_TOKEN: fd0BoXG46TPReEem0uMy7BJO5j0w1MQiY
8486
run: |
8587
export HOST_UID=$(id -u)
86-
export HOST_GID=$(id -g)
8788
docker-compose -f LNX-docker-compose.yml up --build --exit-code-from app
8889
- name: Run style tests
8990
run: |
@@ -101,7 +102,7 @@ jobs:
101102
DOCKER_CLIENT_TIMEOUT: "120"
102103
COMPOSE_HTTP_TIMEOUT: "120"
103104
steps:
104-
- uses: actions/checkout@v2
105+
- uses: actions/checkout@v3
105106
- name: Deploy docs
106107
run: |
107108
export MODE=BUILD
@@ -119,8 +120,8 @@ jobs:
119120
strategy:
120121
matrix:
121122
include:
122-
- py_ver: 3.8
123-
distro: alpine
123+
- py_ver: "3.9"
124+
distro: debian
124125
image: djbase
125126
env:
126127
PY_VER: ${{matrix.py_ver}}
@@ -133,7 +134,7 @@ jobs:
133134
outputs:
134135
release_upload_url: ${{steps.create_gh_release.outputs.upload_url}}
135136
steps:
136-
- uses: actions/checkout@v2
137+
- uses: actions/checkout@v3
137138
- name: Set up Python ${{matrix.py_ver}}
138139
uses: actions/setup-python@v4
139140
with:
@@ -160,7 +161,7 @@ jobs:
160161
prerelease: false
161162
draft: false
162163
- name: Fetch pip artifacts
163-
uses: actions/download-artifact@v2
164+
uses: actions/download-artifact@v3
164165
with:
165166
name: pip-datajoint-${{env.DJ_VERSION}}
166167
path: dist
@@ -191,4 +192,20 @@ jobs:
191192
export HOST_UID=$(id -u)
192193
docker-compose -f docker-compose-build.yaml run \
193194
-e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} app \
194-
sh -lc "pip install twine && python -m twine upload dist/*"
195+
sh -c "pip install twine && python -m twine upload dist/*"
196+
- name: Login to DockerHub
197+
uses: docker/login-action@v1
198+
with:
199+
username: ${{secrets.docker_username}}
200+
password: ${{secrets.docker_password}}
201+
- name: Publish image
202+
run: |
203+
IMAGE=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Repository}}")
204+
TAG=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Tag}}")
205+
docker push "${IMAGE}:${TAG}"
206+
docker tag "${IMAGE}:${TAG}" "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}"
207+
docker push "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}"
208+
[ "$PY_VER" == "3.9" ] && [ "$DISTRO" == "debian" ] \
209+
&& docker tag "${IMAGE}:${TAG}" "${IMAGE}:latest" \
210+
&& docker push "${IMAGE}:latest" \
211+
|| echo "skipping 'latest' tag..."

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ build/
2121
*.env
2222
docker-compose.yml
2323
notebook
24-
.vscode
2524
__main__.py
2625
jupyter_custom.js
2726
.eggs
2827
*.code-workspace
29-
docs/site
28+
docs/site
29+
30+
31+
!.vscode/settings.json
32+
!.vscode/launch.json
33+
!.devcontainer/devcontainer.json

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Current File",
9+
"type": "python",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal",
13+
"justMyCode": false
14+
}
15+
]
16+
}

.vscode/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"editor.formatOnPaste": false,
3+
"editor.formatOnSave": true,
4+
"editor.rulers": [
5+
94
6+
],
7+
"python.formatting.provider": "black",
8+
"[python]": {
9+
"editor.defaultFormatter": null
10+
},
11+
"[markdown]": {
12+
"editor.defaultFormatter": "disable"
13+
},
14+
"files.autoSave": "off"
15+
}

0 commit comments

Comments
 (0)