Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
conda
manifest-rules
Commits
cada37ef
Commit
cada37ef
authored
Oct 22, 2021
by
Paul McCarthy
🚵
Browse files
RF: Read platform-specific package list. Associated cosmetic changes to
identifiers in release info file (underscores -> hyphens)
parent
c65a35dd
Changes
6
Hide whitespace changes
Inline
Side-by-side
manifest_rules/__init__.py
View file @
cada37ef
#!/usr/bin/env python
__version__
=
'0.6.
2
'
__version__
=
'0.6.
3
'
manifest_rules/clear_release_files.py
View file @
cada37ef
...
...
@@ -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
...
...
manifest_rules/deploy_files.py
View file @
cada37ef
#!/usr/bin/env python
#
# Deploy environment/manifest files to the release directory.
#
import
os
import
sys
...
...
manifest_rules/generate_environment_files.py
View file @
cada37ef
...
...
@@ -15,14 +15,17 @@ from manifest_rules.utils import (load_release_info,
generate_development_version_identifier
)
def
filter
_package
s
(
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
p
ackage
s
if
re
.
search
(
cudapat
,
p
)
is
not
None
]
otherpkgs
=
[
p
for
p
in
p
ackage
s
if
p
not
in
cudapkgs
]
cudapkgs
=
[
p
for
p
in
p
kg
s
if
re
.
search
(
cudapat
,
p
)
is
not
None
]
otherpkgs
=
[
p
for
p
in
p
kg
s
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
_package
s
(
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
'
)
...
...
manifest_rules/generate_manifest_file.py
View file @
cada37ef
...
...
@@ -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
...
...
manifest_rules/test_environment.py
View file @
cada37ef
...
...
@@ -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'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment