Skip to content

Commit

Permalink
Merge pull request #45 from nsls2-conda-envs/2024-3.0
Browse files Browse the repository at this point in the history
2024-3.0 py311/312 envs
  • Loading branch information
mrakitin authored Oct 31, 2024
2 parents 76bb141 + d868b4d commit 25064c5
Show file tree
Hide file tree
Showing 8 changed files with 314 additions and 1,370 deletions.
76 changes: 20 additions & 56 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

defaults:
run:
shell: bash -lvxeo pipefail {0}
shell: bash -leo pipefail {0}

steps:
- name: Checkout the code
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Set env vars
run: |
set -vxeuo pipefail
set -euo pipefail
export REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} # just the repo, as opposed to org/repo
echo "REPOSITORY_NAME=${REPOSITORY_NAME}" >> $GITHUB_ENV
Expand All @@ -54,6 +54,12 @@ jobs:
export CONDA_PACK_ENV_NAME=${env_name}
echo "CONDA_PACK_ENV_NAME=${CONDA_PACK_ENV_NAME}" >> $GITHUB_ENV
export ARTIFACTS_DIR="$HOME/artifacts"
echo "ARTIFACTS_DIR=${ARTIFACTS_DIR}" >> $GITHUB_ENV
if [ ! -d "${ARTIFACTS_DIR}" ]; then
mkdir -v -p "${ARTIFACTS_DIR}"
fi
env | sort -u
# - uses: conda-incubator/setup-miniconda@v3
Expand All @@ -74,7 +80,7 @@ jobs:
- name: Check env
run: |
# For reference: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html.
set -vxeuo pipefail
set -euo pipefail
conda info
conda env list
conda list
Expand All @@ -83,73 +89,31 @@ jobs:
conda config --show
printenv | sort
- name: Add packages for py311
if: matrix.python-version == '3.11'
- name: Export of the env .yml file
run: |
conda install -c conda-forge \
"bloptools>=0.7.0" \
"bluesky-darkframes>=0.6.0" \
caproto \
emojis \
happi \
pexpect \
"pyolog>=4.5.0" \
pyserial \
python-confluent-kafka \
pyzenodo3 \
simple-pid \
slack-sdk \
hklpy \
"hxnfly>=0.0.11" \
kkcalc \
ppmac \
"pychx>=4.3.1" \
"xpdacq==1.0.0" \
hunter \
logging_tree \
line_profiler \
pyinstrument \
pyperformance \
botorch \
gpytorch \
ortools-python \
pytorch \
scikit-optimize
conda env export -f ${ARTIFACTS_DIR}/${CONDA_PACK_ENV_NAME}.yml
cat ${ARTIFACTS_DIR}/${CONDA_PACK_ENV_NAME}.yml
# https://github.com/actions/upload-artifact
- name: Upload artifacts for the env .yml file
uses: actions/upload-artifact@v4
with:
name: ${{ env.CONDA_PACK_ENV_NAME }}.yml
path: ${{ env.ARTIFACTS_DIR }}/${{ env.CONDA_PACK_ENV_NAME }}.yml
retention-days: 60

- name: Export files
run: |
set -vxeo pipefail
export ARTIFACTS_DIR="$HOME/artifacts"
echo "ARTIFACTS_DIR=${ARTIFACTS_DIR}" >> $GITHUB_ENV
if [ ! -d "${ARTIFACTS_DIR}" ]; then
mkdir -v -p "${ARTIFACTS_DIR}"
fi
# conda env export -n ${CONDA_PACK_ENV_NAME} -f ${ARTIFACTS_DIR}/${CONDA_PACK_ENV_NAME}.yml -c conda-forge --override-channels
conda env export -f ${ARTIFACTS_DIR}/${CONDA_PACK_ENV_NAME}.yml
# Per https://conda.github.io/conda-pack/cli.html:
conda-pack -o ${ARTIFACTS_DIR}/${CONDA_PACK_ENV_NAME}.tar.gz --ignore-missing-files --ignore-editable-packages
openssl sha256 ${ARTIFACTS_DIR}/${CONDA_PACK_ENV_NAME}.tar.gz > ${ARTIFACTS_DIR}/${CONDA_PACK_ENV_NAME}-sha256sum.txt
openssl md5 ${ARTIFACTS_DIR}/${CONDA_PACK_ENV_NAME}.tar.gz > ${ARTIFACTS_DIR}/${CONDA_PACK_ENV_NAME}-md5sum.txt
chmod -v 664 ${ARTIFACTS_DIR}/${CONDA_PACK_ENV_NAME}[.-]*
- name: Contents of the env .yml file
run: |
cat ${ARTIFACTS_DIR}/${CONDA_PACK_ENV_NAME}.yml
- name: Checksum files
run: |
cat ${ARTIFACTS_DIR}/*sum.txt
# https://github.com/actions/upload-artifact
- name: Upload artifacts for the env .yml file
uses: actions/upload-artifact@v4
with:
name: ${{ env.CONDA_PACK_ENV_NAME }}.yml
path: ${{ env.ARTIFACTS_DIR }}/${{ env.CONDA_PACK_ENV_NAME }}.yml
retention-days: 60

- name: Upload artifacts for branch
if: |
github.ref != 'refs/heads/main'
Expand Down
4 changes: 2 additions & 2 deletions configs/config-py310.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
docker_image: "quay.io/condaforge/linux-anvil-cos7-x86_64:latest"
env_name: "2024-2.3-py310-tiled"
env_name: "2024-3.0-py310-tiled"
conda_env_file: "env-py310.yml"
conda_binary: "mamba"
python_version: "3.10"
Expand All @@ -19,7 +19,7 @@ zenodo_metadata:
title: "NSLS-II collection conda environment"
upload_type: "software"
description: "NSLS-II collection conda environment"
version: 2024-2.3-tiled
version: 2024-3.0-tiled
creators:
- name: Rakitin, Max
affiliation: "Brookhaven National Laboratory"
Expand Down
4 changes: 2 additions & 2 deletions configs/config-py311.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
docker_image: "quay.io/condaforge/linux-anvil-cos7-x86_64:latest"
env_name: "2024-2.3-py311-tiled"
env_name: "2024-3.0-py311-tiled"
conda_env_file: "env-py311.yml"
conda_binary: "mamba"
python_version: "3.11"
Expand All @@ -19,7 +19,7 @@ zenodo_metadata:
title: "NSLS-II collection conda environment"
upload_type: "software"
description: "NSLS-II collection conda environment"
version: 2024-2.3-tiled
version: 2024-3.0-tiled
creators:
- name: Rakitin, Max
affiliation: "Brookhaven National Laboratory"
Expand Down
4 changes: 2 additions & 2 deletions configs/config-py312.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
docker_image: "quay.io/condaforge/linux-anvil-cos7-x86_64:latest"
env_name: "2024-2.3-py312-tiled"
env_name: "2024-3.0-py312-tiled"
conda_env_file: "env-py312.yml"
conda_binary: "mamba"
python_version: "3.12"
Expand All @@ -19,7 +19,7 @@ zenodo_metadata:
title: "NSLS-II collection conda environment"
upload_type: "software"
description: "NSLS-II collection conda environment"
version: 2024-2.3-tiled
version: 2024-3.0-tiled
creators:
- name: Rakitin, Max
affiliation: "Brookhaven National Laboratory"
Expand Down
Loading

0 comments on commit 25064c5

Please sign in to comment.