Commit 52feaa06 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: test_environment/test_manifest bails out if platform is disabeld,

gen_manifest skips disabled platforms
parent 106c5877
......@@ -16,6 +16,7 @@ from manifest_rules.utils import (load_release_info,
download_file,
sha256,
parse_environment_file_name,
get_platform_identifiers,
generate_development_version_identifier)
......@@ -29,9 +30,15 @@ def load_test_install_info(install_dir):
for fname in inst_files:
with open(fname, 'rt') as f:
lines = f.readlines()
try:
info = lines[-1].strip()
envfile, inst_lines, env_lines = info.split()
envfile, inst_lines, env_lines = info.split()
except Exception:
print(f'Could not parse test install info from: {fname}')
print('Perhaps it corresponds to a platform that is not in '
'FSLCONDA_PLATFORMS?',
os.environ.get('FSLCONDA_PLATFORMS', 'n/a'))
continue
platform = parse_environment_file_name(envfile)[1]
inst_lines = int(inst_lines)
env_lines = int(env_lines)
......@@ -115,11 +122,13 @@ def generate_installer_section(release_info):
def generate_miniconda_section(release_info, install_info):
"""Generates the "miniconda" manifest section, returning a dict. """
section = {}
outputs = install_info.get('miniconda', {})
section = {}
outputs = install_info.get('miniconda', {})
platforms = get_platform_identifiers(release_info)
for platform, url in release_info['miniconda'].items():
if platform not in platforms:
continue
output = outputs.get(platform, None)
with tempdir():
download_file(url, 'miniconda.sh')
......@@ -155,8 +164,9 @@ def generate_version_section(version,
if not include_current_release:
return section
versions = []
section = {version : versions}
versions = []
section = {version : versions}
platforms = get_platform_identifiers(release_info)
for envfile in glob.glob(op.join(envdir, '*.yml')):
......@@ -166,6 +176,9 @@ def generate_version_section(version,
url = urlparse.urljoin(release_info['release-url'], envfile)
version, platform, cuda = parse_environment_file_name(envfile)
if platform not in platforms:
continue
build = {
'platform' : platform,
'environment' : url,
......
......@@ -17,6 +17,7 @@ from manifest_rules.utils import (sprun,
tempdir,
download_file,
load_release_info,
get_platform_identifiers,
parse_environment_file_name)
......@@ -114,9 +115,18 @@ def full_test(envfile, release_info):
def main():
job_name = os.environ['CI_JOB_NAME']
release_file = op.abspath(sys.argv[1])
envfile = op.abspath(sys.argv[2])
release_info = load_release_info(release_file)
platforms = get_platform_identifiers(release_info)
for platform in platforms:
if platform in job_name:
break
else:
print('This platform is disabled')
sys.exit(0)
publish_from_branches = os.environ.get('PUBLISH_FROM_BRANCHES', '')
branch_name = os.environ.get('CI_COMMIT_BRANCH', None)
......
......@@ -7,12 +7,27 @@ import os
import sys
import json
from manifest_rules.utils import sprun, tempdir, download_file
from manifest_rules.utils import (sprun,
tempdir,
download_file,
load_release_info,
get_platform_identifiers)
def main():
manifest_file = op.abspath(sys.argv[1])
environment_dir = op.abspath(sys.argv[2])
job_name = os.environ['CI_JOB_NAME']
release_file = op.abspath(sys.argv[1])
manifest_file = op.abspath(sys.argv[2])
environment_dir = op.abspath(sys.argv[3])
release_info = load_release_info(release_file)
platforms = get_platform_identifiers(release_info)
for platform in platforms:
if platform in job_name:
break
else:
print('This platform is disabled')
sys.exit(0)
# credentials for logging into
# internal FSL conda channel
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment