Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
steam-material-library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
STEAM
steam-material-library
Commits
24242a9e
Commit
24242a9e
authored
3 months ago
by
Erik Schnaubelt
Browse files
Options
Downloads
Patches
Plain Diff
CI/CD: clean venvs to remove reinstalling the same packages multiple times
parent
39058b56
No related branches found
No related tags found
No related merge requests found
Pipeline
#8572042
failed
3 months ago
Stage: prepare_venv
Stage: build
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+16
-24
16 additions, 24 deletions
.gitlab-ci.yml
tests/getdp_utils/getdp_test_win.py
+13
-7
13 additions, 7 deletions
tests/getdp_utils/getdp_test_win.py
tests/test_getdp.py
+1
-1
1 addition, 1 deletion
tests/test_getdp.py
with
30 additions
and
32 deletions
.gitlab-ci.yml
+
16
−
24
View file @
24242a9e
stages
:
stages
:
-
prepare_venv
-
build
-
build
-
test
-
test
-
package
-
package
-
deploy
-
deploy
prepare_venv
:
stage
:
prepare_venv
script
:
-
C:\venvs\steam-material-library\Scripts\Activate.ps1
-
pip install -r requirements.txt
compile-shared-lib-win64
:
compile-shared-lib-win64
:
stage
:
build
stage
:
build
script
:
script
:
...
@@ -35,10 +42,9 @@ compile-shared-lib-linux64:
...
@@ -35,10 +42,9 @@ compile-shared-lib-linux64:
# This job compiles all the mex files in mex_compilation directory
# This job compiles all the mex files in mex_compilation directory
compile-mex
:
compile-mex
:
stage
:
build
stage
:
build
needs
:
[
"
prepare_venv"
]
before_script
:
before_script
:
-
python -m venv venv
-
C:\venvs\steam-material-library\Scripts\Activate.ps1
-
venv\Scripts\Activate.ps1
-
pip install -r requirements.txt
script
:
script
:
-
cd bindings/matlab/
-
cd bindings/matlab/
-
python build.py
-
python build.py
...
@@ -73,7 +79,6 @@ compile-mex:
...
@@ -73,7 +79,6 @@ compile-mex:
compile-cerngetdp
:
compile-cerngetdp
:
stage
:
build
stage
:
build
script
:
script
:
-
$tempFolder = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName())
-
$tempFolder = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName())
-
New-Item -ItemType Directory -Path $tempFolder
-
New-Item -ItemType Directory -Path $tempFolder
...
@@ -111,14 +116,10 @@ compile-cerngetdp:
...
@@ -111,14 +116,10 @@ compile-cerngetdp:
# This job runs the .dll tests in tests/test_dll.py
# This job runs the .dll tests in tests/test_dll.py
test-dll
:
test-dll
:
needs
:
[]
needs
:
[
"
prepare_venv"
]
stage
:
test
allow_failure
:
false
# This installs all packages listed in requirements
before_script
:
before_script
:
-
python -m venv venv
-
C:\venvs\steam-material-library\Scripts\Activate.ps1
-
venv\Scripts\Activate.ps1
stage
:
test
-
pip install -r requirements.txt
script
:
script
:
# Run tests
# Run tests
-
echo "Running test_dll.py."
-
echo "Running test_dll.py."
...
@@ -131,17 +132,13 @@ test-dll:
...
@@ -131,17 +132,13 @@ test-dll:
# This job runs the CERGetDP tests in tests/test_getdp.py
# This job runs the CERGetDP tests in tests/test_getdp.py
test-cerngetdp
:
test-cerngetdp
:
# we need the compiled cerngetdp job here
# we need the compiled cerngetdp job here
needs
:
[
"
compile-cerngetdp"
]
needs
:
[
"
prepare_venv"
,
"
compile-cerngetdp"
]
stage
:
test
stage
:
test
allow_failure
:
false
# This installs all packages listed in requirements
before_script
:
before_script
:
-
python -m venv venv
-
C:\venvs\steam-material-library\Scripts\Activate.ps1
-
venv\Scripts\Activate.ps1
-
pip install -r requirements.txt
script
:
script
:
# check if compiled_getdp exists and is callable
# check if compiled_getdp exists and is callable
-
compiled_getdp/getdp.exe -version
-
compiled_getdp/getdp.exe
-
-version
-
python -m unittest .\tests\test_getdp.py
-
python -m unittest .\tests\test_getdp.py
# These tags are to use the STEAM shared runner
# These tags are to use the STEAM shared runner
tags
:
tags
:
...
@@ -249,11 +246,6 @@ pages:
...
@@ -249,11 +246,6 @@ pages:
stage
:
deploy
stage
:
deploy
needs
:
[
"
compile-mex"
]
needs
:
[
"
compile-mex"
]
image
:
gitlab-registry.cern.ch/steam/steam-fiqus-dev-public-docker:latest
image
:
gitlab-registry.cern.ch/steam/steam-fiqus-dev-public-docker:latest
# overwrite global before_script
before_script
:
-
python3 -m venv venv
-
source venv/bin/activate
-
pip install -r requirements.txt
# we build on the fiqus dev docker since it has all the requirements to create the docs
# we build on the fiqus dev docker since it has all the requirements to create the docs
script
:
script
:
-
mkdocs build --clean --site-dir public
-
mkdocs build --clean --site-dir public
...
@@ -263,4 +255,4 @@ pages:
...
@@ -263,4 +255,4 @@ pages:
# - docs/source
# - docs/source
rules
:
rules
:
-
if
:
$CI_COMMIT_TAG
# Any tag is created
-
if
:
$CI_COMMIT_TAG
# Any tag is created
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/getdp_utils/getdp_test_win.py
+
13
−
7
View file @
24242a9e
...
@@ -40,7 +40,7 @@ def read_output_file(file_path):
...
@@ -40,7 +40,7 @@ def read_output_file(file_path):
output
=
np
.
loadtxt
(
f
)[:,
1
]
output
=
np
.
loadtxt
(
f
)[:,
1
]
return
output
return
output
def
call_getdp_function
(
input_dict
,
model_name
,
cerngetdp_path
,
pro_template_path
,
outputs_folder_msh
,
outputs_folder_pro
,
outputs_folder_txt
):
def
call_getdp_function
(
input_dict
,
model_name
,
cerngetdp_path
_list
,
pro_template_path
,
outputs_folder_msh
,
outputs_folder_pro
,
outputs_folder_txt
_list
):
"""
"""
Call the getdp executable and evaluate values of a GetDP function for all input values.
Call the getdp executable and evaluate values of a GetDP function for all input values.
...
@@ -56,10 +56,16 @@ def call_getdp_function(input_dict, model_name, cerngetdp_path, pro_template_pat
...
@@ -56,10 +56,16 @@ def call_getdp_function(input_dict, model_name, cerngetdp_path, pro_template_pat
pro_file
=
template_pro_file
(
pro_template_path
,
model_name
,
input_dict
,
outputs_folder_pro
)
pro_file
=
template_pro_file
(
pro_template_path
,
model_name
,
input_dict
,
outputs_folder_pro
)
status
=
subprocess
.
run
([
cerngetdp_path
,
pro_file
,
"
-solve
"
,
"
#1
"
,
"
-pos
"
,
"
#1
"
,
"
-v
"
,
"
0
"
,
"
-msh
"
,
os
.
path
.
join
(
outputs_folder_msh
,
f
"
{
model_name
}
.msh
"
),
"
-name
"
,
os
.
path
.
join
(
outputs_folder_txt
,
input_dict
[
'
c_function_name
'
])],
check
=
True
)
all_outputs
=
[]
for
cerngetdp_path
,
output_folder_txt
in
zip
(
cerngetdp_path_list
,
outputs_folder_txt_list
):
status
=
subprocess
.
run
([
cerngetdp_path
,
pro_file
,
"
-solve
"
,
"
#1
"
,
"
-pos
"
,
"
#1
"
,
"
-v
"
,
"
0
"
,
"
-msh
"
,
os
.
path
.
join
(
outputs_folder_msh
,
f
"
{
model_name
}
.msh
"
),
"
-name
"
,
os
.
path
.
join
(
output_folder_txt
,
input_dict
[
'
c_function_name
'
])],
check
=
True
)
if
status
.
returncode
==
0
:
if
status
.
returncode
==
0
:
output_file_path
=
os
.
path
.
join
(
outputs_folder_txt
,
f
"
{
input_dict
[
'
function_name
'
]
}
.txt
"
)
output_file_path
=
os
.
path
.
join
(
output_folder_txt
,
f
"
{
input_dict
[
'
function_name
'
]
}
.txt
"
)
return
read_output_file
(
output_file_path
)
all_outputs
.
append
(
read_output_file
(
output_file_path
))
else
:
else
:
return
None
return
None
return
all_outputs
This diff is collapsed.
Click to expand it.
tests/test_getdp.py
+
1
−
1
View file @
24242a9e
...
@@ -34,7 +34,7 @@ class GetDP_tests(unittest.TestCase):
...
@@ -34,7 +34,7 @@ class GetDP_tests(unittest.TestCase):
cls
.
cerngetdp_zip
=
cls
.
cerngetdp_path
/
"
cerngetdp_snapshot_openblas.zip
"
cls
.
cerngetdp_zip
=
cls
.
cerngetdp_path
/
"
cerngetdp_snapshot_openblas.zip
"
if
is_gitlab_runner
:
if
is_gitlab_runner
:
cls
.
cerngetdp_exe_list
=
[
cls
.
cerngetdp_path
/
"
getdp.exe
"
,
current_directory
/
"
compiled_getdp
"
/
"
getdp.exe
"
]
cls
.
cerngetdp_exe_list
=
[
cls
.
cerngetdp_path
/
"
getdp.exe
"
,
current_directory
.
parent
/
"
compiled_getdp
"
/
"
getdp.exe
"
]
else
:
else
:
cls
.
cerngetdp_exe_list
=
[
cls
.
cerngetdp_path
/
"
getdp.exe
"
]
cls
.
cerngetdp_exe_list
=
[
cls
.
cerngetdp_path
/
"
getdp.exe
"
]
...
...
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