Skip to content

Commit

Permalink
modified cmake and added new check in actions
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Jan 20, 2021
1 parent 2bd711f commit 1ecd8f4
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 8 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,23 @@ jobs:
run: inv examples
- name: "Run example to check"
run: inv examples.execute check

mpi_native:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
env:
HOST_TYPE: ci
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
services:
redis:
image: redis
steps:
# --- Code update ---
- name: "Fetch ref"
uses: actions/checkout@v2
# --- Examples ---
- name: "Build docker compose images"
run: ./mpi-native/build.sh
- name: "Run a sample example"
run: ./mpi-native/run.sh
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# External libraries
include(cmake/ExternalProjects.cmake)
# TODO change
link_directories(${CMAKE_INSTALL_PREFIX}/lib)

# Library funcs
function(faabric_lib lib_name lib_deps)
Expand Down Expand Up @@ -85,7 +83,7 @@ add_library(faabric
$<TARGET_OBJECTS:util_obj>
)

add_dependencies(faabric pistache_ext spdlog_ext)
add_dependencies(faabric pistache spdlog_ext)

target_link_libraries(faabric
${Protobuf_LIBRARIES}
Expand Down
8 changes: 7 additions & 1 deletion cmake/ExternalProjects.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ set(GRPC_PLUGIN /usr/local/bin/grpc_cpp_plugin)

# Pistache
ExternalProject_Add(pistache_ext
GIT_REPOSITORY "https://github.com/oktal/pistache.git"
GIT_REPOSITORY "https://github.com/pistacheio/pistache.git"
GIT_TAG "2ef937c434810858e05d446e97acbdd6cc1a5a36"
CMAKE_CACHE_ARGS "-DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}"
BUILD_BYPRODUCTS ${CMAKE_INSTALL_PREFIX}/lib/libpistache.so
)
ExternalProject_Get_Property(pistache_ext SOURCE_DIR)
set(PISTACHE_INCLUDE_DIR ${SOURCE_DIR}/include)
add_library(pistache SHARED IMPORTED)
add_dependencies(pistache pistache_ext)
set_target_properties(pistache
PROPERTIES IMPORTED_LOCATION ${CMAKE_INSTALL_PREFIX}/lib/libpistache.so
)

# RapidJSON
ExternalProject_Add(rapidjson_ext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ RUN apt install -y \

# Put the code in place
WORKDIR /code
# RUN git clone -b v${FAABRIC_VERSION} https://github.com/faasm/faabric
RUN git clone -b standalone-mpi https://github.com/csegarragonz/faabric
RUN git clone -b v${FAABRIC_VERSION} https://github.com/faasm/faabric

WORKDIR /code/faabric

Expand Down
4 changes: 2 additions & 2 deletions docs/native_mpi.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ inv container.build-mpi-native
```

Then you may run arbitrary deployments setting the right values in
`docker/mpi-native.env` and running `./bin/run_mpi_native.sh`.
`mpi-native/mpi-native.env` and running `./mpi-native/run.sh`.

You may remove all stopped and running container images with:
```bash
./bin/clean_mpi_native.sh
./mpi-native/clean.sh
```
17 changes: 17 additions & 0 deletions mpi-native/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -e

THIS_DIR=$(dirname $(readlink -f $0))
PROJ_ROOT=${THIS_DIR}/..

pushd ${PROJ_ROOT} >> /dev/null

source ./mpi-native/mpi-native.env

docker-compose \
--file ${COMPOSE_FILE} \
--env-file ${ENV_FILE} \
build

popd >> /dev/null
8 changes: 8 additions & 0 deletions tasks/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,11 @@ def push_grpc(ctx):
Push current version of gRPC container
"""
_do_push(GRPC_IMAGE_NAME)


@task
def push_mpi_native(ctx):
"""
Push current version of gRPC container
"""
_do_push(MPI_NATIVE_IMAGE_NAME)

0 comments on commit 1ecd8f4

Please sign in to comment.