Skip to content

Commit

Permalink
Merge pull request #673 from lukemartinlogan/master
Browse files Browse the repository at this point in the history
Deployment updates
  • Loading branch information
lukemartinlogan authored Feb 8, 2024
2 parents 09c8462 + f2e5f5a commit 5d69d72
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 101 deletions.
43 changes: 29 additions & 14 deletions .github/workflows/build_and_push_docker_images.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,49 @@
name: Build and Push Docker Images
on:
push:
branches:
- master
- main
- dev
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'
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 }}
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
uses: docker/login-action@v2
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
if: steps.docker-deps-cache.outputs.cache-hit != 'true'
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:
Expand Down
48 changes: 34 additions & 14 deletions CMake/HermesConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@
# 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_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@)
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
Expand All @@ -20,20 +35,24 @@ 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 hrun_server
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")
set(Hermes_FOUND FALSE)
set(Hermes_FOUND OFF)
message(STATUS "LIBS: $ENV{LD_LIBRARY_PATH}")
return()
endif()

#-----------------------------------------------------------------------------
# Find all packages needed by Hermes
#-----------------------------------------------------------------------------

# HermesShm
find_package(HermesShm CONFIG REQUIRED)
message(STATUS "found hermes_shm.h at ${HermesShm_INCLUDE_DIRS}")
Expand All @@ -60,15 +79,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)
Expand All @@ -83,6 +98,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}
Expand All @@ -92,9 +108,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 "")
30 changes: 28 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
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
#-----------------------------------------------------------------------------
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" 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)
Expand Down Expand Up @@ -48,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
Expand Down
10 changes: 6 additions & 4 deletions ci/build_hermes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -70,7 +72,7 @@ ctest -VV

# Run make install unit test
cd /hermes/test/unit/external
mkdir build
mkdir -p build
cd build
cmake ../
make -j8
make -j4
36 changes: 19 additions & 17 deletions ci/hermes/packages/hermes/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,25 @@ 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('[email protected]')
depends_on('[email protected]')
depends_on('mpi')
depends_on('cereal')
depends_on('yaml-cpp')
depends_on('libaio')
depends_on('doxygen') # @1.9.3
depends_on('[email protected]: +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('[email protected]', 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')
depends_on('hermes_shm+encrypt', when='+encrypt')
depends_on('hermes_shm+compress', when='+compress')

def cmake_args(self):
args = []
Expand All @@ -72,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):
Expand All @@ -92,6 +93,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)
Expand Down
Loading

0 comments on commit 5d69d72

Please sign in to comment.