Skip to content

Commit

Permalink
Merge pull request #295 from LLNL/bugfix/ci-space
Browse files Browse the repository at this point in the history
Gitlab CI cleanup strategy
  • Loading branch information
mdavis36 authored Jul 31, 2024
2 parents aace2ac + 20fa6e4 commit e36c091
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 6 deletions.
20 changes: 20 additions & 0 deletions .gitlab/jobs-mpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ toss_gcc_mvapich2_cxxonly_build:
extends: [.toss_resource1, .gcc_mvapich2_cxxonly, .build]
needs: [toss_gcc_mvapich2_cxxonly_tpls]

toss_gcc_mvapich2_cxxonly_cleanup:
extends: [.toss_resource1, .gcc_mvapich2_cxxonly, .cleanup_dir]
needs: [toss_gcc_mvapich2_cxxonly_build]



toss_gcc_mvapich2_tpls:
Expand All @@ -21,6 +25,10 @@ toss_gcc_mvapich2_test:
extends: [.toss_resource2, .gcc_mvapich2, .run_ats]
needs: [toss_gcc_mvapich2_build]

toss_gcc_mvapich2_cleanup:
extends: [.toss_resource2, .gcc_mvapich2, .cleanup_dir]
needs: [toss_gcc_mvapich2_test]



toss_clang_mvapich2_tpls:
Expand All @@ -34,6 +42,10 @@ toss_clang_mvapich2_test:
extends: [.toss_resource2, .clang_mvapich2, .run_ats]
needs: [toss_clang_mvapich2_build]

toss_clang_mvapich2_cleanup:
extends: [.toss_resource2, .clang_mvapich2, .cleanup_dir]
needs: [toss_clang_mvapich2_test]



#toss_oneapi_2022_1_mvapich2:
Expand All @@ -52,6 +64,10 @@ blueos_gcc_spectrum_test:
extends: [.blueos_resource1, .gcc_spectrum, .run_ats]
needs: [blueos_gcc_spectrum_build]

blueos_gcc_spectrum_cleanup:
extends: [.blueos_resource1, .gcc_spectrum, .cleanup_dir]
needs: [blueos_gcc_spectrum_test]



blueos_cuda_11_gcc_spectrum_tpls:
Expand All @@ -66,5 +82,9 @@ blueos_cuda_11_gcc_spectrum_test:
needs: [blueos_cuda_11_gcc_spectrum_build]
allow_failure: true

blueos_cuda_11_gcc_spectrum_cleanup:
extends: [.blueos_resource2, .cuda_11_gcc_spectrum, .cleanup_dir]
needs: [blueos_cuda_11_gcc_spectrum_test]



7 changes: 5 additions & 2 deletions .gitlab/jobs-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ toss_release_permissions:
# ------------------------------------------------------------------------------
# CLEAN OLD BUILD DIRS

cleanup_build_dirs:
extends: [.clean_dirs]
cleanup_old_dirs_toss:
extends: [.toss_resource_general, .clean_old_dirs]

cleanup_old_dirs_blueos:
extends: [.blueos_resource_general, .clean_old_dirs]

12 changes: 12 additions & 0 deletions .gitlab/jobs-seq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ toss_gcc_~mpi_test:
extends: [.gcc_~mpi, .run_ats, .toss_resource1]
needs: [toss_gcc_~mpi_build]

toss_gcc_~mpi_cleanup:
extends: [.gcc_~mpi, .cleanup_dir, .toss_resource1]
needs: [toss_gcc_~mpi_test]


blueos_cuda_11_gcc_~mpi_tpls:
extends: [.blueos_resource2, .cuda_11_gcc_~mpi, .tpls]
Expand All @@ -24,6 +28,10 @@ blueos_cuda_11_gcc_~mpi_test:
extends: [.blueos_resource2, .cuda_11_gcc_~mpi, .run_ats]
needs: [blueos_cuda_11_gcc_~mpi_build]

blueos_cuda_11_gcc_~mpi_cleanup:
extends: [.blueos_resource2, .cuda_11_gcc_~mpi, .cleanup_dir]
needs: [blueos_cuda_11_gcc_~mpi_test]


blueos_gcc_~mpi_Debug_tpls:
extends: [.blueos_resource1, .gcc_~mpi_Debug, .tpls]
Expand All @@ -35,3 +43,7 @@ blueos_gcc_~mpi_Debug_build:
blueos_gcc_~mpi_Debug_test:
extends: [.blueos_resource1, .gcc_~mpi_Debug, .run_ats]
needs: [blueos_gcc_~mpi_Debug_build]

blueos_gcc_~mpi_Debug_cleanup:
extends: [.blueos_resource1, .gcc_~mpi_Debug, .cleanup_dir]
needs: [blueos_gcc_~mpi_Debug_test]
2 changes: 2 additions & 0 deletions .gitlab/machines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
PARTITION: pdebug
BUILD_ALLOC: srun -N 1 -c 36 -p pdebug -t 60
TEST_ALLOC: ''
CLEAN_ALLOC: srun -n 20
extends: [.on_toss_4_x86]

.on_lassen:
Expand All @@ -20,6 +21,7 @@
HOSTNAME: 'lassen'
BUILD_ALLOC: lalloc 1 -W 60
TEST_ALLOC: $BUILD_ALLOC
CLEAN_ALLOC: lalloc 1 lrun -n 20
LC_MODULES: "cuda/11.1.0"
extends: [.on_blueos_3_ppc64]

Expand Down
3 changes: 3 additions & 0 deletions .gitlab/os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@
ARCH: 'toss_3_x86_64_ib'
GCC_VERSION: '8.3.1'
CLANG_VERSION: '9.0.0'
SPHERAL_BUILDS_DIR: /p/lustre1/sphapp/spheral-ci-builds
extends: [.sys_config]

.on_toss_4_x86:
variables:
ARCH: 'toss_4_x86_64_ib'
GCC_VERSION: '10.3.1'
CLANG_VERSION: '14.0.6'
SPHERAL_BUILDS_DIR: /p/lustre1/sphapp/spheral-ci-builds
extends: [.sys_config]

.on_blueos_3_ppc64:
variables:
ARCH: 'blueos_3_ppc64le_ib_p9'
GCC_VERSION: '8.3.1'
CLANG_VERSION: '9.0.0'
SPHERAL_BUILDS_DIR: /p/gpfs1/sphapp/spheral-ci-builds
extends: [.sys_config]

28 changes: 24 additions & 4 deletions .gitlab/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.tpls:
stage: tpls
script:
- echo $USER
- CI_BUILD_DIR=$SPHERAL_BUILDS_DIR/$CI_JOB_ID/project
- echo $CI_BUILD_DIR &> ci-dir.txt && echo $CI_JOB_NAME &> job-name.txt
- echo $CI_BUILD_DIR && echo $CI_PROJECT_DIR
Expand All @@ -27,6 +28,10 @@
- CI_BUILD_DIR=$(cat ci-dir.txt)
- cd $CI_BUILD_DIR && cat job-name.txt
- $BUILD_ALLOC ./$SCRIPT_DIR/devtools/host-config-build.py --host-config gitlab.cmake --build $EXTRA_CMAKE_ARGS
artifacts:
paths:
- ci-dir.txt
- job-name.txt

.build_and_test:
extends: [.build]
Expand Down Expand Up @@ -62,6 +67,17 @@
exit_codes:
- 80

.cleanup_dir:
stage: cleanup
variables:
GIT_STRATEGY: none
script:
- CI_BUILD_DIR=$(cat ci-dir.txt)

- ml load mpifileutils
- cd $SPHERAL_BUILDS_DIR
- $CLEAN_ALLOC drm $CI_BUILD_DIR/..

# ------------------------------------------------------------------------------
# Shared TPL scripts.
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -153,15 +169,19 @@
# This job searches our SPHERAL_BUILDS_DIR and deletes all but the N most recent builds.
# This should be enough of a buffer that we likely won't delete a build mid pipeline,
# and never fill the sphapp workspace storage.
.clean_dirs:
.clean_old_dirs:
stage: cleanup
variables:
GIT_STRATEGY: none
script:
- ml load mpifileutils
- cd $SPHERAL_BUILDS_DIR
- source $CI_PROJECT_DIR/$SCRIPT_DIR/gitlab/clean_spheral_builds.sh 40
extends: [.toss_resource_general]

- MAX_DIR=30
- DIR_LIST=$(ls -ltd * | sed "1, $MAX_DIR d" | rev | cut -d ' ' -f1 | rev | paste -sd ' ' - )
- echo $DIR_LIST

- ml load mpifileutils
- if [[ $DIR_LIST ]]; then $CLEAN_ALLOC drm $DIR_LIST; else echo "No directories to remove at this time."; fi
when: always

.merge_pr_rule:
Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Notable changes include:
* Build changes / improvements:
* Distributed source directory must always be built now.
* Git strategies in the Gitlab CI are fixed so a clone only occurs on the first stage for each job, instead of for all stages for each job.
* New Gitlab CI pipeline cleanup strategy deletes job directories immediately upon successful completion.
* Bug Fixes / improvements:
* Wrappers for MPI calls are simplified and improved.
Expand Down

0 comments on commit e36c091

Please sign in to comment.