Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Witte, Julius committed Nov 6, 2024
0 parents commit e78cfbc
Show file tree
Hide file tree
Showing 126 changed files with 12,384 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .devcontainer/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM docker.io/rockylinux:9

ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG WORK_DIR=/workspace
ENV HOME="/home/${USERNAME}"
ENV PATH="$HOME/.local/bin:$PATH"

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -m -d $HOME \
--uid $USER_UID --gid $USER_GID $USERNAME

ENV PYENV_ROOT="${HOME}/.pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${HOME}/.local/bin:${PATH}"

COPY . /tmp/app

WORKDIR /tmp/app

RUN bash ./bin/deploy/prep.sh && bash ./bin/deploy/req.sh

WORKDIR /

RUN rm -rf /tmp/app

RUN git config --global --add safe.directory $WORK_DIR

RUN mkdir -p $WORK_DIR && \
chown $USERNAME:$USERNAME -R $WORK_DIR && \
chown $USERNAME:$USERNAME -R $HOME

USER $USERNAME

ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
23 changes: 23 additions & 0 deletions .devcontainer/dev.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3'
services:
dev:
user: vscode
build:
context: .
dockerfile: .devcontainer/dev.Dockerfile
args:
- USERNAME=vscode
- USER_UID=1000
- USER_GID=1000
- WORK_DIR=/workspace
volumes:
- .:/workspace
- ~/.gitconfig:/etc/gitconfig:ro
networks:
- bio


networks:
bio:
name: bioindustry
external: true
47 changes: 47 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"customizations": {
"vscode": {
"extensions": [
"njpwerner.autodocstring",
"formulahendry.code-runner",
"streetsidesoftware.code-spell-checker",
"kamikillerto.vscode-colorize",
"ms-azuretools.vscode-docker",
"donjayamanne.githistory",
"eamodio.gitlens",
"oderwat.indent-rainbow",
"yzhang.markdown-all-in-one",
"christian-kohler.path-intellisense",
"ms-python.vscode-pylance",
"ms-python.python",
"ChristianDein.python-radon",
"foxundermoon.shell-format",
"ms-vscode.test-adapter-converter",
"hbenl.vscode-test-explorer",
"Gruntfuggly.todo-tree",
"uctakeoff.vscode-counter",
"DotJoshJohnson.xml",
"aaron-bond.better-comments",
"KevinRose.vsc-python-indent",
"tamasfe.even-better-toml"
]
}
},
"dockerComposeFile": [
"../docker-compose.yml",
"dev.docker-compose.yml"
],
"mounts": [
"source=${localEnv:HOME}/tech/git/.authentication,target=/workspace/.authentication,type=bind,consistency=cached"
],
"name": "microbial_strain_data_model",
"postAttachCommand": "make dev",
"remoteUser": "vscode",
"runServices": [
"dev"
],
"service": "dev",
"shutdownAction": "stopCompose",
"updateRemoteUserUID": true,
"workspaceFolder": "/workspace"
}
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*

!/bin
!/src
!/configs

!Makefile
!poetry.lock
!pyproject.toml

!README.md
!LICENSE

**/__pycache__
**/*.py[cod]
**/*$py.class
56 changes: 56 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: main

on:
pull_request:
push:
branches: [main]

jobs:
mac_win_test:
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
os: [windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: tox test
run: |
tox -e py
lin_lint:
env:
PY_DIR: pyenv
CU_HOME: /home/custom
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install dependencies
run: |
sudo mkdir -p $CU_HOME && sudo chown runner -R $CU_HOME
sudo apt install -y libedit-dev curl make git-lfs
curl https://pyenv.run | PYENV_ROOT=$CU_HOME/$PY_DIR bash
echo "$CU_HOME/$PY_DIR/bin" >> $GITHUB_PATH
echo "$CU_HOME/$PY_DIR/shims" >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: lint and test
run: |
make dev
make runChecks
56 changes: 56 additions & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Deploy static documentation to Pages

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
env:
PY_DIR: pyenv
CU_HOME: /home/custom
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install dependencies
run: |
sudo mkdir -p $CU_HOME && sudo chown runner -R $CU_HOME
sudo apt install -y libedit-dev curl make git-lfs
curl https://pyenv.run | PYENV_ROOT=$CU_HOME/$PY_DIR bash
echo "$CU_HOME/$PY_DIR/bin" >> $GITHUB_PATH
echo "$CU_HOME/$PY_DIR/shims" >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Create documentation html
run: |
make docs
make runDocs
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
Loading

0 comments on commit e78cfbc

Please sign in to comment.