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
1fb8aa71
Commit
1fb8aa71
authored
2 years ago
by
Oriol Tintó Prims
Browse files
Options
Downloads
Patches
Plain Diff
Change build_enstools.sh to build_python_environment.sh
parent
99e85a9c
No related branches found
No related tags found
1 merge request
!2
Split prepare_rundir.sh into three different stages for the whole experiment,...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
conf/jobs.yaml
+4
-3
4 additions, 3 deletions
conf/jobs.yaml
templates/build_python_environment.sh
+18
-12
18 additions, 12 deletions
templates/build_python_environment.sh
with
22 additions
and
15 deletions
conf/jobs.yaml
+
4
−
3
View file @
1fb8aa71
...
@@ -61,8 +61,9 @@ JOBS:
...
@@ -61,8 +61,9 @@ JOBS:
WALLCLOCK
:
04:00
WALLCLOCK
:
04:00
PROCESSORS
:
16
PROCESSORS
:
16
BUILD_ENSTOOLS
:
BUILD_PYTHON_ENVIRONMENT
:
FILE
:
templates/build_enstools.sh
FILE
:
templates/build_python_environment.sh
# Right now we rely on spack for building icon and having a python interpreter, so we need this dependency:
DEPENDENCIES
:
BUILD_ICON
DEPENDENCIES
:
BUILD_ICON
WALLCLOCK
:
01:00
WALLCLOCK
:
01:00
PROCESSORS
:
16
PROCESSORS
:
16
...
@@ -90,7 +91,7 @@ JOBS:
...
@@ -90,7 +91,7 @@ JOBS:
COMPRESS
:
COMPRESS
:
FILE
:
templates/compress.py
FILE
:
templates/compress.py
DEPENDENCIES
:
RUN_ICON BUILD_
ENSTOOLS
COMPRESS-1
DEPENDENCIES
:
RUN_ICON BUILD_
PYTHON_ENVIRONMENT
COMPRESS-1
RUNNING
:
chunk
RUNNING
:
chunk
TYPE
:
python
TYPE
:
python
EXECUTABLE
:
"
%HPCROOTDIR%/venv/bin/python3"
EXECUTABLE
:
"
%HPCROOTDIR%/venv/bin/python3"
...
...
This diff is collapsed.
Click to expand it.
templates/build_
enstools
.sh
→
templates/build_
python_environment
.sh
+
18
−
12
View file @
1fb8aa71
...
@@ -17,16 +17,15 @@ cd ${WORKDIR}
...
@@ -17,16 +17,15 @@ cd ${WORKDIR}
# Check if experiment's spack installation already exists, if it doesn't, clone it.
# Check if experiment's spack installation already exists, if it doesn't, clone it.
SPACK_ENV
=
spack/share/spack/setup-env.sh
SPACK_ENV
=
spack/share/spack/setup-env.sh
if
[
!
-f
${
SPACK_ENV
}
]
;
then
if
[
!
-f
${
SPACK_ENV
}
]
;
then
git clone
${
SPACK_URL
}
-b
${
SPACK_BRANCH
}
echo
"Spack folder not found!"
#TODO: Would be good to enable the re-utilization of existing spack packages (via packages.yaml or upstreams.yaml)
exit
1
fi
fi
# Setup the environment
# Setup the
spack
environment
source
${
SPACK_ENV
}
source
${
SPACK_ENV
}
# Use spack to get a recent enough version of python3
# Use spack to get a recent enough version of python3
if
[
$(
if
[
$(
spack find python@3.8: &>/dev/null
spack find python@3.8: &>/dev/null
echo
$?
echo
$?
)
-ne
0
]
;
then
)
-ne
0
]
;
then
echo
"Installing a version of python3"
echo
"Installing a version of python3"
...
@@ -36,22 +35,29 @@ else
...
@@ -36,22 +35,29 @@ else
echo
"python@3.8: already installed!"
echo
"python@3.8: already installed!"
fi
fi
# Link the python binary into the main folder so can be easily used later:
# Load the python module
spack load python@3.8:
spack load python@3.8:
PYTHON_ENVIRONMENT_FOLDER
=
%python_environment.folder_name%
if
[
!
-d
venv
]
;
then
if
[
!
-d
venv
]
;
then
# Create virtual environment
# Create virtual environment
python3
-m
venv
--prompt
AS
venv
python3
-m
venv
--prompt
AS
${
PYTHON_ENVIRONMENT_FOLDER
}
fi
fi
# Load environment
# Load environment
source
venv
/bin/activate
source
${
PYTHON_ENVIRONMENT_FOLDER
}
/bin/activate
# Create a link to the binary
# Create a link to the binary
ln
-sf
$(
which python3
)
${
WORKDIR
}
/python3
ln
-sf
$(
which python3
)
${
WORKDIR
}
/python3
# Install
enstools-compression
via pip
# Install
the requirements
via pip
# TODO: Due to a incompatibility issue between latest numba and numpy I have to add this here. Hopefully removable soon.
# TODO: Due to a incompatibility issue between latest numba and numpy I have to add this here. Hopefully removable soon.
pip
install
numpy
==
1.23
requirements
=
%python_environment.requirements%
pip
install
enstools-compression
echo
${
requirements
}
# Install requirements.
for
requirement
in
${
requirements
}
;
do
python
-m
pip
install
${
requirement
}
done
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