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
16c1c980
Commit
16c1c980
authored
1 year ago
by
Takumi.Matsunobu
Browse files
Options
Downloads
Patches
Plain Diff
add build_env
parent
b38064f2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#19368
canceled
1 year ago
Stage: build
Stage: run_tests
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
conf/real-from-d2-ana/jobs.yml
+9
-1
9 additions, 1 deletion
conf/real-from-d2-ana/jobs.yml
templates/real-from-d2-ana/build_env.sh
+55
-0
55 additions, 0 deletions
templates/real-from-d2-ana/build_env.sh
with
64 additions
and
1 deletion
conf/real-from-d2-ana/jobs.yml
+
9
−
1
View file @
16c1c980
...
...
@@ -3,10 +3,18 @@ JOBS:
FILE
:
templates/common/transfer_project.sh
PLATFORM
:
LOCAL
BUILD_ENV
:
FILE
:
templates/real-from-d2-ana/build_env.sh
# Right now we rely on spack for building icon and having a python interpreter, so we need this dependency:
DEPENDENCIES
:
TRASNFER_PROJECT
WALLCLOCK
:
01:00
PROCESSORS
:
1
NODES
:
1
BUILD_PYTHON_ENVIRONMENT
:
FILE
:
templates/common/build_python_environment.sh
# Right now we rely on spack for building icon and having a python interpreter, so we need this dependency:
DEPENDENCIES
:
TRASNFER_PROJECT
DEPENDENCIES
:
BUILD_ENV
WALLCLOCK
:
01:00
PROCESSORS
:
16
NODES
:
1
...
...
This diff is collapsed.
Click to expand it.
templates/real-from-d2-ana/build_env.sh
0 → 100644
+
55
−
0
View file @
16c1c980
# Get some variables provided by autosubmit.
# TODO: What do we do to ensure that these variables are defined in the proj file?
WORKDIR
=
%HPCROOTDIR%
ICON_VERSION
=
%ICON.VERSION%
COMPILER
=
%SPACK.COMPILER%
MODULES
=
"%MODULES%"
if
[
!
-z
"
${
MODULES
}
"
]
;
then
module load
${
MODULES
}
;
fi
# If the workdir directory does not exist create it
if
[
!
-d
${
WORKDIR
}
]
;
then
mkdir
-p
${
WORKDIR
}
fi
# Go to the working directory
cd
${
WORKDIR
}
||
exit
.
${
WORKDIR
}
/proj/platforms/common/spack_utils.sh
load_spack
"%spack.init%"
"%spack.root%"
"%spack.url%"
"%spack.branch%"
"%spack.externals%"
"%spack.compiler%"
"%spack.disable_local_config%"
"%spack.user_cache_path%"
"%spack.user_config_path%"
"%spack.upstreams%"
if
[
!
-z
"
$SPACK_BUILD_ICON
"
]
;
then
echo
"cmd=
$SPACK_BUILD_ICON
"
# In case the autosubmit repository with the icon-nwp receipt doesn't exist, add it
if
[[
$(
spack repo list |
grep
"
${
WORKDIR
}
/proj/spack_repo"
)
]]
;
then
echo
"icon spack repo was already added to repo list"
else
spack repo add
${
WORKDIR
}
/proj/spack_repo
fi
spack load
--first
${
SPACK_LOAD_ICON
}
else
echo
"
\%
icon.build_cmd
\%
is not defined. If you want to compile icon with spack, please provide a spack compile instruction string in your build.yml"
fi
# Build dwd-icon-tools
SPACK_BUILD_DWDICONTOOLS
=
"%DWDICONTOOLS.BUILD_CMD%"
SPACK_LOAD_DWDICONTOOLS
=
"%DWDICONTOOLS.LOAD_CMD%"
if
[
"
${
SPACK_LOAD_DWDICONTOOLS
}
"
==
"build_cmd"
]
;
then
SPACK_LOAD_DWDICONTOOLS
=
${
SPACK_BUILD_DWDICONTOOLS
}
;
fi
if
[
!
-z
"
$SPACK_BUILD_DWDICONTOOLS
"
]
;
then
spack load
--first
${
SPACK_LOAD_DWDICONTOOLS
}
fi
# Need to get ECCODES DWD definitions:
eccodes_version
=
$(
spack spec
$SPACK_BUILD_ICON
|
grep
eccodes |
grep
-o
"@.*%"
|
grep
-o
"[0-9
\.
]*"
)
definitions_tar_file
=
eccodes_definitions.edzw-
${
eccodes_version
}
-1
.tar.bz2
if
[
!
-f
"
${
definitions_tar_file
}
"
]
;
then
defs_url
=
https://opendata.dwd.de/weather/lib/grib/
${
definitions_tar_file
}
wget
"
${
defs_url
}
"
# Decompress definitions file
tar
-xf
"
${
definitions_tar_file
}
"
# Create a file containing the environment variable that needs to be set in order to use DWD's definitions:
echo
"export ECCODES_DEFINITION_PATH=
${
WORKDIR
}
/definitions.edzw-
${
eccodes_version
}
-1"
>
eccodes_defs.env
fi
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