Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcdf
obs
osc-plugins
Commits
4c06a8b3
Commit
4c06a8b3
authored
Feb 12, 2019
by
Lorenz Huedepohl
Browse files
Track list of attributes in one place
parent
e9b3b6fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
mpcdf_common.py
View file @
4c06a8b3
...
...
@@ -8,6 +8,10 @@ import osc.oscerr
from
functools
import
partial
from
xml.etree
import
ElementTree
package_attributes
=
[
"MPCDF:enable_repositories"
]
config_attributes
=
[
"MPCDF:compiler_modules"
,
"MPCDF:cuda_modules"
,
"MPCDF:mpi_modules"
,
"MPCDF:pgi_modules"
]
default_attributes
=
[
"MPCDF:default_compiler"
,
"MPCDF:default_cuda"
,
"MPCDF:default_mpi"
]
intel_parallel_studio
=
{
"mpcdf_intel_parallel_studio_2017_7"
:
{
"compiler"
:
"intel_17_0_7"
,
"impi"
:
"impi_2017_4"
,
"mkl"
:
"mkl_2017_4-module"
,
},
"mpcdf_intel_parallel_studio_2018_1"
:
{
"compiler"
:
"intel_18_0_1"
,
"impi"
:
"impi_2018_1"
,
"mkl"
:
"mkl_2018_1-module"
,
},
...
...
@@ -299,9 +303,9 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, filter_r
def
mpcdf_setup_repositories
(
api_url
,
project
,
distribution
=
None
,
parent
=
None
,
packages
=
None
,
dry_run
=
False
,
filter_repos
=
None
,
only_project
=
False
):
if
parent
:
for
attribute
in
[
"compiler_modules"
,
"default_compiler"
,
"mpi_modules"
,
"default_mpi"
,
"cuda_modules"
,
"default_cuda"
,
"pgi_modules"
]
:
print
(
"Copying attribute '
MPCDF:
{0}' from parent project"
.
format
(
attribute
))
set_attribute
(
api_url
,
project
,
None
,
get_attribute
(
api_url
,
parent
,
None
,
"MPCDF:"
+
attribute
))
for
attribute
in
config_attributes
+
default_attributes
:
print
(
"Copying attribute '{0}' from parent project"
.
format
(
attribute
))
set_attribute
(
api_url
,
project
,
None
,
get_attribute
(
api_url
,
parent
,
None
,
attribute
))
compilers
=
list
(
get_attribute_values
(
api_url
,
project
,
None
,
"MPCDF:compiler_modules"
))
mpis
=
list
(
get_attribute_values
(
api_url
,
project
,
None
,
"MPCDF:mpi_modules"
))
...
...
@@ -522,10 +526,7 @@ def sync_projects(api_url, package=None, from_project="software", to_projects=No
else
:
from_packages
=
[
package
]
project_attributes
=
[
"MPCDF:compiler_modules"
,
"MPCDF:cuda_modules"
,
"MPCDF:mpi_modules"
]
package_attributes
=
[
"MPCDF:enable_repositories"
]
+
project_attributes
for
attribute
in
project_attributes
:
for
attribute
in
config_attributes
:
try
:
get_attribute
(
api_url
,
to_project
,
None
,
attribute
)
except
Exception
:
...
...
@@ -545,7 +546,7 @@ def sync_projects(api_url, package=None, from_project="software", to_projects=No
else
:
print
(
"Not branching package {0}, already present in target"
.
format
(
orig_package
))
for
attribute
in
package_attributes
:
for
attribute
in
package_attributes
+
config_attributes
:
try
:
attr
=
get_attribute
(
api_url
,
from_project
,
orig_package
,
attribute
)
except
UnsetAttributeException
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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