From eb21a6ad68d9919ef573a7d6e1d4ba01ed3a7e7b Mon Sep 17 00:00:00 2001 From: Maarten Sebregts Date: Wed, 11 Jun 2025 10:06:03 +0200 Subject: [PATCH] Remove Bamboo CI scripts --- ci/build_dd_zip.sh | 30 --------------- ci/build_docs_and_dist.sh | 45 ---------------------- ci/linting.sh | 35 ----------------- ci/run_benchmark.sh | 79 --------------------------------------- ci/run_pytest.sh | 46 ----------------------- 5 files changed, 235 deletions(-) delete mode 100755 ci/build_dd_zip.sh delete mode 100755 ci/build_docs_and_dist.sh delete mode 100755 ci/linting.sh delete mode 100755 ci/run_benchmark.sh delete mode 100755 ci/run_pytest.sh diff --git a/ci/build_dd_zip.sh b/ci/build_dd_zip.sh deleted file mode 100755 index 1b95bc4b..00000000 --- a/ci/build_dd_zip.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# Bamboo CI script to build IDSDef.zip -# Note: this script should be run from the root of the git repository - -# Debuggging: -if [[ "$(uname -n)" == *"bamboo"* ]]; then - set -e -o pipefail -fi -echo "Loading modules..." - -# Set up environment such that module files can be loaded -source /etc/profile.d/modules.sh -module purge -# Modules are supplied as arguments in the CI job: -if [ -z "$@" ]; then - module load Python -else - module load $@ -fi - -# Debuggging: -echo "Done loading modules" - -# Build the DD zip -rm -rf venv # Environment should be clean, but remove directory to be sure -python -m venv venv -source venv/bin/activate -pip install gitpython saxonche packaging -python imas/dd_helpers.py -deactivate diff --git a/ci/build_docs_and_dist.sh b/ci/build_docs_and_dist.sh deleted file mode 100755 index f0084b8a..00000000 --- a/ci/build_docs_and_dist.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# Bamboo CI script to install imas Python module and run all tests -# Note: this script should be run from the root of the git repository - -# Debuggging: -if [[ "$(uname -n)" == *"bamboo"* ]]; then - set -e -o pipefail -fi -echo "Loading modules:" $@ - -# Set up environment such that module files can be loaded -source /etc/profile.d/modules.sh -module purge -# Modules are supplied as arguments in the CI job: -module load $@ - -# Debuggging: -echo "Done loading modules" - -# Set up the testing venv -rm -rf venv # Environment should be clean, but remove directory to be sure -python -m venv venv -source venv/bin/activate - -# Create sdist and wheel -pip install --upgrade pip setuptools wheel build -rm -rf dist -python -m build . - -# Install imas Python module and documentation dependencies from the just-built wheel -pip install "`readlink -f dist/*.whl`[docs,netcdf]" - -# Debugging: -pip freeze - -# Enable sphinx options: -# - `-W`: turn warnings into errors -# - `-n`: nit-picky mode, warn about all missing references -# - `--keep-going`: with -W, keep going when getting warnings -export SPHINXOPTS='-W -n --keep-going' - -# Run sphinx to create the documentation -make -C docs clean html - -deactivate diff --git a/ci/linting.sh b/ci/linting.sh deleted file mode 100755 index d9164777..00000000 --- a/ci/linting.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Bamboo CI script for linting -# Note: this script should be run from the root of the git repository - -# Debuggging: -if [[ "$(uname -n)" == *"bamboo"* ]]; then - set -e -o pipefail -fi -echo "Loading modules..." - -# Set up environment such that module files can be loaded -source /etc/profile.d/modules.sh -module purge -# Modules are supplied as arguments in the CI job: -if [ -z "$@" ]; then - module load Python -else - module load $@ -fi - -# Debuggging: -echo "Done loading modules" - -# Create a venv -rm -rf venv -python -m venv venv -. venv/bin/activate - -# Install and run linters -pip install --upgrade 'black >=24,<25' flake8 - -black --check imas -flake8 imas - -deactivate \ No newline at end of file diff --git a/ci/run_benchmark.sh b/ci/run_benchmark.sh deleted file mode 100755 index ae24ce2d..00000000 --- a/ci/run_benchmark.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# Bamboo CI script to install imas Python module and run all tests -# Note: this script should be run from the root of the git repository - -# Debuggging: - -echo "Loading modules:" $@ -BENCHMARKS_DIR=$(realpath "$PWD/imas_benchmarks") -if [[ "$(uname -n)" == *"bamboo"* ]]; then - set -e -o pipefail - # create - BENCHMARKS_DIR=$(realpath "/mnt/bamboo_deploy/imas/benchmarks/") -fi - -# Set up environment such that module files can be loaded -source /etc/profile.d/modules.sh -module purge -# Modules are supplied as arguments in the CI job: -# IMAS-AL-Python/5.2.1-intel-2023b-DD-3.41.0 Saxon-HE/12.4-Java-21 -if [ -z "$@" ]; then - module load IMAS-AL-Core -else - module load $@ -fi - - - -# Debuggging: -echo "Done loading modules" - -# Export current PYTHONPATH so ASV benchmarks can import imas -export ASV_PYTHONPATH="$PYTHONPATH" - -# Set up the testing venv -rm -rf venv # Environment should be clean, but remove directory to be sure -python -m venv venv -source venv/bin/activate - -# Install asv and imas -pip install --upgrade pip setuptools wheel -pip install virtualenv .[test] - -# Generate MDS+ models cache -python -c 'import imas.backends.imas_core.mdsplus_model; print(imas.backends.imas_core.mdsplus_model.mdsplus_model_dir(imas.IDSFactory()))' - -# Copy previous results (if any) -mkdir -p "$BENCHMARKS_DIR/results" -mkdir -p .asv -cp -rf "$BENCHMARKS_DIR/results" .asv/ - -# Ensure numpy won't do multi-threading -export OPENBLAS_NUM_THREADS=1 -export MKL_NUM_THREADS=1 -export OMP_NUM_THREADS=1 - -# Ensure there is a machine configuration -asv machine --yes - -# Run ASV for the current commit, develop and main -asv run --skip-existing-successful HEAD^! -asv run --skip-existing-successful develop^! -asv run --skip-existing-successful main^! - -# Compare results -if [ `git rev-parse --abbrev-ref HEAD` == develop ] -then - asv compare main develop --machine $(hostname) || echo "asv compare failed" -else - asv compare develop HEAD --machine $(hostname) || echo "asv compare failed" -fi - -# Publish results -asv publish - -# And persistently store them -cp -rf .asv/{results,html} "$BENCHMARKS_DIR" - - - diff --git a/ci/run_pytest.sh b/ci/run_pytest.sh deleted file mode 100755 index 4af184dc..00000000 --- a/ci/run_pytest.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# Bamboo CI script to install imas Python module and run all tests -# Note: this script should be run from the root of the git repository - -# Debuggging: -if [[ "$(uname -n)" == *"bamboo"* ]]; then - set -e -o pipefail -fi -echo "Loading modules:" $@ - -# Set up environment such that module files can be loaded -source /etc/profile.d/modules.sh -module purge -# Modules are supplied as arguments in the CI job: -if [ -z "$@" ]; then - module load IMAS-AL-Core Java MDSplus -else - module load $@ -fi - -# Debuggging: -echo "Done loading modules" - -# Set up the testing venv -rm -rf venv # Environment should be clean, but remove directory to be sure -python -m venv venv -source venv/bin/activate - -# Install imas and test dependencies -pip install --upgrade pip setuptools wheel -pip install .[h5py,netcdf,test] - -# Debugging: -pip freeze - -# Run pytest -# Clean artifacts created by pytest -rm -f junit.xml -rm -rf htmlcov - -# setups local directory to not to full /tmp directory with pytest temporary files -# mkdir -p ~/tmp -# export PYTEST_DEBUG_TEMPROOT=~/tmp -python -m pytest -n=auto --cov=imas --cov-report=term-missing --cov-report=html --junit-xml=junit.xml - -