Reapply "Began preparing for conda deployment"

This reverts commit 3bbef9ac3e0ca58f6f5f62a1e9bd1d8ae02fd75c.
This commit is contained in:
Harrison Deng 2025-01-20 19:56:51 +00:00
parent c2c6d0b016
commit ade2f3b845
10 changed files with 116 additions and 29 deletions

16
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM mcr.microsoft.com/devcontainers/miniconda:1-3
# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp
# [Optional] Uncomment to install a different version of Python than the default
# RUN conda install -y python=3.6 \
# && pip install --no-cache-dir pipx \
# && pipx reinstall-all
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

View File

@ -1,9 +1,11 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
// README at: https://github.com/devcontainers/templates/tree/main/src/miniconda
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
"name": "Miniconda (Python 3)",
"build": {
"context": "..",
"dockerfile": "Dockerfile"
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
@ -12,18 +14,18 @@
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements.txt",
// "postCreateCommand": "python --version",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"mechatroner.rainbow-csv"
"mechatroner.rainbow-csv",
"piotrpalarz.vscode-gitignore-generator"
]
}
}
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

3
.devcontainer/noop.txt Normal file
View File

@ -0,0 +1,3 @@
This file is copied into the container along with environment.yml* from the
parent folder. This is done to prevent the Dockerfile COPY instruction from
failing if no environment.yml is found.

3
.gitignore vendored
View File

@ -357,4 +357,5 @@ package
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
output
*.private.*
*.private.*
conda-bld

5
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"piotrpalarz.vscode-gitignore-generator"
]
}

26
Jenkinsfile vendored
View File

@ -2,49 +2,55 @@ pipeline {
agent {
kubernetes {
cloud 'rsys-devel'
defaultContainer 'pip'
inheritFrom 'pip'
defaultContainer 'miniforge3'
inheritFrom 'miniforge'
}
}
stages {
stage("install") {
steps {
sh 'python -m pip install -r requirements.txt'
sh 'conda env update -n base -f environment.yml'
}
}
stage("unit tests") {
steps {
sh returnStatus: true, script: "python -m pytest --junitxml=test_results.xml --cov=src --cov-report xml:coverage.xml"
sh returnStatus: true, script: "pytest --junitxml=test_results.xml --cov=src --cov-report xml:coverage.xml"
xunit checksName: '', tools: [JUnit(excludesPattern: '', pattern: 'test_results.xml', stopProcessingIfError: true)]
recordCoverage(tools: [[parser: 'COBERTURA', pattern: 'coverage.xml']])
}
}
stage("build") {
environment {
GIT_AUTHOR_NAME = "Harrison Deng"
GIT_AUTHOR_EMAIL = "yunyangdeng@outlook.com"
}
steps {
sh "python -m build"
sh "conda-build automlst.engine --output-folder conda-bld"
}
}
stage("archive") {
steps {
archiveArtifacts artifacts: 'dist/*.tar.gz, dist/*.whl', fingerprint: true, followSymlinks: false, onlyIfSuccessful: true
archiveArtifacts artifacts: 'dist/*.tar.gz, dist/*.whl conda-bld/**/*.conda', fingerprint: true, followSymlinks: false, onlyIfSuccessful: true
}
}
stage("publish") {
parallel {
stage ("git.reslate.systems") {
stage ("internal") {
environment {
CREDS = credentials('username-password-rs-git')
TOKEN = credentials('git.reslate.systems')
}
steps {
sh returnStatus: true, script: 'python -m twine upload --repository-url https://git.reslate.systems/api/packages/ydeng/pypi -u ${CREDS_USR} -p ${CREDS__PSW} --non-interactive --disable-progress-bar --verbose dist/*'
sh returnStatus: true, script: 'python -m twine upload --repository-url https://git.reslate.systems/api/packages/ydeng/pypi -u __token__ -p ${TOKEN} --non-interactive --disable-progress-bar --verbose dist/*'
}
}
stage ("pypi.org") {
stage ("external") {
when {
tag '*.*'
}
environment {
TOKEN = credentials('pypi.org')
PYPI_TOKEN = credentials('pypi.org')
CONDA_TOKEN = credentials('anaconda.org')
}
steps {
sh returnStatus: true, script: 'python -m twine upload -u __token__ -p ${TOKEN} --non-interactive --disable-progress-bar --verbose dist/*'

43
automlst.engine/meta.yaml Normal file
View File

@ -0,0 +1,43 @@
{% set name = "automlst.engine" %}
{% set version = "0.5.2.dev2+gde36956" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
url: file:///workspaces/automlst.engine/dist/automlst_engine-0.5.2.dev2%2Bgde36956.tar.gz
sha256: 2dee4910744f063b7ec5c923bbf369c23151c82cc59b8b99da19e162414ba61d
build:
noarch: python
script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
number: 0
requirements:
host:
- python >=3.11
- setuptools >=64
- setuptools-scm >=8
- pip
run:
- python >=3.11
- biopython
- aiohttp
test:
imports:
- automlst
commands:
- pip check
requires:
- pip
about:
summary: A library to rapidly fetch fetch MLST profiles given sequences for various diseases.
license: GPL-3.0
license_file: LICENSE
extra:
recipe-maintainers:
- RealYHD

14
environment.yml Normal file
View File

@ -0,0 +1,14 @@
name: base
channels:
- conda-forge
dependencies:
- aiohttp[speedups]
- biopython
- pytest
- pytest-asyncio
- python-build
- twine
- setuptools_scm
- pytest-cov
- grayskull
- conda-build

View File

@ -6,7 +6,12 @@ build-backend = "setuptools.build_meta"
name = "automlst.engine"
dynamic = ["version"]
readme = "README.md"
authors = [
{name = "Harrison Deng"},
]
maintainers = [
{name = "Harrison Deng"},
]
dependencies = [
"biopython",
"aiohttp[speedups]",

View File

@ -1,8 +0,0 @@
aiohttp[speedups]
biopython
pytest
pytest-asyncio
build
twine
setuptools_scm
pytest-cov