From 188eaa7058e617a29cfb3e71f785e68e381d814f Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Fri, 28 Jul 2023 10:54:37 +0200 Subject: [PATCH 1/3] CMake: Adhoc scripts are now installed to `datadir` Scripts for controlling ad-hoc storage services now reside in `CMAKE_INSTALL_FULL_DATADIR/scord/adhoc_services.d`, typically `/usr/share/scord/adhoc_services.d/`. --- etc/CMakeLists.txt | 2 -- etc/scord-ctl.conf.in | 6 +++--- plugins/CMakeLists.txt | 1 + .../adhoc_services.d}/CMakeLists.txt | 7 +++++-- .../deploy_scripts => plugins/adhoc_services.d}/gekkofs.sh | 0 plugins/slurm/CMakeLists.txt | 4 +++- 6 files changed, 12 insertions(+), 8 deletions(-) rename {etc/deploy_scripts => plugins/adhoc_services.d}/CMakeLists.txt (88%) rename {etc/deploy_scripts => plugins/adhoc_services.d}/gekkofs.sh (100%) diff --git a/etc/CMakeLists.txt b/etc/CMakeLists.txt index bcdd9087..3b472785 100644 --- a/etc/CMakeLists.txt +++ b/etc/CMakeLists.txt @@ -22,8 +22,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later # ################################################################################ -add_subdirectory(deploy_scripts) - configure_file(scord.conf.in scord.conf) configure_file(scord-ctl.conf.in scord-ctl.conf @ONLY) diff --git a/etc/scord-ctl.conf.in b/etc/scord-ctl.conf.in index 63bb5fda..c0c12f7c 100644 --- a/etc/scord-ctl.conf.in +++ b/etc/scord-ctl.conf.in @@ -14,7 +14,7 @@ config: environment: VAR0: value0 VAR1: value1 - # The command that scord-ctl will use to start an adhoc instance of + # The command that `scord-ctl` will use to start an adhoc instance of # this type. The following variables are supported that will be # automatically replaced by scord-ctl if found between curly braces: # * ADHOC_NODES: A comma separated list of valid job hostnames that @@ -24,7 +24,7 @@ config: # `working_directory` and automatically removed after the adhoc # instance has been shut down. # * ADHOC_ID: - A unique ID for the adhoc instance. - command: @CMAKE_INSTALL_FULL_SYSCONFDIR@/@PROJECT_NAME@/gekkofs.sh + command: @CMAKE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/adhoc_services.d/gekkofs.sh start --hosts {ADHOC_NODES} --workdir {ADHOC_DIRECTORY} @@ -32,7 +32,7 @@ config: --mountdir {ADHOC_DIRECTORY}/mnt shutdown: environment: - command: @CMAKE_INSTALL_FULL_SYSCONFDIR@/@PROJECT_NAME@/gekkofs.sh + command: @CMAKE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/adhoc_services.d/gekkofs.sh stop --workdir {ADHOC_DIRECTORY} diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 8f3bc11f..247be496 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -22,4 +22,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later # ################################################################################ +add_subdirectory(adhoc_services.d) add_subdirectory(slurm) diff --git a/etc/deploy_scripts/CMakeLists.txt b/plugins/adhoc_services.d/CMakeLists.txt similarity index 88% rename from etc/deploy_scripts/CMakeLists.txt rename to plugins/adhoc_services.d/CMakeLists.txt index a8ee9583..915a03b7 100644 --- a/etc/deploy_scripts/CMakeLists.txt +++ b/plugins/adhoc_services.d/CMakeLists.txt @@ -24,10 +24,13 @@ list(APPEND ADHOC_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/gekkofs.sh") -# install adhoc scripts to `/scord` (normally /etc/scord) +# install adhoc scripts to `/scord/adhoc_services.d/` +# (normally /usr/share/scord/adhoc_services.d/) +get_filename_component(INSTALL_DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} NAME) + install( FILES ${ADHOC_SCRIPTS} - DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/${PROJECT_NAME} + DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/${INSTALL_DESTINATION} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ diff --git a/etc/deploy_scripts/gekkofs.sh b/plugins/adhoc_services.d/gekkofs.sh similarity index 100% rename from etc/deploy_scripts/gekkofs.sh rename to plugins/adhoc_services.d/gekkofs.sh diff --git a/plugins/slurm/CMakeLists.txt b/plugins/slurm/CMakeLists.txt index 5c7b05b7..88b5b6c8 100644 --- a/plugins/slurm/CMakeLists.txt +++ b/plugins/slurm/CMakeLists.txt @@ -63,11 +63,13 @@ configure_file(scord_common.sh.in scord_common.sh @ONLY) configure_file(scord_prolog.sh.in scord_prolog.sh @ONLY) configure_file(scord_epilog.sh.in scord_epilog.sh @ONLY) +get_filename_component(INSTALL_DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} NAME) + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/scord_common.sh ${CMAKE_CURRENT_BINARY_DIR}/scord_prolog.sh ${CMAKE_CURRENT_BINARY_DIR}/scord_epilog.sh - DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/slurm + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/${INSTALL_DESTINATION} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ -- GitLab From 8b4ee5d2be10fce5b0a4e56a131be1b72b077d46 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Fri, 28 Jul 2023 11:19:29 +0200 Subject: [PATCH 2/3] CI: Improve error reporting `scripts/runner.sh` now saves logs for the applications it tries to run and prints them if they cannot be started. --- scripts/runner.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/runner.sh b/scripts/runner.sh index 82c766d1..1efbde29 100755 --- a/scripts/runner.sh +++ b/scripts/runner.sh @@ -45,7 +45,8 @@ function run() { fi fi - "$@" 2>/dev/null 1>/dev/null 0runner.$$.err 1>runner.$$.out 0"$pidfile" sleep 1 @@ -54,6 +55,11 @@ function run() { echo "Process $pid does not seem to exist." >&2 echo "The program below may not exist or may have crashed while starting:" >&2 echo " $*" >&2 + echo " STDOUT: " >&2 + cat "runner.$$.out" >&2 + echo " STDERR: " >&2 + cat "runner.$$.err" >&2 + rm runner.$$.out runner.$$.err exit 1 fi @@ -80,6 +86,7 @@ function stop() { if pkill "-$signal" --pidfile "$pidfile"; then rm "$pidfile" + rm runner.$$.out runner.$$.err exit 0 fi exit 1 -- GitLab From 811ff669d4caa2a0f8cdadf622dbc6206b9fd8f9 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Fri, 28 Jul 2023 11:33:23 +0200 Subject: [PATCH 3/3] CI: Update .gitlab-ci.yml Add `compiled/share` to build artifacts --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 02255cbe..a260711c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,6 +51,7 @@ gcc-debug: - compiled/bin/ - compiled/etc/ - compiled/lib/ + - compiled/share/ - build/examples/ - build/tests/ - build/src/scord/scord -- GitLab