-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switched deployment method to use custom docker compose file and dock…
…er image
- Loading branch information
1 parent
1f6e8a3
commit 4efc512
Showing
9 changed files
with
152 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ./docker/mpi-native.env | ||
|
||
docker-compose \ | ||
--file ${COMPOSE_FILE} \ | ||
--env-file ${ENV_FILE} \ | ||
down | ||
|
||
popd >> /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
THIS_DIR=$(dirname $(readlink -f $0)) | ||
PROJ_ROOT=${THIS_DIR}/.. | ||
|
||
pushd ${PROJ_ROOT} >> /dev/null | ||
|
||
source ./docker/mpi-native.env | ||
|
||
# Check for command line arguments | ||
docker-compose \ | ||
--file ${COMPOSE_FILE} \ | ||
--env-file ${ENV_FILE} \ | ||
up -d \ | ||
--scale worker=$((${MPI_WORLD_SIZE} -1)) \ | ||
--force-recreate | ||
|
||
docker-compose \ | ||
--file ${COMPOSE_FILE} \ | ||
--env-file ${ENV_FILE} \ | ||
logs master worker | ||
|
||
popd >> /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM faasm/grpc-root:0.0.16 | ||
ARG FAABRIC_VERSION | ||
|
||
# Note - the version of grpc-root here can be quite behind as it's rebuilt very | ||
# rarely | ||
|
||
# Redis | ||
RUN apt install -y \ | ||
libpython3-dev \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3-venv \ | ||
redis-tools | ||
|
||
# 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 | ||
|
||
WORKDIR /code/faabric | ||
|
||
RUN pip3 install invoke | ||
|
||
# Build MPI native lib | ||
RUN inv dev.cmake --shared | ||
RUN inv dev.cc faabricmpi_native --shared | ||
RUN inv dev.install faabricmpi_native --shared | ||
|
||
# Build examples | ||
RUN inv examples.build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
version: "3" | ||
|
||
services: | ||
redis: | ||
image: redis | ||
|
||
worker: | ||
image: ${FAABRIC_MPI_NATIVE_IMAGE} | ||
entrypoint: /code/faabric/examples/build/${MPI_EXAMPLE} | ||
working_dir: /code/faabric | ||
privileged: true | ||
environment: | ||
- LD_LIBRARY_PATH=/usr/local/lib:/build/faabric/install/lib | ||
- FUNCTION_STORAGE=local | ||
- LOG_LEVEL=debug | ||
- REDIS_STATE_HOST=redis | ||
- REDIS_QUEUE_HOST=redis | ||
depends_on: | ||
- redis | ||
|
||
master: | ||
image: ${FAABRIC_MPI_NATIVE_IMAGE} | ||
entrypoint: ['/code/faabric/examples/build/${MPI_EXAMPLE}', 'master', '${MPI_WORLD_SIZE}'] | ||
working_dir: /code/faabric | ||
privileged: true | ||
environment: | ||
- LD_LIBRARY_PATH=/usr/local/lib:/build/faabric/install/lib | ||
- FUNCTION_STORAGE=local | ||
- LOG_LEVEL=debug | ||
- REDIS_STATE_HOST=redis | ||
- REDIS_QUEUE_HOST=redis | ||
depends_on: | ||
- redis | ||
- worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FAABRIC_VERSION=0.0.16 | ||
FAABRIC_MPI_NATIVE_IMAGE=faasm/faabric-mpi-native:0.0.16 | ||
COMPOSE_PROJECT_NAME=faabric-mpi | ||
|
||
COMPOSE_FILE="./docker/mpi-native-docker-compose.yml" | ||
ENV_FILE="./docker/mpi-native.env" | ||
|
||
# Deployment-specific | ||
MPI_WORLD_SIZE=1 | ||
MPI_EXAMPLE=mpi_helloworld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters