Skip to content

Commit 37d28ec

Browse files
authored
Merge pull request #118 from ghga-de/refactor
Merge refactor branch into main
2 parents 8d6d0ed + 7b1d0e6 commit 37d28ec

File tree

1,152 files changed

+12683
-64568
lines changed

Some content is hidden

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

1,152 files changed

+12683
-64568
lines changed

.devcontainer/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM mcr.microsoft.com/vscode/devcontainers/python:3.9-bullseye
2+
3+
ENV PYTHONUNBUFFERED 1
4+
5+
# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user.
6+
ARG USER_UID=1000
7+
ARG USER_GID=$USER_UID
8+
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then groupmod --gid $USER_GID vscode && usermod --uid $USER_UID --gid $USER_GID vscode; fi
9+
10+
# [Option] Install Node.js
11+
ARG INSTALL_NODE="true"
12+
ARG NODE_VERSION="lts/*"
13+
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
14+
15+
# Copy install and launcher script to bin:
16+
COPY ./dev_install /bin
17+
18+
CMD ["sleep", "infinity"]

.devcontainer/dev_build

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# build artifacts from the linkml schema
3+
4+
cd /workspace
5+
6+
make all
7+
make gen-creation-schema-artifacts stage-derived-schemas

.devcontainer/dev_install

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
# install service in dev container
3+
4+
cd /workspace
5+
6+
# install in edit mode with testing dependencies
7+
pip install \
8+
-r \
9+
requirements.txt

.devcontainer/devcontainer.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/python-3-postgres
3+
// Update the VARIANT arg in docker-compose.yml to pick a Python version: 3, 3.8, 3.7, 3.6
4+
{
5+
"name": "ghga-metadata-schema",
6+
"dockerComposeFile": "docker-compose.yml",
7+
"service": "app",
8+
"workspaceFolder": "/workspace",
9+
// Set *default* container specific settings.json values on container create.
10+
"customizations": {
11+
"vscode": {
12+
// Set *default* container specific settings.json values on container create.
13+
"settings": {
14+
"terminal.integrated.profiles.linux": {
15+
"bash": {
16+
"path": "/bin/bash"
17+
}
18+
},
19+
"python.pythonPath": "/usr/local/bin/python",
20+
"python.languageServer": "Pylance",
21+
"python.linting.enabled": true,
22+
"python.linting.pylintEnabled": true,
23+
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
24+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
25+
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
26+
"python.formatting.provider": "black",
27+
"python.analysis.typeCheckingMode": "basic",
28+
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
29+
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
30+
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
31+
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
32+
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
33+
"python.testing.pytestPath": "/usr/local/py-utils/bin/pytest",
34+
"python.testing.unittestEnabled": false,
35+
"python.testing.pytestEnabled": true,
36+
"editor.formatOnSave": true,
37+
"editor.renderWhitespace": "all",
38+
"editor.rulers": [
39+
88
40+
],
41+
"licenser.license": "Custom",
42+
"licenser.customHeaderFile": "/workspace/.devcontainer/license_header.txt"
43+
},
44+
// Add the IDs of extensions you want installed when the container is created.
45+
"extensions": [
46+
"mikestead.dotenv",
47+
"ms-azuretools.vscode-docker",
48+
"ms-python.python",
49+
"ms-python.isort",
50+
"ms-python.vscode-pylance",
51+
"ms-toolsai.jupyter",
52+
"njpwerner.autodocstring",
53+
"redhat.vscode-yaml",
54+
"42crunch.vscode-openapi",
55+
"arjun.swagger-viewer",
56+
"eamodio.gitlens",
57+
"github.vscode-pull-request-github",
58+
"streetsidesoftware.code-spell-checker",
59+
"yzhang.markdown-all-in-one",
60+
"visualstudioexptteam.vscodeintellicode",
61+
"ymotongpoo.licenser",
62+
"editorconfig.editorconfig",
63+
"bierner.markdown-mermaid"
64+
]
65+
}
66+
},
67+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
68+
// "forwardPorts": [5000, 5432],
69+
// Use 'postCreateCommand' to run commands after the container is created.
70+
"postCreateCommand": "dev_install",
71+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
72+
"remoteUser": "vscode",
73+
"features": {
74+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
75+
"version": "latest",
76+
"enableNonRootDocker": "true",
77+
"moby": true,
78+
"azureDnsAutoDetection": false
79+
}
80+
}
81+
}

.devcontainer/docker-compose.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: '3'
2+
3+
services:
4+
app:
5+
build:
6+
context: .
7+
dockerfile: ./Dockerfile
8+
args:
9+
# [Choice] Python version: 3, 3.8, 3.7, 3.6
10+
VARIANT: 3.9
11+
# [Choice] Install Node.js
12+
INSTALL_NODE: "true"
13+
NODE_VERSION: "lts/*"
14+
# Please adapt to package name:
15+
PACKAGE_NAME: "my_microservice"
16+
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
17+
USER_UID: 1000
18+
USER_GID: 1000
19+
20+
init: true
21+
privileged: true
22+
23+
volumes:
24+
- ..:/workspace:cached
25+
26+
# Overrides default command so things don't shut down after the process ends.
27+
command: sleep infinity
28+
29+
# Uncomment the next line to use a non-root user for all processes.
30+
user: vscode

.erdiagrams.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Configuration parameters used by ./scripts/update_entity_relations.py
2+
- title: Global Overview
3+
description: An overview of the entire submission schema.
4+
model: submission.yaml
5+
tree_root: true
6+
include_attributes: false
7+
- title: Sample, Biospecimen, & Individual
8+
description: Focusses on the relation between Sample, Biospecimen, and Individual.
9+
model: submission.yaml
10+
classes: ["Sample", "Biospecimen", "Individual"]
11+
tree_root: false
12+
include_attributes: false
13+
- title: Experiment, Sample, & File
14+
description: Focusses on the relation between Experiment, Sample, and File.
15+
model: submission.yaml
16+
classes: ["SequencingExperiment", "Sample", "File", "SequencingProcess"]
17+
tree_root: false
18+
include_attributes: false
19+
- title: Study, Condition, & Sample
20+
description: Focusses on the relation between Study, Condition, and Sample.
21+
model: submission.yaml
22+
classes: ["Study", "Condition", "Sample"]
23+
tree_root: false
24+
include_attributes: false
25+
- title: Sample, Biospecimen, & Individual (with attributes)
26+
description: Focusses on the details of the relation between Sample, Biospecimen, and Individual.
27+
model: submission.yaml
28+
classes: ["Sample", "Biospecimen", "Individual"]
29+
tree_root: false
30+
include_attributes: true
31+
- title: Experiment, Sample, & File (with attributes)
32+
description: Focusses on the relation between Experiment, Sample, and File.
33+
model: submission.yaml
34+
classes: ["SequencingExperiment", "Sample", "File", "SequencingProcess"]
35+
tree_root: false
36+
include_attributes: true
37+
- title: Study, Condition, & Sample (with attributes)
38+
description: Focusses on the relation between Study, Condition, and Sample.
39+
model: submission.yaml
40+
classes: ["Study", "Condition", "Sample"]
41+
tree_root: false
42+
include_attributes: true

.github/workflows/build-artifacts.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,23 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: Build Documentation
42

5-
# Controls when the workflow will run
6-
on:
7-
workflow_run:
8-
workflows: ["Build and update artifacts"]
9-
branches: [main]
10-
types:
11-
- completed
12-
push:
13-
branches: [ main ]
14-
paths:
15-
- docs/*
16-
17-
# Allows you to run this workflow manually from the Actions tab
18-
workflow_dispatch:
19-
20-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
3+
on: push
4+
215
jobs:
22-
# This workflow contains a single job called "build"
23-
build:
24-
# The type of runner that the job will run on
6+
build-docs:
7+
name: Build documentation
258
runs-on: ubuntu-latest
26-
strategy:
27-
matrix:
28-
python-version: [3.9]
29-
30-
# Steps represent a sequence of tasks that will be executed as part of the job
319
steps:
32-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
33-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
3411

35-
- name: Set up Python ${{ matrix.python-version }}
36-
uses: actions/setup-python@v2
12+
- name: Set up Python 3.9
13+
uses: actions/setup-python@v4
3714
with:
38-
python-version: ${{ matrix.python-version }}
15+
python-version: 3.9
3916

4017
- name: Install dependencies
41-
run: |
18+
run: >-
4219
pip install -r requirements.txt
43-
44-
- name: Build docs and push to gh-pages
45-
run: |
46-
git pull
47-
git config --local user.email "action@github.com"
48-
git config --local user.name "GitHub Action"
49-
make gh-deploy
20+
21+
- name: Build docs
22+
run: >-
23+
./scripts/generate_linkml_docs.py --check

.github/workflows/build.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check entity relationship diagrams
2+
3+
on: push
4+
5+
jobs:
6+
check-erdiagrams:
7+
name: check entity relationship diagrams
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: Set up Python 3.9
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: 3.9
16+
17+
- name: Install dependencies
18+
run: >-
19+
pip install -r requirements.txt
20+
21+
- name: check entity relationship diagrams
22+
run: >-
23+
./scripts/update_entity_relations.py --check

0 commit comments

Comments
 (0)