Skip to content

Commit 67a7307

Browse files
committed
initial commit
0 parents  commit 67a7307

File tree

213 files changed

+93694
-0
lines changed

Some content is hidden

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

213 files changed

+93694
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/python-3/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
4+
ARG VARIANT="3.10-bullseye"
5+
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
6+
7+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
8+
ARG NODE_VERSION="none"
9+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
10+
11+
RUN apt-get update && \
12+
export DEBIAN_FRONTEND=noninteractive && \
13+
sudo apt install -y gcc g++ pigz libhdf5-dev vim
14+
15+
USER vscode
16+
ENV PATH="${PATH}:/home/vscode/.local/bin/:/home/vscode/micromamba/bin"
17+
ENV ENV_NAME="base"
18+
ENV MAMBA_ROOT_PREFIX="/home/vscode/conda"
19+
ENV MAMBA_EXE="/home/vscode/micromamba"
20+
RUN curl micro.mamba.pm/install.sh > /tmp/micromamba_install.sh && \
21+
yes | bash /tmp/micromamba_install.sh
22+
RUN micromamba shell init -p "$MAMBA_ROOT_PREFIX" -s bash > /dev/null && \
23+
echo "micromamba activate \$ENV_NAME" >> ~/.bashrc
24+
25+
COPY .devcontainer/mamba_environment.yaml /tmp/mamba_environment.yaml
26+
RUN micromamba install -y -f /tmp/mamba_environment.yaml

.devcontainer/devcontainer.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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.245.2/containers/python-3
3+
{
4+
"name": "Python 3",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"context": "..",
8+
"args": {
9+
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
10+
// Append -bullseye or -buster to pin to an OS version.
11+
// Use -bullseye variants on local on arm64/Apple Silicon.
12+
"VARIANT": "3.8",
13+
// Options
14+
"NODE_VERSION": "none"
15+
}
16+
},
17+
// Configure tool-specific properties.
18+
"customizations": {
19+
// Configure properties specific to VS Code.
20+
"vscode": {
21+
// Set *default* container specific settings.json values on container create.
22+
"settings": {
23+
"python.defaultInterpreterPath": "/home/vscode/conda/bin/python",
24+
"python.linting.enabled": true,
25+
"python.linting.pylintEnabled": true,
26+
"python.formatting.provider": "black",
27+
"editor.formatOnSave": true
28+
},
29+
// Add the IDs of extensions you want installed when the container is created.
30+
"extensions": [
31+
"ms-python.python",
32+
"ms-python.vscode-pylance"
33+
]
34+
}
35+
},
36+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
37+
// "forwardPorts": [],
38+
// Use 'postCreateCommand' to run commands after the container is created.
39+
"postCreateCommand": "conda init && poetry config virtualenvs.create false && poetry install",
40+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
41+
"remoteUser": "vscode",
42+
"features": {
43+
"git": "os-provided",
44+
}
45+
}

.devcontainer/mamba_environment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: base
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
dependencies:
6+
# TODO lock versions?
7+
- python=3.10
8+
- mamba
9+
- fastp
10+
- python-annoy
11+
- tox
12+
- poetry

.dockerignore

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Ignore everything
2+
.github
3+
cue.mod
4+
docker-bake.hcl
5+
docs
6+
CHANGELOG.md
7+
pytest-results
8+
conda-recipe
9+
10+
# Dockerfiles
11+
*.Dockerfile
12+
13+
# Editors
14+
.idea
15+
.vscode
16+
17+
18+
# Tools caches
19+
.mypy_cache
20+
.pytest_cache
21+
.ruff_cache
22+
.tox
23+
.coverage
24+
.coverage.*
25+
.cache
26+
27+
# Misc
28+
**/*.pyc
29+
playground/
30+
__pycache__/
31+
*.py[cod]
32+
*$py.class
33+
*.so
34+
.Python
35+
env/
36+
build/
37+
develop-eggs/
38+
dist/
39+
downloads/
40+
eggs/
41+
.eggs/
42+
lib/
43+
lib64/
44+
parts/
45+
sdist/
46+
var/
47+
wheels/
48+
*.egg-info/
49+
.installed.cfg
50+
*.egg
51+
*.manifest
52+
*.spec
53+
pip-log.txt
54+
pip-delete-this-directory.txt
55+
htmlcov/
56+
.tox/
57+
.coverage
58+
.coverage.*
59+
.cache
60+
nosetests.xml
61+
coverage.xml
62+
*.cover
63+
.hypothesis/
64+
.pytest_cache/
65+
*.mo
66+
*.pot
67+
*.log
68+
local_settings.py
69+
instance/
70+
.webassets-cache
71+
.scrapy
72+
docs/_build/
73+
target/
74+
.ipynb_checkpoints
75+
.python-version
76+
celerybeat-schedule
77+
*.sage.py
78+
.env
79+
.venv
80+
venv/
81+
ENV/
82+
.spyderproject
83+
.spyproject
84+
.ropeproject
85+
/site

.editorconfig

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.{yaml,yml}]
14+
indent_style = space
15+
indent_size = 2
16+
trim_trailing_whitespace = true
17+
insert_final_newline = true
18+
charset = utf-8
19+
end_of_line = lf
20+
21+
[*.json]
22+
indent_size = 2
23+
24+
[*.bat]
25+
indent_style = tab
26+
end_of_line = crlf
27+
28+
[LICENSE]
29+
insert_final_newline = false
30+
31+
[Makefile]
32+
indent_style = tab

.flake8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
extend-ignore = E501,E402,W503,E203,D213,D203,DOC301
3+
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,cue.mod
4+
docstring-convention = all
5+
style = sphinx
6+
require-return-section-when-returning-none = False
7+
arg-type-hints-in-signature = True
8+
arg-type-hints-in-docstring = False

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/pixelator/report/webreport/template.html linguist-vendored

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!--
2+
# Pixelgen Technologies pull request template
3+
4+
Many thanks for contributing to it if you think it could be improved. This is a self-improving process!
5+
6+
Please fill in the appropriate checklist below (delete whatever is not relevant).
7+
These are the most common things requested on pull requests (PRs).
8+
9+
Remember that PRs should be made against the dev branch, unless you're preparing a pipeline release.
10+
11+
Learn more about contributing: [CONTRIBUTING.md](https://github.com/PixelgenTechnologies/pixelator/blob/main/CONTRIBUTING.md)
12+
-->
13+
14+
## Description
15+
16+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
17+
18+
Fixes # (issue)
19+
20+
## Type of change
21+
22+
Please delete options that are not relevant.
23+
24+
- [ ] Bug fix (non-breaking change which fixes an issue)
25+
- [ ] New feature (non-breaking change which adds functionality)
26+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
27+
- [ ] This change requires a documentation update
28+
29+
## How Has This Been Tested?
30+
31+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
32+
33+
- [ ] Test A
34+
- [ ] Test B
35+
36+
**Test Configuration**:
37+
* Firmware version:
38+
* Hardware:
39+
* Toolchain:
40+
* SDK:
41+
42+
## PR checklist:
43+
44+
- [ ] This comment contains a description of changes (with reason).
45+
- [ ] My code follows the style guidelines of this project
46+
- [ ] Make sure your code lints, is well-formatted and type checks
47+
- [ ] I have performed a self-review of my own code
48+
- [ ] I have commented my code, particularly in hard-to-understand areas
49+
- [ ] I have made corresponding changes to the documentation
50+
- [ ] My changes generate no new warnings
51+
- [ ] I have added tests that prove my fix is effective or that my feature works
52+
- [ ] If you've added a new stage - have you followed the pipeline CLI conventions in the [USAGE guide](../USAGE.md)
53+
- [ ] [README.md](./README.md) is updated
54+
- [ ] If a new tool or package is included, update poetry.lock, [the conda recipe](../conda-recipe/pixelator/meta.yaml) and [cited it properly](../CITATIONS.md)
55+
- [ ] Include any new [authors/contributors](../AUTHORS.md)
56+
- [ ] New and existing unit tests pass locally with my changes
57+
- [ ] Any dependent changes have been merged and published in downstream modules
58+
- [ ] I have checked my code and documentation and corrected any misspellings
59+
- [ ] Usage Documentation in [USAGE.md](../USAGE.md) is updated
60+
- [ ] If you are doing a [release](../RELEASING.md#Releasing), or a significant change to the code, update [CHANGELOG.md](../CHANGELOG.md)
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: "build-dev-image"
2+
description: "Build a dev image and push it to the Pixelgen container registries"
3+
inputs:
4+
tag:
5+
description: "The tag to use for the image"
6+
required: true
7+
cache-from:
8+
description: "The cache to use for the build"
9+
default: ""
10+
cache-to:
11+
description: "The cache to push to for the build"
12+
default: ""
13+
platforms:
14+
description: "The platforms to build for (seperated by comma) - defaults to linux/amd64/v3"
15+
default: linux/amd64/v3
16+
17+
outputs:
18+
dev-tag:
19+
description: "The tags that were pushed"
20+
value: ${{ steps.meta.outputs.tags }}
21+
22+
runs:
23+
using: "composite"
24+
steps:
25+
- name: Docker meta
26+
id: meta
27+
uses: docker/metadata-action@v4
28+
with:
29+
images: |
30+
ghcr.io/pixelgentechnologies/pixelator
31+
890888997283.dkr.ecr.eu-north-1.amazonaws.com/pixelator
32+
tags: |
33+
type=ref,event=branch
34+
type=ref,event=pr
35+
type=semver,pattern={{version}}
36+
type=semver,pattern={{major}}.{{minor}}
37+
type=sha
38+
39+
- name: Build input options
40+
id: build_input_options
41+
uses: actions/github-script@v4
42+
with:
43+
script: |
44+
const shaShort = context.sha.substring(0, 7)
45+
const inputParams = ${{ toJSON(inputs) }}
46+
const meta = ${{ steps.meta.outputs.json }}
47+
const tags = meta["tags"]
48+
49+
const cacheFromArray = inputParams["cache-from"].split('\n').map((line) => line.trim())
50+
.filter((line) => line !== "")
51+
.map((line) => "*.cache-from=" + line)
52+
53+
const cacheToArray = inputParams["cache-to"].split('\n').map((line) => line.trim())
54+
.filter((line) => line !== "")
55+
.map((line) => "*.cache-to=" + line)
56+
57+
const tagsArray = tags.map((tag) => "*.tags=" + tag)
58+
59+
const platformArray = inputParams["platforms"].split(',').map((line) => line.trim())
60+
.filter((line) => line !== "")
61+
.map((line) => "*.platform=" + line)
62+
63+
let bakeSetCommands = []
64+
bakeSetCommands.push(...tagsArray)
65+
bakeSetCommands.push(...cacheFromArray)
66+
bakeSetCommands.push(...cacheToArray)
67+
bakeSetCommands.push(...platformArray)
68+
69+
const gitSHAtag = tagsArray.find((tag) => tag.includes('ghcr') && tag.includes('sha'))
70+
71+
bakeSetCommandsText = bakeSetCommands.join('\n')
72+
core.setOutput('set', bakeSetCommandsText)
73+
core.setOutput('dev-tag', gitSHAtag)
74+
75+
76+
- name: Build and push to ghcr and ecr
77+
uses: docker/bake-action@v3
78+
with:
79+
push: true
80+
targets: pixelator-prod
81+
provenance: false
82+
set: ${{ steps.build_input_options.outputs.set }}

0 commit comments

Comments
 (0)