Commit cada37ef authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: Read platform-specific package list. Associated cosmetic changes to

identifiers in release info file (underscores -> hyphens)
parent c65a35dd
#!/usr/bin/env python
__version__ = '0.6.2'
__version__ = '0.6.3'
......@@ -9,8 +9,6 @@
# removed. The DRY_RUN variable must be explicitly set to "false" for any
# files to actually be deleted.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
import os.path as op
......
#!/usr/bin/env python
#
# Deploy environment/manifest files to the release directory.
#
import os
import sys
......
......@@ -15,14 +15,17 @@ from manifest_rules.utils import (load_release_info,
generate_development_version_identifier)
def filter_packages(release_info, platform, cudaver):
def generate_package_list(release_info, platform, cudaver):
"""Return a list of packages that should be included in the environment
file for the platform and CUDA version.
"""
packages = release_info['packages']
pkgs = release_info['packages']
platpkgs = release_info.get(f'{platform}-packages', [])
pkgs = pkgs + platpkgs
cudapat = r'cuda-[\d]+\.[\d]+'
cudapkgs = [p for p in packages if re.search(cudapat, p) is not None]
otherpkgs = [p for p in packages if p not in cudapkgs]
cudapkgs = [p for p in pkgs if re.search(cudapat, p) is not None]
otherpkgs = [p for p in pkgs if p not in cudapkgs]
if cudaver is None:
return otherpkgs
......@@ -41,7 +44,7 @@ def need_internal_channel(release_info, packages):
username = os.environ['FSLCONDA_USERNAME']
password = os.environ['FSLCONDA_PASSWORD']
channel_url = release_info['internal_channel']
channel_url = release_info['internal-channel']
channel_url = channel_url.replace('${FSLCONDA_USERNAME}:${FSLCONDA_PASSWORD}@', '')
internal_packages = get_channel_packages(channel_url,
username=username,
......@@ -56,12 +59,12 @@ def generate_environment(release_info, version, platform, cudaver, outfile):
"""Genereate an environment file for the platform and CUDA version.
"""
channels = list(release_info['channels'])
packages = filter_packages(release_info, platform, cudaver)
packages = generate_package_list(release_info, platform, cudaver)
# Internal/dev release - add internal
# channel to environment spec if necessary
if need_internal_channel(release_info, packages):
channels = [release_info['internal_channel']] + channels
channels = [release_info['internal-channel']] + channels
with open(outfile, 'wt') as f:
f.write('name: FSL\n')
......
......@@ -48,7 +48,7 @@ def load_previous_manifest(release_info):
"""Downloads the previous official FSL manifest, returning it
as a dict. Returns None if the manifest cannot be downloaded.
"""
url = urlparse.urljoin(release_info['release_url'], 'manifest.json')
url = urlparse.urljoin(release_info['release-url'], 'manifest.json')
with tempdir():
try:
......@@ -98,7 +98,7 @@ def load_previous_manifest(release_info):
def generate_installer_section(release_info):
"""Generates the "installer" manifest section, returning a dict. """
version = release_info['installer']
url = urlparse.urljoin(release_info['release_url'], 'fslinstaller.py')
url = urlparse.urljoin(release_info['release-url'], 'fslinstaller.py')
try:
with tempdir():
......@@ -163,14 +163,14 @@ def generate_version_section(version,
checksum = sha256(envfile)
envfile = op.basename(envfile)
output = install_info.get(envfile, None)
url = urlparse.urljoin(release_info['release_url'], envfile)
url = urlparse.urljoin(release_info['release-url'], envfile)
version, platform, cuda = parse_environment_file_name(envfile)
build = {
'platform' : platform,
'environment' : url,
'sha256' : checksum,
'base_packages' : release_info['base_packages']
'base_packages' : release_info['base-packages']
}
if cuda is not None:
build['cuda'] = cuda
......
......@@ -77,7 +77,7 @@ def full_test(envfile, release_info):
platform = parse_environment_file_name(envfile)[1]
miniconda_url = release_info['miniconda'][platform]
base_packages = release_info['base_packages']
base_packages = release_info['base-packages']
base_packages = sorted(base_packages, key=len, reverse=True)
download_file(miniconda_url, 'miniconda.sh')
......
Markdown is supported
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