From 5461dc456487f6115d44c5ff04b12b14abc63196 Mon Sep 17 00:00:00 2001 From: Romain Floreani Date: Thu, 30 Jul 2026 13:25:57 -0400 Subject: [PATCH] Moved azure-pipeline code to geopy-distrib --- ...emplate-test-minimal-conda-env-install.yml | 188 ------------------ 1 file changed, 188 deletions(-) delete mode 100644 .azure-pipelines/template-test-minimal-conda-env-install.yml diff --git a/.azure-pipelines/template-test-minimal-conda-env-install.yml b/.azure-pipelines/template-test-minimal-conda-env-install.yml deleted file mode 100644 index c0a9842..0000000 --- a/.azure-pipelines/template-test-minimal-conda-env-install.yml +++ /dev/null @@ -1,188 +0,0 @@ -# File: template-test-minimal-conda-env-install.yml -parameters: - - name: pythonVersion - type: string - default: '3.12' - # Determines the type of package repository to use for testing installation (prod or dev). - - name: environment - type: string - default: prod - values: - - prod - - dev - # Maps environment names to the repositories required for each environment. - - name: envToVirtualRepos - type: object - default: - geoplus: - - geoplus - - gempy - geology: - - geology - - gempy - geophysics: - - geophysics - - gempy - interop: - - public - simpeg: - - public - - name: envToRemoteRepos - type: object - default: - geoplus: - - conda-forge - geology: - - conda-forge - geophysics: - - conda-forge - interop: - - conda-forge - simpeg: - - conda-forge - -stages: - - stage: TestInstallationOnMinimalCondaEnv - displayName: Test installation on minimal conda environment - pool: - vmImage: 'ubuntu-latest' - jobs: - - job: DiscoverFiles - displayName: Discover environment files package - steps: - - task: Bash@3 - name: DiscoverFiles - displayName: Discover environment files and create strategy matrix - inputs: - targetType: 'inline' - script: | - buildEnvFolder="build/envs" - artifactFolder="artifact_envFiles" - - # Create test directories and files - mkdir -p "environments" "$artifactFolder" - - # DiscoverFiles - fileSuffix="py${{ replace(parameters.pythonVersion, '.', '') }}-win-64.conda.lock.yml" - envFiles=$(find $buildEnvFolder -name "*-$fileSuffix") - if [[ -z "$envFiles" ]]; then - echo "No '*-$fileSuffix' environment files found in directory '$buildEnvFolder'" - exit 1 - fi - - envToVirtualReposJson='${{ convertToJson(parameters.envToVirtualRepos) }}' - envToRemoteReposJson='${{ convertToJson(parameters.envToRemoteRepos) }}' - - # Initialize the matrix JSON - matrix="{}" - - # Iterate through each key-value pair in envToVirtualRepos - while read -r entry; do - key=$(echo "$entry" | jq -r '.key') - value=$(echo "$entry" | jq -r '.value') - envFilename=$key-$fileSuffix - envFile=$buildEnvFolder/$envFilename - if [ ! -f "$envFile" ]; then - echo "No matching file found for '$key', skipping..." - continue - fi - - # Check if value is an array or a string - if [[ "$value" == "["*"]" ]]; then - repos=$(echo "$value" | jq -r '. | join(" ")') - else - repos=$value - fi - - # also add repos from envToRemoteRepos for the current key - remoteRepos=$(echo "$envToRemoteReposJson" | jq -r ".$key | join(\" \")") - - # Create object - object_string=$( jq -n \ - --arg envType "$key" \ - --arg filename "$envFilename" \ - --arg repositories "$repos" \ - --arg remotes "$remoteRepos" \ - '{ ($envType): {name: $envType, filename: $filename, repositories: $repositories, remotes: $remotes }}' ) - - # Merge with the main json_obj - matrix=$(echo "$matrix" | jq ". + $object_string") - - # Copy matching files to the artifact folder - cp "$envFile" "$artifactFolder/" - done < <(echo "$envToVirtualReposJson" | jq -c 'to_entries[]') - - if [ -z "$(ls -A $artifactFolder)" ]; then - echo "No environment files were copied to '$artifactFolder'. Exiting." - exit 1 - fi - - # Save and output the final matrix - json_matrix=$(echo $matrix | jq -c .) - echo "##vso[task.setvariable variable=matrix;isOutput=true]$json_matrix" - - publish: 'artifact_envFiles/' - artifact: envFiles - displayName: Publish environment files - - job: TestInstallation - displayName: Test environment installation - pool: - vmImage: 'windows-2022' - container: - image: ghcr.io/mirageoscience/windows-servercore-ltsc2022-micromamba:latest - endpoint: mira-github-docker - dependsOn: DiscoverFiles - strategy: - matrix: $[ dependencies.DiscoverFiles.outputs['DiscoverFiles.matrix'] ] - variables: - - group: MIRA_PYTHON - steps: - - checkout: none - - download: current - artifact: envFiles - - task: PowerShell@2 - name: ConfigureCondaSources - displayName: Configure Conda sources - inputs: - targetType: 'inline' - script: | - $conda_channels = "" - $conda_virtual_repos = "$(repositories)".Split(" ") - if ($conda_virtual_repos -ne "") { - foreach ($repo in $conda_virtual_repos) { - $repo_name = "${repo}-noremote-conda-${{ parameters.environment }}" - echo "Adding Conda channel for '${repo_name}'" - $url = "https://$(JFROG_ARTIFACTORY_USER):$(JFROG_ARTIFACTORY_TOKEN)@$(JFROG_ARTIFACTORY_URL)/conda/${repo_name}" - if ($conda_channels -ne "") { - $conda_channels += "," - } - $conda_channels += $url - } - } - - $remote_repos = "$(remotes)".Split(" ") -join "," - echo "Adding Conda channels: ${remote_repos}" - if ($conda_channels -and $remote_repos) { - $conda_channels += "," - } - $conda_channels += "${remote_repos}" - echo "##vso[task.setvariable variable=conda_channels;issecret=true]$conda_channels" - - task: PowerShell@2 - name: InstallEnvironment - displayName: Install environment - inputs: - targetType: 'inline' - script: | - $Env:CONDA_CHANNELS = "$(conda_channels)" - $Env:MAMBA_CHANNEL_ALIAS = "https://repo.prefix.dev" - $Env:MAMBA_CHANNEL_PRIORITY = "strict" # make sure Artifactory takes precedence over conda-forge - $Env:PIP_NO_DEPS = 1 - cd $(Pipeline.Workspace)/envFiles - micromamba --no-rc env create -y -f $(filename) -n $(name) - - task: PowerShell@2 - name: CheckEnvironment - displayName: Check environment - inputs: - targetType: 'inline' - script: | - micromamba --no-rc run -n $(name) python -c "import geoh5py; print(f'geoh5py version: {geoh5py.__version__}')" - micromamba --no-rc run -n $(name) python -c "import numpy; print(f'numpy version: {numpy.__version__}')"