From ba4a5327844152c40643125d267456cb9800f4f5 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 24 Apr 2023 16:23:02 -0500 Subject: [PATCH 1/3] Bumped package version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 014b452..48e2157 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = splitmsa -version = 0.0.3 +version = 0.0.4 [options] packages = splitmsa From bfeec687565795fdf92d1701c23df1c009c755ae Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Sun, 21 Jul 2024 02:52:25 +0000 Subject: [PATCH 2/3] Added devcontainer to pipeline. --- .devcontainer/Dockerfile | 11 +++++++++++ .devcontainer/devcontainer.json | 24 ++++++++++++++++++++++++ .devcontainer/noop.txt | 3 +++ Jenkinsfile | 24 ++++++++++++------------ 4 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/noop.txt diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..2738918 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,11 @@ +FROM mcr.microsoft.com/devcontainers/anaconda: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 this section to install additional OS packages. +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..70e91b2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,24 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/anaconda +{ + "name": "Anaconda (Python 3)", + "build": { + "context": "..", + "dockerfile": "Dockerfile" + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "python --version", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/noop.txt b/.devcontainer/noop.txt new file mode 100644 index 0000000..dde8dc3 --- /dev/null +++ b/.devcontainer/noop.txt @@ -0,0 +1,3 @@ +This file copied into the container along with environment.yml* from the parent +folder. This file is included to prevents the Dockerfile COPY instruction from +failing if no environment.yml is found. \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 9166532..fe35108 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,26 +1,26 @@ pipeline { - agent any - stages { - stage("clean") { - steps { - sh 'rm -rf ./dist/*' - } + agent { + kubernetes { + cloud 'Reslate Systems' + defaultContainer 'conda' } + } + stages { stage("install") { steps { - sh 'mamba env update --file environment.yml' - sh 'echo "mamba activate splitmsa" >> ~/.bashrc' + sh 'conda update conda -y -q' + sh 'conda env update -n base --file environment.yml' } } stage("build") { steps { - sh "python -m build" + sh "conda run -n base python -m build" } } stage("test") { steps { - sh "pip install dist/*.whl" - sh "splitmsa -h" + sh "conda run -n base pip install dist/*.whl" + sh "conda run -n base splitmsa -h" } } stage("archive") { @@ -34,7 +34,7 @@ pipeline { } steps { withCredentials([usernamePassword(credentialsId: 'rs-git-package-registry-ydeng', passwordVariable: 'PASS', usernameVariable: 'USER')]) { - sh "python -m twine upload --repository-url https://git.reslate.systems/api/packages/${USER}/pypi -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*" + sh "conda run -n base python -m twine upload --repository-url https://git.reslate.systems/api/packages/${USER}/pypi -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*" } } } From 9d97ee6244631f1558fc3a9c430f00401a35776a Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Sun, 21 Jul 2024 02:54:01 +0000 Subject: [PATCH 3/3] Added some extensions for the devcontainer. --- .devcontainer/devcontainer.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 70e91b2..edc63c0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,6 +5,17 @@ "build": { "context": "..", "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-python.debugpy", + "ms-python.python", + "ms-python.vscode-pylance", + "ms-python.black-formatter", + "ms-python.flake8" + ] + } } // Features to add to the dev container. More info: https://containers.dev/features.