Commit ac475418 authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Merge branch '134-add-slurm-cli-plugin' into 'main'

Resolve "Add Slurm CLI plugin"

Closes #134

See merge request !95
parents aa3ca3fa 35d873bf
Loading
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -149,6 +149,14 @@ set(SCORD_BIND_PORT
  )
message(STATUS "[${PROJECT_NAME}] server bind port: ${SCORD_BIND_PORT}")

### controller bind port
set(SCORD_CTL_BIND_PORT
  "52001"
  CACHE STRING
  "Define the bind port for the ${PROJECT_NAME}-ctl controller (default: 52001)"
  )
message(STATUS "[${PROJECT_NAME}] server bind port: ${SCORD_CTL_BIND_PORT}")

option(SCORD_BUILD_EXAMPLES "Build examples (disabled by default)" OFF)

option(SCORD_BUILD_TESTS "Build tests (disabled by default)" OFF)
@@ -303,6 +311,7 @@ add_compile_definitions("$<$<CONFIG:DEBUG,ASan>:LOGGER_ENABLE_DEBUG>")

add_subdirectory(etc)
add_subdirectory(src)
add_subdirectory(plugins)

if (SCORD_BUILD_EXAMPLES)
  add_subdirectory(examples)

cmake/FindSlurm.cmake

0 → 100644
+101 −0
Original line number Diff line number Diff line
################################################################################
# Copyright 2021-2023, Barcelona Supercomputing Center (BSC), Spain            #
#                                                                              #
# This software was partially supported by the EuroHPC-funded project ADMIRE   #
#   (Project ID: 956748, https://www.admire-eurohpc.eu).                       #
#                                                                              #
# This file is part of scord.                                                  #
#                                                                              #
# scord is free software: you can redistribute it and/or modify                #
# it under the terms of the GNU General Public License as published by         #
# the Free Software Foundation, either version 3 of the License, or            #
# (at your option) any later version.                                          #
#                                                                              #
# scord is distributed in the hope that it will be useful,                     #
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
# GNU General Public License for more details.                                 #
#                                                                              #
# You should have received a copy of the GNU General Public License            #
# along with scord.  If not, see <https://www.gnu.org/licenses/>.              #
#                                                                              #
# SPDX-License-Identifier: GPL-3.0-or-later                                    #
################################################################################

#[=======================================================================[.rst:
FindSlurm
---------

Find Slurm include dirs and libraries.

Use this module by invoking find_package with the form::

  find_package(Slurm
    [version] [EXACT]     # Minimum or EXACT version e.g. 0.6.2
    [REQUIRED]            # Fail with error if Slurm is not found
    )

Imported Targets
^^^^^^^^^^^^^^^^

This module provides the following imported targets, if found:

``Slurm::Slurm``
  The Slurm library

Result Variables
^^^^^^^^^^^^^^^^

This will define the following variables:

``Slurm_FOUND``
  True if the system has the Slurm library.
``Slurm_VERSION``
  The version of the Slurm library which was found.
``Slurm_INCLUDE_DIRS``
  Include directories needed to use Slurm.
``Slurm_LIBRARIES``
  Libraries needed to link to Slurm.

Cache Variables
^^^^^^^^^^^^^^^

The following cache variables may also be set:

``SLURM_INCLUDE_DIR``
  The directory containing ``slurm.h``.
``SLURM_LIBRARY``
  The path to the Slurm library.

#]=======================================================================]

find_path(
  SLURM_INCLUDE_DIR
  NAMES slurm/slurm.h
  PATH_SUFFIXES include
)

find_library(SLURM_LIBRARY NAMES slurm)

mark_as_advanced(SLURM_INCLUDE_DIR SLURM_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
  Slurm
  FOUND_VAR Slurm_FOUND
  REQUIRED_VARS SLURM_LIBRARY SLURM_INCLUDE_DIR
  VERSION_VAR Slurm_VERSION
)

if(Slurm_FOUND)
  set(Slurm_INCLUDE_DIRS ${SLURM_INCLUDE_DIR})
  set(Slurm_LIBRARIES ${SLURM_LIBRARY})
  if(NOT TARGET Slurm::Slurm)
    add_library(Slurm::Slurm UNKNOWN IMPORTED)
    set_target_properties(
      Slurm::Slurm
      PROPERTIES IMPORTED_LOCATION "${SLURM_LIBRARY}"
                 INTERFACE_INCLUDE_DIRECTORIES "${SLURM_INCLUDE_DIR}"
    )
  endif()
endif()
+2 −0
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ RUN apt-get update && \
        python3-venv \
        # redis-plus-plus dependencies \
        libhiredis-dev \
        # Slurm plugin dependencies \
        libslurm-dev \
        # tests dependencies \
        python3-pip && \
    ### install cmake 3.23.1 ###################################################
+0 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ if(SCORD_BUILD_TESTS)

  set(SCORD_CTL_TRANSPORT_PROTOCOL ${SCORD_TRANSPORT_PROTOCOL})
  set(SCORD_CTL_BIND_ADDRESS ${SCORD_BIND_ADDRESS})
  math(EXPR SCORD_CTL_BIND_PORT "${SCORD_BIND_PORT} + 1")
  set(SCORD_CTL_ADDRESS_STRING
    ${SCORD_CTL_TRANSPORT_PROTOCOL}://${SCORD_CTL_BIND_ADDRESS}:${SCORD_CTL_BIND_PORT})

plugins/CMakeLists.txt

0 → 100644
+25 −0
Original line number Diff line number Diff line
################################################################################
# Copyright 2021-2023, Barcelona Supercomputing Center (BSC), Spain            #
#                                                                              #
# This software was partially supported by the EuroHPC-funded project ADMIRE   #
#   (Project ID: 956748, https://www.admire-eurohpc.eu).                       #
#                                                                              #
# This file is part of scord.                                                  #
#                                                                              #
# scord is free software: you can redistribute it and/or modify                #
# it under the terms of the GNU General Public License as published by         #
# the Free Software Foundation, either version 3 of the License, or            #
# (at your option) any later version.                                          #
#                                                                              #
# scord is distributed in the hope that it will be useful,                     #
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
# GNU General Public License for more details.                                 #
#                                                                              #
# You should have received a copy of the GNU General Public License            #
# along with scord.  If not, see <https://www.gnu.org/licenses/>.              #
#                                                                              #
# SPDX-License-Identifier: GPL-3.0-or-later                                    #
################################################################################

add_subdirectory(slurm)
Loading