From ba344c537938a5827c2c5a06f034c8ea12a77535 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Fri, 17 Sep 2021 13:38:09 +0100 Subject: [PATCH 1/4] update mantidimaging-data urls --- .github/workflows/conda.yml | 5 +++-- mantidimaging/eyes_tests/base_eyes.py | 6 +++--- mantidimaging/gui/test/gui_system_base.py | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index db53e4c75ad..1214dce227f 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -70,8 +70,9 @@ jobs: - name: Get test data shell: bash -l {0} run: | - wget -nv https://github.com/mantidproject/mantidimaging-data/archive/refs/heads/master.zip - unzip -q master.zip -d ~ + wget -nv https://github.com/mantidproject/mantidimaging-data/archive/refs/heads/main.zip + unzip -q main.zip -d ~ + mv ~/mantidimaging-data-main ~/mantidimaging-data timeout-minutes: 5 - name: GUI Tests System diff --git a/mantidimaging/eyes_tests/base_eyes.py b/mantidimaging/eyes_tests/base_eyes.py index ef61ff6dccb..a3aa8a3b0ad 100644 --- a/mantidimaging/eyes_tests/base_eyes.py +++ b/mantidimaging/eyes_tests/base_eyes.py @@ -29,12 +29,12 @@ if TEST_NAME is None: TEST_NAME = f"{getpass.getuser()}'s Local Test" -LOAD_SAMPLE = str(Path.home()) + "/mantidimaging-data-master/ISIS/IMAT/IMAT00010675/Tomo/IMAT_Flower_Tomo_000000.tif" +LOAD_SAMPLE = str(Path.home()) + "/mantidimaging-data/ISIS/IMAT/IMAT00010675/Tomo/IMAT_Flower_Tomo_000000.tif" LOAD_SAMPLE_MISSING_MESSAGE = """Data not present, please clone to your home directory e.g. -git clone https://github.com/mantidproject/mantidimaging-data.git ~/mantidimaging-data-master""" +git clone https://github.com/mantidproject/mantidimaging-data.git""" NEXUS_SAMPLE = str( - Path.home()) + "/mantidimaging-data-master/Diamond/i13/AKingUVA_7050wSSwire_InSitu_95RH_2MMgCl2_p4ul_p4h/24737.nxs" + Path.home()) + "/mantidimaging-data/Diamond/i13/AKingUVA_7050wSSwire_InSitu_95RH_2MMgCl2_p4ul_p4h/24737.nxs" APPLITOOLS_IMAGE_DIR = os.getenv("APPLITOOLS_IMAGE_DIR") if APPLITOOLS_IMAGE_DIR is None: diff --git a/mantidimaging/gui/test/gui_system_base.py b/mantidimaging/gui/test/gui_system_base.py index 5f7b1daac2b..605bbcfb019 100644 --- a/mantidimaging/gui/test/gui_system_base.py +++ b/mantidimaging/gui/test/gui_system_base.py @@ -19,9 +19,9 @@ versions._use_test_values() -LOAD_SAMPLE = str(Path.home()) + "/mantidimaging-data-master/ISIS/IMAT/IMAT00010675/Tomo/IMAT_Flower_Tomo_000000.tif" +LOAD_SAMPLE = str(Path.home()) + "/mantidimaging-data/ISIS/IMAT/IMAT00010675/Tomo/IMAT_Flower_Tomo_000000.tif" LOAD_SAMPLE_MISSING_MESSAGE = """Data not present, please clone to your home directory e.g. -git clone https://github.com/mantidproject/mantidimaging-data.git ~/mantidimaging-data-master""" +git clone https://github.com/mantidproject/mantidimaging-data.git""" SHOW_DELAY = 10 # Can be increased to watch tests SHORT_DELAY = 100 From c4e64131db76ef1032c68ada3f8e1b72b2304ee6 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Fri, 17 Sep 2021 16:01:22 +0100 Subject: [PATCH 2/4] Remove unused Jenkins scripts --- buildscripts/Jenkinsfile | 115 ----------------------- buildscripts/create_conda_environment.sh | 22 ----- buildscripts/install_anaconda.sh | 37 -------- 3 files changed, 174 deletions(-) delete mode 100644 buildscripts/Jenkinsfile delete mode 100755 buildscripts/create_conda_environment.sh delete mode 100755 buildscripts/install_anaconda.sh diff --git a/buildscripts/Jenkinsfile b/buildscripts/Jenkinsfile deleted file mode 100644 index 16d03260cbc..00000000000 --- a/buildscripts/Jenkinsfile +++ /dev/null @@ -1,115 +0,0 @@ -pipeline { - agent { - label 'mantidimaging' - } - - stages { - stage('Setup - Miniconda') { - steps { - timeout(15) { - sh """ - export PATH=${WORKSPACE}/anaconda/bin:$PATH - ${WORKSPACE}/source/buildscripts/install_anaconda.sh -b - conda install -y conda-build - conda install -y anaconda-client - """ - } - } - } - - stage('Setup - Python 3.5') { - steps { - timeout(30) { - sh """ - export PATH=${WORKSPACE}/anaconda/bin:$PATH - ${WORKSPACE}/source/buildscripts/create_conda_environment.sh ${WORKSPACE}/source/environment.yml mi35 - """ - } - } - } - - stage('Test - Python 3.5') { - steps { - timeout(2) { - sh """ - export PATH=${WORKSPACE}/anaconda/envs/mi35/bin:$PATH - cd ${WORKSPACE}/source - git clean -xdf --exclude="anaconda*" - nosetests --with-coverage --xunit-file=${WORKSPACE}/python35_nosetests.xml --xunit-testsuite-name=python35_nosetests || true - """ - junit '**/python35_nosetests.xml' - } - } - } - - stage('Static Analysis - Flake8') { - steps { - timeout(5) { - sh """ - export PATH=${WORKSPACE}/anaconda/envs/mi35/bin:$PATH - rm -f ${WORKSPACE}/flake8.log - cd ${WORKSPACE}/source/mantidimaging - flake8 --exit-zero --output-file=${WORKSPACE}/flake8.log - """ - step([$class: 'WarningsPublisher', parserConfigurations: [[parserName: 'Flake8', pattern: 'flake8.log']]]) - } - } - } - - stage('Documentation - HTML') { - steps { - timeout(1) { - sh """ - export PATH=${WORKSPACE}/anaconda/envs/mi35/bin:$PATH - cd ${WORKSPACE}/source - python setup.py docs_api - python setup.py docs -b html - """ - warnings consoleParsers: [[parserName: 'Sphinx-build']] - } - } - } - - stage('Documentation - QtHelp') { - steps { - timeout(1) { - sh """ - export PATH=${WORKSPACE}/anaconda/envs/mi35/bin:$PATH - cd ${WORKSPACE}/source - python setup.py docs -b qthelp - """ - } - } - } - - stage('Package - Conda') { - steps { - timeout(30) { - sh """ - export PATH=${WORKSPACE}/anaconda/bin:$PATH - rm -rf ${WORKSPACE}/mantidimaging_conda - conda-build --croot ${WORKSPACE}/mantidimaging_conda -c conda-forge ${WORKSPACE}/source/conda/mantidimaging - tar -cvzf ${WORKSPACE}/mantidimaging_conda.tar.gz ${WORKSPACE}/mantidimaging_conda/ - """ - archiveArtifacts 'mantidimaging_conda.tar.gz' - } - } - } - - stage('Package - Publish') { - when { - expression { - return env.GIT_BRANCH == 'origin/master'; - } - } - steps { - withCredentials([string(credentialsId: 'anaconda-cloud-token', variable: 'ANACONDA_CLOUD_TOKEN')]) { - sh """ - export PATH=${WORKSPACE}/anaconda/bin:$PATH - anaconda -t $ANACONDA_CLOUD_TOKEN upload --force -u mantid -l nightly `ls mantidimaging_conda/linux-64/mantidimaging-*.tar.bz2` - """ - } - } - } - } -} diff --git a/buildscripts/create_conda_environment.sh b/buildscripts/create_conda_environment.sh deleted file mode 100755 index a948430520b..00000000000 --- a/buildscripts/create_conda_environment.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -anaconda_dir="`pwd`"/anaconda/ - -env_file=$1 -env_name=$2 - -env_dir=${anaconda_dir}/envs/${env_name} - -# Check if the environment already exists -if [ ! -d "$env_dir" ] -then - # Create the environment - echo "Creating environment ${env_name}..." - ${anaconda_dir}/bin/conda env create -n ${env_name} -f ${env_file} -else - echo "Environment ${env_name} already exists, updating..." - ${anaconda_dir}/bin/conda env update -n ${env_name} -f ${env_file} -fi - -echo "Environment directory: ${env_dir}" -ls -la ${env_dir} diff --git a/buildscripts/install_anaconda.sh b/buildscripts/install_anaconda.sh deleted file mode 100755 index 8aec6fc7340..00000000000 --- a/buildscripts/install_anaconda.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -anaconda_url="https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh" - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -anaconda_dir="`pwd`"/anaconda/ -anaconda_bin="$anaconda_dir"/bin -anaconda_install_args="" - -while getopts ":b" o; do - case "${o}" in - b) - anaconda_install_args="-b" - ;; - esac -done - -echo "Anaconda directory: $anaconda_dir" -echo "Anaconda bin directory: $anaconda_bin" -echo "Anaconda installer arguments: $anaconda_install_args" - -# Ensure Anaconda exists in this workspace -if [ ! -d "$anaconda_dir" ] -then - echo "Anaconda (Python 3) not found in this workspace, installing now..." - installer=anaconda_installer.sh - wget $anaconda_url -O $installer - chmod +x $installer - ./$installer -p "$anaconda_dir" "$anaconda_install_args" - rm $installer -else - echo "Anaconda already exists in this workspace" -fi - -echo "Anaconda directory: $anaconda_dir" -ls -la "$anaconda_dir" From e5df26ec014f3b3fbf62f23111bdf1487f0ac026 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Fri, 17 Sep 2021 16:34:03 +0100 Subject: [PATCH 3/4] Remove old install script --- install.sh | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100755 install.sh diff --git a/install.sh b/install.sh deleted file mode 100755 index 36bb379ffde..00000000000 --- a/install.sh +++ /dev/null @@ -1,36 +0,0 @@ -# To run this script use source ./install.sh, or the version on master -# source <(curl -s https://raw.githubusercontent.com/mantidproject/mantidimaging/master/install.sh) -# source is used so that the shell environment is inherited - this is needed for conda access! -# -# Supported configuration: -# - ENVIRONMENT_NAME - specifies the environment name, default `mantidimaging` -# - For nightly it will be called `mantidimaging_unstable` -# - REPO_LABEL - specifies the label from which it will be installed, default `main`, -# - For nightly it will use `unstable` - -if ! command -v conda &> /dev/null -then - echo "'conda' not available, please activate Anaconda before calling this script" - return -fi - -env_name=${ENVIRONMENT_NAME:-mantidimaging} -repo_label=${REPO_LABEL:-main} - -echo "Installing mantidimaging in environment with name '${env_name}' and repo label '${repo_label}'" - -conda config --set always_yes yes - -conda remove -n ${env_name} --all - -conda config --prepend channels conda-forge # for most of the deps -conda config --prepend channels astra-toolbox/label/dev # for astra -conda config --prepend channels dtasev # for sarepy -conda config --prepend channels mantid # for mantidimaging - -conda create -c mantid/label/${repo_label} -n ${env_name} mantidimaging python=3.8 - -conda activate ${env_name} -pip install pyqt5==5.15 pyqtgraph==0.11 - -conda config --set always_yes no From 8d9e761cb528c4a925d8b94afee2eb8f311a7190 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Fri, 17 Sep 2021 16:35:45 +0100 Subject: [PATCH 4/4] Update link to example data --- docs/user_guide/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guide/index.rst b/docs/user_guide/index.rst index d0577a2ad80..b8edb9cbdef 100644 --- a/docs/user_guide/index.rst +++ b/docs/user_guide/index.rst @@ -19,7 +19,7 @@ Author: Arianna Wintle (STFC) Please email any suggestions to mantidimagingsupport@stfc365.onmicrosoft.com -Example data that can be used for this tutorial can be downloaded from `github.com/mantidproject/mantidimaging-data `_ +Example data that can be used for this tutorial can be downloaded from `github.com/mantidproject/mantidimaging-data `_ Loading Sample Stack ####################