Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osc-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpcdf
obs
osc-plugins
Commits
4c06a8b3
Commit
4c06a8b3
authored
6 years ago
by
Lorenz Huedepohl
Browse files
Options
Downloads
Patches
Plain Diff
Track list of attributes in one place
parent
e9b3b6fd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mpcdf_common.py
+9
-8
9 additions, 8 deletions
mpcdf_common.py
with
9 additions
and
8 deletions
mpcdf_common.py
+
9
−
8
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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment