From ba22fb235e668a2bc68bb44b415af660b89384ca Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Wed, 7 Feb 2024 19:57:03 -0600 Subject: [PATCH 01/13] Only search for hrun_client --- CMake/HermesConfig.cmake | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/CMake/HermesConfig.cmake b/CMake/HermesConfig.cmake index 98af6de8c..8adae2c79 100644 --- a/CMake/HermesConfig.cmake +++ b/CMake/HermesConfig.cmake @@ -24,7 +24,7 @@ get_filename_component(Hermes_DIR ${Hermes_INCLUDE_DIR} PATH) #----------------------------------------------------------------------------- find_library( Hermes_LIBRARY - NAMES hrun_client hrun_server + NAMES hrun_client HINTS ENV LD_LIBRARY_PATH ENV PATH ) if (NOT Hermes_LIBRARY) @@ -60,15 +60,11 @@ endif() # Cereal find_package(cereal REQUIRED) -if(cereal) - message(STATUS "found cereal") -endif() +message(STATUS "found cereal") # Boost find_package(Boost REQUIRED COMPONENTS regex system filesystem fiber REQUIRED) -if (Boost_FOUND) - message(STATUS "found boost at ${Boost_INCLUDE_DIRS}") -endif() +message(STATUS "found boost at ${Boost_INCLUDE_DIRS}") # Thallium find_package(thallium CONFIG REQUIRED) From f8b41449fb27f1b991c152376f8fc308693e0f05 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Wed, 7 Feb 2024 20:04:06 -0600 Subject: [PATCH 02/13] Hermes found off --- CMake/HermesConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMake/HermesConfig.cmake b/CMake/HermesConfig.cmake index 8adae2c79..c01a2a530 100644 --- a/CMake/HermesConfig.cmake +++ b/CMake/HermesConfig.cmake @@ -29,7 +29,7 @@ find_library( ) if (NOT Hermes_LIBRARY) message(STATUS "FindHermes: Could not find libhrun_client.so") - set(Hermes_FOUND FALSE) + set(Hermes_FOUND OFF) message(STATUS "LIBS: $ENV{LD_LIBRARY_PATH}") return() endif() From 4ffc4c3a44fe705eb4f9bfbd122bbe7a6d1e339e Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Wed, 7 Feb 2024 20:54:40 -0600 Subject: [PATCH 03/13] Update hermes find_cmake --- CMake/HermesConfig.cmake | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/CMake/HermesConfig.cmake b/CMake/HermesConfig.cmake index c01a2a530..d728c503c 100644 --- a/CMake/HermesConfig.cmake +++ b/CMake/HermesConfig.cmake @@ -7,6 +7,20 @@ # Hermes_LIBRARIES, the libraries to link against to use the Hermes library # Hermes_LIBRARY_DIRS, the directory where the Hermes library is found. +#----------------------------------------------------------------------------- +# Define constants +#----------------------------------------------------------------------------- +set(HERMES_SHM_VERSION_MAJOR @HERMES_SHM_VERSION_MAJOR@) +set(HERMES_SHM_VERSION_MINOR @HERMES_SHM_VERSION_MINOR@) + +set(BUILD_MPI_TESTS @BUILD_MPI_TESTS@) +set(BUILD_OpenMP_TESTS @BUILD_OpenMP_TESTS@) +set(HERMES_ENABLE_COMPRESS @HERMES_ENABLE_COMPRESS@) +set(HERMES_ENABLE_ENCRYPT @HERMES_ENABLE_ENCRYPT@) + +#----------------------------------------------------------------------------- +# Find hermes header +#----------------------------------------------------------------------------- find_path( Hermes_INCLUDE_DIR hermes/hermes_types.h @@ -20,12 +34,12 @@ endif() get_filename_component(Hermes_DIR ${Hermes_INCLUDE_DIR} PATH) #----------------------------------------------------------------------------- -# Find all packages needed by Hermes +# Find hermes library #----------------------------------------------------------------------------- find_library( - Hermes_LIBRARY - NAMES hrun_client - HINTS ENV LD_LIBRARY_PATH ENV PATH + Hermes_LIBRARY + NAMES hrun_client + HINTS ENV LD_LIBRARY_PATH ENV PATH ) if (NOT Hermes_LIBRARY) message(STATUS "FindHermes: Could not find libhrun_client.so") @@ -34,6 +48,10 @@ if (NOT Hermes_LIBRARY) return() endif() +#----------------------------------------------------------------------------- +# Find all packages needed by Hermes +#----------------------------------------------------------------------------- + # HermesShm find_package(HermesShm CONFIG REQUIRED) message(STATUS "found hermes_shm.h at ${HermesShm_INCLUDE_DIRS}") @@ -79,6 +97,7 @@ set(Hermes_LIBRARY_DIR "") get_filename_component(Hermes_LIBRARY_DIRS ${Hermes_LIBRARY} PATH) # Set uncached variables as per standard. set(Hermes_FOUND ON) +# Set Hermes dirs set(Hermes_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${Hermes_INCLUDE_DIR}) set(Hermes_LIBRARIES ${HermesShm_LIBRARIES} @@ -88,9 +107,13 @@ set(Hermes_LIBRARIES thallium hermes ${Boost_LIBRARIES} ${Hermes_LIBRARY}) +set(Hermes_LIBRARY_DIRS ${HermeShm_LIBRARY_DIRS}) +# Set Hermes client dirs (equal to Hermes dirs) set(Hermes_CLIENT_LIBRARIES ${Hermes_LIBRARIES}) +set(Hermes_CLIENT_LIBRARY_DIRS ${Hermes_LIBRARY_DIRS}) +# Set Hermes runtime dirs set(Hermes_RUNTIME_LIBRARIES ${Hermes_CLIENT_LIBRARIES} - hrun_runtime - ${Boost_LIBRARIES}) -set(Hermes_RUNTIME_DEPS "") + hrun_runtime) +set(Hermes_RUNTIME_LIBRARY_DIRS ${HermeShm_LIBRARY_DIRS}) +set(Hermes_RUNTIME_DEPS "") \ No newline at end of file From f85428d61b52373d89f1ea229b2fd1b9ac7e746a Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Wed, 7 Feb 2024 20:57:17 -0600 Subject: [PATCH 04/13] Update versioning --- CMake/HermesConfig.cmake | 5 +++-- CMakeLists.txt | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMake/HermesConfig.cmake b/CMake/HermesConfig.cmake index d728c503c..60e17f1eb 100644 --- a/CMake/HermesConfig.cmake +++ b/CMake/HermesConfig.cmake @@ -10,8 +10,9 @@ #----------------------------------------------------------------------------- # Define constants #----------------------------------------------------------------------------- -set(HERMES_SHM_VERSION_MAJOR @HERMES_SHM_VERSION_MAJOR@) -set(HERMES_SHM_VERSION_MINOR @HERMES_SHM_VERSION_MINOR@) +set(HERMES_VERSION_MAJOR @HERMES_VERSION_MAJOR@) +set(HERMES_VERSION_MINOR @HERMES_VERSION_MINOR@) +set(HERMES_VERSION_PATCH @HERMES_VERSION_PATCH@) set(BUILD_MPI_TESTS @BUILD_MPI_TESTS@) set(BUILD_OpenMP_TESTS @BUILD_OpenMP_TESTS@) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac8660cef..bf5f0c033 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,13 @@ cmake_minimum_required(VERSION 3.10) project(hermes) +#----------------------------------------------------------------------------- +# Define Constants +#----------------------------------------------------------------------------- +set(HERMES_VERSION_MAJOR 1) +set(HERMES_VERSION_MINOR 1) +set(HERMES_VERSION_PATCH 0) + #----------------------------------------------------------------------------- # Define Options #----------------------------------------------------------------------------- From 18a8205ba995f9ade84cba1cb06522e4a74e3204 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Wed, 7 Feb 2024 21:34:10 -0600 Subject: [PATCH 05/13] Update hermes cmake to use hermes_shm as dependency --- CMakeLists.txt | 23 +++++++- ci/hermes/packages/hermes/package.py | 30 +++++------ ci/hermes/packages/hermes_shm/package.py | 67 ++++++++++++++---------- 3 files changed, 72 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf5f0c033..8a82a6564 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static on option(BUILD_MPI_TESTS "Build tests which depend on MPI" ON) option(BUILD_OpenMP_TESTS "Build tests which depend on OpenMP" ON) option(HERMES_ENABLE_COVERAGE "Check how well tests cover code" OFF) -option(HERMES_ENABLE_DOXYGEN "Check how well the code is documented" OFF) +option(HERMES_ENABLE_DOXYGEN "Check how well the code is documented" ON) option(HERMES_REMOTE_DEBUG "Enable remote debug mode on hrun" OFF) option(HERMES_ENABLE_POSIX_ADAPTER "Build the Hermes POSIX adapter." ON) @@ -55,8 +55,27 @@ if(NOT HERMES_EXPORTED_TARGETS) set(HERMES_EXPORTED_TARGETS "hrun-targets") endif() + +#----------------------------------------------------------------------------- +# Documentation +#----------------------------------------------------------------------------- +if (HERMES_ENABLE_DOXYGEN) + include(UseDoxygenDoc) + + add_doxygen_doc( + BUILD_DIR + ${CMAKE_CURRENT_BINARY_DIR}/_build + DOXY_FILE + ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in + TARGET_NAME + dox + COMMENT + "HTML documentation" + ) +endif() + #----------------------------------------------------------------------------- -# Coverage +# Code Coverage #----------------------------------------------------------------------------- if(HERMES_ENABLE_COVERAGE) set(COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage --coverage" CACHE STRING diff --git a/ci/hermes/packages/hermes/package.py b/ci/hermes/packages/hermes/package.py index d6abae443..a8eab3cc6 100644 --- a/ci/hermes/packages/hermes/package.py +++ b/ci/hermes/packages/hermes/package.py @@ -33,28 +33,23 @@ class Hermes(CMakePackage): # Common across hermes_shm and hermes variant('mpiio', default=True, description='Enable MPI I/O adapter') variant('stdio', default=True, description='Enable STDIO adapter') + variant('debug', default=False, description='Build shared libraries') variant('vfd', default=False, description='Enable HDF5 VFD') variant('ares', default=False, description='Enable full libfabric install') - variant('only_verbs', default=False, description='Only verbs') - variant('debug', default=False, description='Build shared libraries') variant('zmq', default=False, description='Build ZeroMQ tests') variant('adios', default=False, description='Build Adios tests') + variant('encrypt', default=False, description='Build Adios tests') + variant('compress', default=False, description='Build Adios tests') - depends_on('mochi-thallium~cereal@0.10.1') - depends_on('catch2@3.0.1') - depends_on('mpi') - depends_on('cereal') - depends_on('yaml-cpp') - depends_on('libaio') - depends_on('doxygen') # @1.9.3 - depends_on('boost@1.7: +context +fiber +filesystem +system +atomic +chrono +serialization +signals +pic +regex') - depends_on('libfabric fabrics=sockets,tcp,udp,verbs,mlx,rxm,rxd,shm', - when='+ares') - depends_on('libfabric fabrics=verbs', - when='+only_verbs') - depends_on('libzmq', '+zmq') - depends_on('hdf5@1.14.0', when='+vfd') - depends_on('adios2', when='+adios') + depends_on('hermes_shm+mochi') + depends_on('hermes_shm+debug', when='+debug') + depends_on('hermes_shm+mpiio') + depends_on('hermes_shm+cereal') + depends_on('hermes_shm+boost') + depends_on('hermes_shm+ares', when='+ares') + depends_on('hermes_shm+zmq', when='+zmq') + depends_on('hermes_shm+vfd', when='+vfd') + depends_on('hermes_shm+adios', when='+adios') def cmake_args(self): args = [] @@ -92,6 +87,7 @@ def set_flags(self, env): self.set_lib(env, '{}/lib'.format(self.prefix)) self.set_lib(env, '{}/lib64'.format(self.prefix)) env.prepend_path('CMAKE_PREFIX_PATH', '{}/cmake'.format(self.prefix)) + env.prepend_path('CMAKE_MODULE_PATH', '{}/cmake'.format(self.prefix)) def setup_dependent_environment(self, spack_env, run_env, dependent_spec): self.set_flags(spack_env) diff --git a/ci/hermes/packages/hermes_shm/package.py b/ci/hermes/packages/hermes_shm/package.py index 6e352b574..bd61041bc 100644 --- a/ci/hermes/packages/hermes_shm/package.py +++ b/ci/hermes/packages/hermes_shm/package.py @@ -3,53 +3,61 @@ class HermesShm(CMakePackage): homepage = "https://github.com/lukemartinlogan/hermes_shm/wiki" git = "https://github.com/lukemartinlogan/hermes_shm.git" - url = "https://github.com/lukemartinlogan/hermes_shm/archive/refs/tags/v1.0.0.tar.gz" - version('master', branch='master') version("1.1.0", sha256="080d5361cff22794b670e4544c532926ca8b6d6ec695af25596efe035bfffea5") version("1.0.0", sha256="a79f01d531ce89985ad59a2f62b41d74c2385e48d929e2f4ad895ae34137573b") - variant('mpiio', default=True, description='Enable MPI I/O adapter') - variant('stdio', default=True, description='Enable STDIO adapter') - variant('vfd', default=False, description='Enable HDF5 VFD') - variant('ares', default=False, description='Enable full libfabric install') - variant('only_verbs', default=False, description='Only verbs') + # Main variants variant('debug', default=False, description='Build shared libraries') + variant('mochi', default=True, description='Build with mochi-thallium support') + variant('cereal', default=True, description='Build with cereal support') + variant('boost', default=True, description='Build with boost support') + variant('mpiio', default=True, description='Build with MPI support') + variant('vfd', default=False, description='Build with HDF5 support') variant('zmq', default=False, description='Build ZeroMQ tests') - variant('adios', default=False, description='Build Adios tests') + variant('adios', default=False, description='Build Adios support') - depends_on('mochi-thallium~cereal@0.10.1') + # Required deps depends_on('catch2@3.0.1') - depends_on('mpi') - depends_on('cereal') depends_on('yaml-cpp') - depends_on('libaio') - depends_on('doxygen') # @1.9.3 - depends_on('boost@1.7: +context +fiber +filesystem +system +atomic +chrono +serialization +signals +pic +regex') + depends_on('doxygen@1.9.3') + + # Machine variants + variant('ares', default=False, description='Build in ares') depends_on('libfabric fabrics=sockets,tcp,udp,verbs,mlx,rxm,rxd,shm', when='+ares') - depends_on('libfabric fabrics=verbs', - when='+only_verbs') - depends_on('libzmq', '+zmq') + + # Main dependencies + depends_on('mochi-thallium~cereal@0.10.1', when='+mochi') + depends_on('cereal', when='+cereal') + depends_on('boost@1.7: +context +fiber', when='+boost') + depends_on('mpi', when='+mpiio') depends_on('hdf5@1.14.0', when='+vfd') + depends_on('libzmq', '+zmq') depends_on('adios2', when='+adios') + # Compress variant + variant('compress', default=False, + description='Build with compression support') + depends_on('lzo', when='+compress') + depends_on('bzip2', when='+compress') + depends_on('zstd', when='+compress') + depends_on('lz4', when='+compress') + depends_on('zlib', when='+compress') + depends_on('xz', when='+compress') + depends_on('brotli', when='+compress') + depends_on('snappy', when='+compress') + depends_on('c-blosc2', when='+compress') + + # Encryption variant + variant('encrypt', default=False, + description='Build with encryption support') + depends_on('openssl', when='+encrypt') + def cmake_args(self): args = [] if '+debug' in self.spec: args.append('-DCMAKE_BUILD_TYPE=Debug') - else: - args.append('-DCMAKE_BUILD_TYPE=Release') - if '+mpiio' in self.spec: - args.append('-DHERMES_ENABLE_MPIIO_ADAPTER=ON') - if 'openmpi' in self.spec: - args.append('-DHERMES_OPENMPI=ON') - elif 'mpich' in self.spec: - args.append('-DHERMES_MPICH=ON') - if '+stdio' in self.spec: - args.append('-HERMES_ENABLE_STDIO_ADAPTER=ON') - if '+vfd' in self.spec: - args.append('-HERMES_ENABLE_VFD=ON') return args def set_include(self, env, path): @@ -69,6 +77,7 @@ def set_flags(self, env): self.set_lib(env, '{}/lib'.format(self.prefix)) self.set_lib(env, '{}/lib64'.format(self.prefix)) env.prepend_path('CMAKE_PREFIX_PATH', '{}/cmake'.format(self.prefix)) + env.prepend_path('CMAKE_MODULE_PATH', '{}/cmake'.format(self.prefix)) def setup_dependent_environment(self, spack_env, run_env, dependent_spec): self.set_flags(spack_env) From 2329cee565819b6fb404ae807d2f624b03095320 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Wed, 7 Feb 2024 22:00:14 -0600 Subject: [PATCH 06/13] Add compress+encrypt to hermes package --- ci/hermes/packages/hermes/package.py | 6 ++++++ ci/hermes/packages/hermes_shm/package.py | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ci/hermes/packages/hermes/package.py b/ci/hermes/packages/hermes/package.py index a8eab3cc6..4b8ceda3b 100644 --- a/ci/hermes/packages/hermes/package.py +++ b/ci/hermes/packages/hermes/package.py @@ -50,6 +50,8 @@ class Hermes(CMakePackage): depends_on('hermes_shm+zmq', when='+zmq') depends_on('hermes_shm+vfd', when='+vfd') depends_on('hermes_shm+adios', when='+adios') + depends_on('hermes_shm+encrypt', when='+encrypt') + depends_on('hermes_shm+compress', when='+compress') def cmake_args(self): args = [] @@ -67,6 +69,10 @@ def cmake_args(self): args.append('-HERMES_ENABLE_STDIO_ADAPTER=ON') if '+vfd' in self.spec: args.append('-HERMES_ENABLE_VFD=ON') + if '+compress' in self.spec: + args.append(self.define('HERMES_ENABLE_COMPRESSION', 'ON')) + if '+encrypt' in self.spec: + args.append(self.define('HERMES_ENABLE_ENCRYPTION', 'ON')) return args def set_include(self, env, path): diff --git a/ci/hermes/packages/hermes_shm/package.py b/ci/hermes/packages/hermes_shm/package.py index bd61041bc..06ecc8039 100644 --- a/ci/hermes/packages/hermes_shm/package.py +++ b/ci/hermes/packages/hermes_shm/package.py @@ -28,7 +28,7 @@ class HermesShm(CMakePackage): when='+ares') # Main dependencies - depends_on('mochi-thallium~cereal@0.10.1', when='+mochi') + depends_on('mochi-thallium@0.10.1', when='+mochi') depends_on('cereal', when='+cereal') depends_on('boost@1.7: +context +fiber', when='+boost') depends_on('mpi', when='+mpiio') @@ -58,6 +58,16 @@ def cmake_args(self): args = [] if '+debug' in self.spec: args.append('-DCMAKE_BUILD_TYPE=Debug') + if '+vfd' in self.spec: + args.append(self.define('HERMES_ENABLE_VFD', 'ON')) + if '+compress' in self.spec: + args.append(self.define('HERMES_ENABLE_COMPRESSION', 'ON')) + if '+encrypt' in self.spec: + args.append(self.define('HERMES_ENABLE_ENCRYPTION', 'ON')) + if '+mochi' in self.spec: + args.append(self.define('HERMES_RPC_THALLIUM', 'ON')) + if '+zmq' in self.spec: + args.append(self.define('HERMES_ENABLE_ZMQ_TESTS', 'ON')) return args def set_include(self, env, path): From 8a03b351ee25f65184e5dd05970b445dc6a40972 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Wed, 7 Feb 2024 22:19:01 -0600 Subject: [PATCH 07/13] Disable explicit enum definition thallium --- CMakeLists.txt | 28 +++++++++---------- .../remote_queue/src/remote_queue.cc | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a82a6564..93d9c822c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,20 +59,20 @@ endif() #----------------------------------------------------------------------------- # Documentation #----------------------------------------------------------------------------- -if (HERMES_ENABLE_DOXYGEN) - include(UseDoxygenDoc) - - add_doxygen_doc( - BUILD_DIR - ${CMAKE_CURRENT_BINARY_DIR}/_build - DOXY_FILE - ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in - TARGET_NAME - dox - COMMENT - "HTML documentation" - ) -endif() +#if (HERMES_ENABLE_DOXYGEN) +# include(UseDoxygenDoc) +# +# add_doxygen_doc( +# BUILD_DIR +# ${CMAKE_CURRENT_BINARY_DIR}/_build +# DOXY_FILE +# ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in +# TARGET_NAME +# dox +# COMMENT +# "HTML documentation" +# ) +#endif() #----------------------------------------------------------------------------- # Code Coverage diff --git a/hrun/tasks_required/remote_queue/src/remote_queue.cc b/hrun/tasks_required/remote_queue/src/remote_queue.cc index 2034014c4..ecf53b485 100644 --- a/hrun/tasks_required/remote_queue/src/remote_queue.cc +++ b/hrun/tasks_required/remote_queue/src/remote_queue.cc @@ -17,7 +17,7 @@ namespace thallium { /** Serialize I/O type enum */ -SERIALIZE_ENUM(hrun::IoType); +// SERIALIZE_ENUM(hrun::IoType); } // namespace thallium From f1a1097914801fc369c32e6583267500f7ef992a Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Wed, 7 Feb 2024 22:43:35 -0600 Subject: [PATCH 08/13] Add back docker action --- .../build_and_push_docker_images.yml | 20 +++++++++---------- docker/deps.Dockerfile | 14 ++++++------- docker/user.Dockerfile | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build_and_push_docker_images.yml b/.github/workflows/build_and_push_docker_images.yml index 38e647369..e7d45a812 100644 --- a/.github/workflows/build_and_push_docker_images.yml +++ b/.github/workflows/build_and_push_docker_images.yml @@ -19,16 +19,16 @@ jobs: with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v2 -# - name: Build and push deps.Dockerfile -# uses: docker/build-push-action@v4 -# with: -# context: ./ -# file: ./docker/deps.Dockerfile -# builder: ${{ steps.buildx.outputs.name }} -# push: true -# tags: hdfgroup/hermes-deps:latest + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build and push deps.Dockerfile + uses: docker/build-push-action@v4 + with: + context: ./ + file: ./docker/deps.Dockerfile + builder: ${{ steps.buildx.outputs.name }} + push: true + tags: hdfgroup/hermes-deps:latest # - name: Build and push dev.Dockerfile # uses: docker/build-push-action@v4 # with: diff --git a/docker/deps.Dockerfile b/docker/deps.Dockerfile index e55eb9ca9..0ed7229a3 100644 --- a/docker/deps.Dockerfile +++ b/docker/deps.Dockerfile @@ -1,5 +1,5 @@ -# Install ubuntu 20.04 -FROM ubuntu:20.04 +# Install ubuntu 22.04 +FROM ubuntu:22.04 LABEL maintainer="llogan@hawk.iit.edu" LABEL version="0.0" LABEL description="Hermes Docker image with CI" @@ -20,13 +20,13 @@ RUN apt install -y \ tar zip xz-utils bzip2 \ perl m4 libncurses5-dev libxml2-dev diffutils \ pkg-config cmake pkg-config \ - python3 python3-pip doxygen \ - lcov zlib1g-dev hdf5-tools \ + python3 python3-pip python3 python3-distutils python3-venv\ + doxygen lcov zlib1g-dev hdf5-tools \ build-essential ca-certificates \ coreutils curl environment-modules \ - gfortran git gpg lsb-release python3 python3-distutils \ - python3-venv unzip zip \ - bash jq python gdbserver gdb + gfortran git gpg lsb-release \ + unzip zip \ + bash jq gdbserver gdb # Setup basic environment ENV USER="root" diff --git a/docker/user.Dockerfile b/docker/user.Dockerfile index aa077beb9..8fc429ec5 100644 --- a/docker/user.Dockerfile +++ b/docker/user.Dockerfile @@ -1,5 +1,5 @@ -# Install ubuntu 20.04 -FROM ubuntu:20.04 +# Install ubuntu 22.04 +FROM ubuntu:latest LABEL maintainer="llogan@hawk.iit.edu" LABEL version="0.0" LABEL description="Hermes Docker image with CI" From 43be502743ba37dc79afffb7ff8f2a74508bd21b Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Wed, 7 Feb 2024 23:29:57 -0600 Subject: [PATCH 09/13] Always run on worker dispatch --- .github/workflows/build_and_push_docker_images.yml | 8 ++++---- docker/deps.Dockerfile | 1 + docker/user.Dockerfile | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_push_docker_images.yml b/.github/workflows/build_and_push_docker_images.yml index e7d45a812..82738f63b 100644 --- a/.github/workflows/build_and_push_docker_images.yml +++ b/.github/workflows/build_and_push_docker_images.yml @@ -3,10 +3,10 @@ on: push: workflow_dispatch: inputs: - build_docker_images: - description: 'If ''true'', force a build of the docker images and push them to dockerhub' - required: false - default: false +# build_docker_images: +# description: 'If ''true'', force a build of the docker images and push them to dockerhub' +# required: false +# default: false jobs: build-docker-images: if: ${{ github.ref_type == 'tag' || github.event.inputs.build_docker_images }} diff --git a/docker/deps.Dockerfile b/docker/deps.Dockerfile index 0ed7229a3..8fc4d068e 100644 --- a/docker/deps.Dockerfile +++ b/docker/deps.Dockerfile @@ -50,6 +50,7 @@ RUN . /module_load.sh && \ # Install hermes_shm RUN . /module_load.sh && \ . "${SPACK_DIR}/share/spack/setup-env.sh" && \ + spack external find && \ spack install hermes_shm@master+vfd+mpiio^mpich@3.3.2 # Install jarvis-cd diff --git a/docker/user.Dockerfile b/docker/user.Dockerfile index 8fc429ec5..c763456b2 100644 --- a/docker/user.Dockerfile +++ b/docker/user.Dockerfile @@ -50,6 +50,7 @@ RUN . /module_load.sh && \ # Install hermes RUN . /module_load.sh && \ . "${SPACK_DIR}/share/spack/setup-env.sh" && \ + spack external find && \ spack install hermes@master+vfd+mpiio^mpich@3.3.2 # Install jarvis-cd From d1a3bcd8bc7a9b6045cdb899434f423d054b3c97 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Thu, 8 Feb 2024 11:49:29 -0600 Subject: [PATCH 10/13] Make dockerfile not error for module load --- ci/build_hermes.sh | 8 +++++--- ci/module_load.sh | 16 +++++++--------- docker/deps.Dockerfile | 8 +++++--- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/ci/build_hermes.sh b/ci/build_hermes.sh index 4557b6e84..223e7d4f5 100755 --- a/ci/build_hermes.sh +++ b/ci/build_hermes.sh @@ -3,6 +3,9 @@ # ARGS: # SPACK_DIR: the path to spack +# Ensure environment modules are loaded +. /hermes/ci/module_load.sh + # THIS SCRIPT IS EXECUTED BY CONTAINER!!! set -x set -e @@ -21,7 +24,6 @@ pip install -e . -r requirements.txt popd # Load scspkg environment -. /module_load.sh module use "$(scspkg module dir)" # Load hermes_shm @@ -61,7 +63,7 @@ cmake ../ \ -DHERMES_ENABLE_STDIO_ADAPTER=ON \ -DHERMES_ENABLE_POSIX_ADAPTER=ON \ -DHERMES_ENABLE_COVERAGE=ON -make -j8 +make -j4 make install # Test Hermes @@ -73,4 +75,4 @@ cd /hermes/test/unit/external mkdir build cd build cmake ../ -make -j8 +make -j4 diff --git a/ci/module_load.sh b/ci/module_load.sh index 46706ff02..3e40744d5 100644 --- a/ci/module_load.sh +++ b/ci/module_load.sh @@ -1,10 +1,8 @@ #!/bin/bash -if ! shopt -q login_shell; then - if [ -d /etc/profile.d ]; then - for i in /etc/profile.d/*.sh; do - if [ -r $i ]; then - . $i - fi - done - fi -fi +if [ -d /etc/profile.d ]; then + for i in /etc/profile.d/*.sh; do + if [ -r $i ]; then + . $i + fi + done +fi \ No newline at end of file diff --git a/docker/deps.Dockerfile b/docker/deps.Dockerfile index 8fc4d068e..29939dd7c 100644 --- a/docker/deps.Dockerfile +++ b/docker/deps.Dockerfile @@ -1,3 +1,6 @@ +# NOTE(llogan): This dockerfile assumes that +# hermes github is mounted on /hermes + # Install ubuntu 22.04 FROM ubuntu:22.04 LABEL maintainer="llogan@hawk.iit.edu" @@ -35,10 +38,9 @@ ENV SPACK_DIR="${HOME}/spack" ENV SPACK_VERSION="v0.20.2" ENV HERMES_DEPS_DIR="${HOME}/hermes_deps" ENV HERMES_DIR="${HOME}/hermes" -COPY ci/module_load.sh /module_load.sh # Install Spack -RUN . /module_load.sh && \ +RUN . /hermes/ci/module_load.sh && \ git clone -b ${SPACK_VERSION} https://github.com/spack/spack ${SPACK_DIR} && \ . "${SPACK_DIR}/share/spack/setup-env.sh" && \ git clone -b dev https://github.com/lukemartinlogan/hermes.git ${HERMES_DEPS_DIR} && \ @@ -48,7 +50,7 @@ RUN . /module_load.sh && \ spack external find # Install hermes_shm -RUN . /module_load.sh && \ +RUN . /hermes/ci/module_load.sh && \ . "${SPACK_DIR}/share/spack/setup-env.sh" && \ spack external find && \ spack install hermes_shm@master+vfd+mpiio^mpich@3.3.2 From 94a0cb03a3e57174889191b95c57a29db74d15e4 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Thu, 8 Feb 2024 11:51:53 -0600 Subject: [PATCH 11/13] Add dispatch command --- .github/workflows/build_and_push_docker_images.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build_and_push_docker_images.yml b/.github/workflows/build_and_push_docker_images.yml index 82738f63b..2f76225af 100644 --- a/.github/workflows/build_and_push_docker_images.yml +++ b/.github/workflows/build_and_push_docker_images.yml @@ -2,6 +2,10 @@ name: Build and Push Docker Images on: push: workflow_dispatch: + branches: + - master + - main + - dev inputs: # build_docker_images: # description: 'If ''true'', force a build of the docker images and push them to dockerhub' From 472866923fb6233183ac4be075f218764d99835e Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Thu, 8 Feb 2024 11:59:12 -0600 Subject: [PATCH 12/13] Use cache action for deps docker --- .github/workflows/build_and_push_docker_images.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build_and_push_docker_images.yml b/.github/workflows/build_and_push_docker_images.yml index 2f76225af..01dedf3f6 100644 --- a/.github/workflows/build_and_push_docker_images.yml +++ b/.github/workflows/build_and_push_docker_images.yml @@ -1,6 +1,10 @@ name: Build and Push Docker Images on: push: + branches: + - master + - main + - dev workflow_dispatch: branches: - master @@ -16,6 +20,12 @@ jobs: if: ${{ github.ref_type == 'tag' || github.event.inputs.build_docker_images }} runs-on: ubuntu-20.04 steps: + - name: Cache Hermes deps Docker + uses: actions/cache@v3 + id: docker-deps-cache + with: + path: ci/deps/deps.Dockerfile + key: docker-${{ hashFiles('ci/deps/deps.Dockerfile') }} - name: Checkout uses: actions/checkout@v3 - name: Login to Docker Hub @@ -27,6 +37,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Build and push deps.Dockerfile uses: docker/build-push-action@v4 + if: steps.docker-deps-cache.outputs.cache-hit != 'true' with: context: ./ file: ./docker/deps.Dockerfile From f2e5f5a5d201f669496cca7da6a509b1f27f38dc Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Thu, 8 Feb 2024 12:03:17 -0600 Subject: [PATCH 13/13] Always use mkdir -p --- ci/build_hermes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_hermes.sh b/ci/build_hermes.sh index 223e7d4f5..63637df26 100755 --- a/ci/build_hermes.sh +++ b/ci/build_hermes.sh @@ -72,7 +72,7 @@ ctest -VV # Run make install unit test cd /hermes/test/unit/external -mkdir build +mkdir -p build cd build cmake ../ make -j4