diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8dd76465c8b1f31907132487c8f8e943ac0cbadf..78707baecbb6d72d0893180247fad841b9831b68 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -54,6 +54,7 @@ gcc-debug: - compiled/share/ - build/examples/ - build/tests/ + - build/plugins/adhoc_services.d/*.sh - build/src/scord/scord - build/src/scord-ctl/scord-ctl diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 59580175e29b834eab47ba9dbe76264468d90994..5959af25fad05ef32bf53e112f0dff73c4185da0 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -31,6 +31,7 @@ if(SCORD_BUILD_TESTS) file(MAKE_DIRECTORY ${TEST_DIRECTORY}) configure_file(scord.conf.in scord.conf) + configure_file(scord-ctl.conf.in scord-ctl.conf) set(SCORD_ADDRESS_STRING ${SCORD_TRANSPORT_PROTOCOL}://${SCORD_BIND_ADDRESS}:${SCORD_BIND_PORT}) @@ -57,8 +58,11 @@ if(SCORD_BUILD_TESTS) add_test(start_scord_ctl ${CMAKE_SOURCE_DIR}/scripts/runner.sh start scord-ctl.pid - ${CMAKE_BINARY_DIR}/src/scord-ctl/scord-ctl -l ${SCORD_CTL_ADDRESS_STRING} -o ${TEST_DIRECTORY}/scord_ctl.log - ) + ${CMAKE_BINARY_DIR}/src/scord-ctl/scord-ctl + -c ${CMAKE_CURRENT_BINARY_DIR}/scord-ctl.conf + -l ${SCORD_CTL_ADDRESS_STRING} + -o ${TEST_DIRECTORY}/scord_ctl.log + ) set_tests_properties(start_scord_ctl PROPERTIES FIXTURES_SETUP scord_ctl) diff --git a/examples/scord-ctl.conf.in b/examples/scord-ctl.conf.in new file mode 100644 index 0000000000000000000000000000000000000000..58ba161613c2c98ac2311648a8babf31865c1452 --- /dev/null +++ b/examples/scord-ctl.conf.in @@ -0,0 +1,48 @@ +## vim: set filetype=yaml: + +# Configuration of the `scord-ctl` service +config: + # Specific configurations for supported adhoc storage systems + adhoc_storage: + gekkofs: + # The default working directory for adhoc instances of this type + working_directory: /tmp/gekkofs + startup: + # Specific environment variables that should be set for the adhoc + # instance. These will be merged with the environment variables + # already set by Slurm. + environment: + VAR0: value0 + VAR1: value1 + # 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 + # can be used to start the adhoc instance. + # * ADHOC_DIRECTORY: A unique working directory for each specific + # adhoc instance. This directory will be created by scord-ctl under + # `working_directory` and automatically removed after the adhoc + # instance has been shut down. + # * ADHOC_ID: - A unique ID for the adhoc instance. + command: @CMAKE_BINARY_DIR@/plugins/adhoc_services.d/gekkofs.sh + start + --hosts {ADHOC_NODES} + --workdir {ADHOC_DIRECTORY} + --datadir {ADHOC_DIRECTORY}/data + --mountdir {ADHOC_DIRECTORY}/mnt + shutdown: + environment: + command: @CMAKE_BINARY_DIR@/plugins/adhoc_services.d/gekkofs.sh + stop + --workdir {ADHOC_DIRECTORY} + + +# default storage tiers made available to applications +storage: + lustre: + type: "pfs" + mountpoint: "/mnt/lustre" + + tmp: + type: "tmpfs" + mountpoint: "/tmp" diff --git a/plugins/adhoc_services.d/CMakeLists.txt b/plugins/adhoc_services.d/CMakeLists.txt index 915a03b706e597277d5e7ad9f3c454845d302853..143a7e9d65eee259c61fa66d0593b2e0a84a19ba 100644 --- a/plugins/adhoc_services.d/CMakeLists.txt +++ b/plugins/adhoc_services.d/CMakeLists.txt @@ -24,6 +24,15 @@ list(APPEND ADHOC_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/gekkofs.sh") +# copy adhoc scripts to the build directory so that they can be used by tests +foreach (ADHOC_SCRIPT ${ADHOC_SCRIPTS}) + get_filename_component(ADHOC_SCRIPT_NAME ${ADHOC_SCRIPT} NAME) + configure_file(${ADHOC_SCRIPT} ${CMAKE_CURRENT_BINARY_DIR}/${ADHOC_SCRIPT_NAME} @ONLY + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) +endforeach() + # 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)