Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autoicon
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
w2w
autoicon
Commits
9095305b
Commit
9095305b
authored
1 year ago
by
Takumi.Matsunobu
Browse files
Options
Downloads
Patches
Plain Diff
Adapt the package.py for icon-nwp to use mirrors for submodules
parent
2d2fa7dd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#19535
canceled
1 year ago
Stage: build
Stage: run_tests
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
spack_repo/packages/icon-nwp/package.py
+80
-5
80 additions, 5 deletions
spack_repo/packages/icon-nwp/package.py
with
80 additions
and
5 deletions
spack_repo/packages/icon-nwp/package.py
+
80
−
5
View file @
9095305b
...
...
@@ -14,8 +14,7 @@ class IconNwp(Package):
Recipe to build ICON-NWP using the LMU gitlab repository.
"""
git
=
"
ssh://git@gitlab.physik.uni-muenchen.de:LDAP_w2w-b3/icon.git
"
#git = "ssh://git@gitlab.dkrz.de/icon/icon-nwp.git"
git
=
"
ssh://git@gitlab.dkrz.de/icon/icon-nwp.git
"
homepage
=
"
https://code.mpimet.mpg.de/projects/iconpublic
"
# maintainers("oriol.tinto")
...
...
@@ -29,13 +28,12 @@ class IconNwp(Package):
version
(
"
master
"
,
branch
=
"
master
"
)
# FIXME: Workaround to deal with different sources. The default is using dkrz's through ssh.
variant
(
"
source
"
,
values
=
(
'
dkrz
'
,
'
dkrz_https
'
,
'
lmu
'
,
'
lmub3
'
),
default
=
'
dkrz
'
,
variant
(
"
source
"
,
values
=
(
'
dkrz
'
,
'
dkrz_https
'
,
'
lmu
'
,
),
default
=
'
dkrz
'
,
description
=
'
Select the source of the ICON: dkrz (ssh), dkrz_https, lmu (ssh)
'
)
custom_fetchers
=
{
"
dkrz
"
:
"
ssh://git@gitlab.dkrz.de/icon/icon-nwp.git
"
,
"
dkrz_https
"
:
"
https://gitlab.dkrz.de/icon/icon-nwp.git
"
,
"
lmu
"
:
"
ssh://git@gitlab.physik.uni-muenchen.de/w2w/icon.git
"
,
"
lmub3
"
:
"
ssh://git@gitlab.physik.uni-muenchen.de:LDAP_w2w-b3/icon.git
"
,
}
variant
(
"
debug
"
,
default
=
False
,
description
=
"
add debug flags when compiling icon
"
)
...
...
@@ -54,6 +52,8 @@ class IconNwp(Package):
variant
(
"
plexrt
"
,
default
=
False
,
description
=
"
add 3D radiation support with TenStream
"
)
variant
(
"
petsc
"
,
default
=
False
,
description
=
"
add PETSc support
"
)
variant
(
"
lmu
"
,
default
=
False
,
description
=
"
if git.url and submodules should be patched to use the LMU mirrors
"
)
# Dependencies
depends_on
(
"
mpi
"
)
depends_on
(
"
netcdf-c
"
)
...
...
@@ -91,15 +91,90 @@ class IconNwp(Package):
password
=
token
url
=
"
{}://{}:{}@{}/{}
"
.
format
(
parsed
.
scheme
,
user
,
password
,
parsed
.
netloc
,
parsed
.
path
)
self
.
fetcher
[
0
].
url
=
self
.
git
=
url
if
"
+lmu
"
in
self
.
spec
:
self
.
fetcher
[
0
].
url
=
self
.
git
=
"
https://gitlab.physik.uni-muenchen.de/LDAP_w2w-b3/icon.git
"
else
:
self
.
fetcher
[
0
].
url
=
self
.
git
=
url
super
(
IconNwp
,
self
).
do_fetch
(
mirror_only
)
def
patch
(
self
):
# Run git submodule update
git
=
which
(
"
git
"
)
if
"
+lmu
"
in
self
.
spec
:
self
.
patch_submodules
()
git
(
"
submodule
"
,
"
update
"
,
"
--init
"
,
"
--recursive
"
)
def
patch_submodules
(
self
):
"""
Because of the lack of access rights to the original submodule repositories,
we patch the gitmodules file to point to a different mirror.
"""
git_submodules_file
=
Path
().
cwd
()
/
"
.gitmodules
"
git_mirror
=
"
git@gitlab.lrz.de:dkrz-mirror
"
git_modules_patch
=
f
"""
[submodule
"
externals/mtime
"
]
path = externals/mtime
url =
{
git_mirror
}
/libmtime.git
[submodule
"
externals/jsbach
"
]
path = externals/jsbach
url =
{
git_mirror
}
/jsbach.git
[submodule
"
externals/yac
"
]
path = externals/yac
url =
{
git_mirror
}
/YAC.git
[submodule
"
externals/self
"
]
path = externals/self
url =
{
git_mirror
}
/libself.git
[submodule
"
externals/tixi
"
]
path = externals/tixi
url =
{
git_mirror
}
/libtixi.git
[submodule
"
externals/yaxt
"
]
path = externals/yaxt
url =
{
git_mirror
}
/yaxt.git
[submodule
"
externals/rte-rrtmgp
"
]
path = externals/rte-rrtmgp
url = https://github.com/earth-system-radiation/rte-rrtmgp.git
[submodule
"
externals/cub
"
]
path = externals/cub
url = https://github.com/NVlabs/cub.git
[submodule
"
externals/omni-xmod-pool
"
]
path = externals/omni-xmod-pool
url = https://github.com/claw-project/omni-xmod-pool.git
[submodule
"
externals/cdi
"
]
path = externals/cdi
url =
{
git_mirror
}
/libcdi.git
[submodule
"
externals/sct
"
]
path = externals/sct
url =
{
git_mirror
}
/sct.git
[submodule
"
externals/ecrad
"
]
path = externals/ecrad
url =
{
git_mirror
}
/libecrad.git
[submodule
"
externals/dace_icon
"
]
path = externals/dace_icon
url =
{
git_mirror
}
/dace-icon-interface.git
[submodule
"
externals/emvorado
"
]
path = externals/emvorado
url =
{
git_mirror
}
/emvorado-for-icon.git
[submodule
"
utils/mkexp
"
]
path = utils/mkexp
url = https://git.mpimet.mpg.de/public/mkexp
[submodule
"
externals/art
"
]
path = externals/art
url =
{
git_mirror
}
/art.git
[submodule
"
externals/ppm
"
]
path = externals/ppm
url = https://gitlab.dkrz.de/jahns/ppm.git
[submodule
"
externals/probtest
"
]
path = externals/probtest
url = https://github.com/MeteoSwiss/probtest.git
"""
# Replace the content of the original file with the patch
with
git_submodules_file
.
open
(
"
w
"
)
as
out_f
:
out_f
.
write
(
git_modules_patch
)
def
setup_build_environment
(
self
,
env
):
spec
=
self
.
spec
...
...
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