-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added container configuration system from libfabric-sarus
into mater
#31
Open
mattnappo
wants to merge
8
commits into
master
Choose a base branch
from
container-config
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dc7da35
Adding container config from #29
mattnappo 4bc28b2
Finished changes. Testing now
mattnappo cc1ef72
Added Docker scripts
mattnappo 1227a63
Added help to CLIs
mattnappo d707580
Made registry mount configurable. Began writing documentation
mattnappo 4e34cc4
[exec mgr] Fix a bug regarding execvp nullptrs
mattnappo 11e687d
Remove gitignore; we'll merge and clear it later
mcopik b0f1dfc
[rdmalib] Remove incorrect include
mcopik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,54 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Fortran module files | ||
*.mod | ||
*.smod | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
|
||
# CMake | ||
CMakeLists.txt.user | ||
CMakeCache.txt | ||
CMakeFiles | ||
CMakeScripts | ||
Testing | ||
Makefile | ||
cmake_install.cmake | ||
install_manifest.txt | ||
compile_commands.json | ||
CTestTestfile.cmake | ||
_deps | ||
bin/ | ||
configuration/ | ||
volumes/ | ||
containers/config/htpasswd | ||
|
||
benchmarks/warm_benchmarker | ||
benchmarks/parallel_invocations | ||
benchmarks/cold_benchmarker | ||
benchmarks/cpp_interface |
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 |
---|---|---|
@@ -1,16 +1,73 @@ | ||
{ | ||
"config": { | ||
"rdma_device": "", | ||
"rdma_device_port": 10000, | ||
"rdma_device_port": 10004, | ||
"resource_manager_address": "", | ||
"resource_manager_port": 0, | ||
"resource_manager_secret": 0 | ||
}, | ||
"executor": { | ||
"use_docker": false, | ||
"sandbox_type": "process", | ||
"repetitions": 100, | ||
"warmup_iters": 0, | ||
"pin_threads": false | ||
} | ||
}, | ||
"sandbox-configuration": [ | ||
{ | ||
"key": "sarus", | ||
"value": { | ||
"index": 1, | ||
"data": { | ||
"user": "mcopik", | ||
"name": "spcleth/hpc-disagg:rfaas-executor-daint", | ||
"devices": [ | ||
"/dev/kgni0", "dev/kdreg" | ||
], | ||
"mounts": [ | ||
"/opt/cray", | ||
"/tmp/drcc.sock", | ||
"/etc/opt/cray/rdma-credentials", | ||
"/etc/alternatives/cray-ugni", | ||
"/etc/alternatives/cray-xpmem", | ||
"/etc/alternatives/cray-alps", | ||
"/etc/alternatives/cray-udreg", | ||
"/etc/alternatives/cray-wlm_detect" | ||
], | ||
"mount_filesystem": [ | ||
"/scratch/snx3000/{user}" | ||
], | ||
"env": [ | ||
{ | ||
"key": "LD_LIBRARY_PATH", | ||
"value": "/opt/cray/xpmem/default/lib64/;/opt/cray/udreg/default/lib64;/opt/cray/alps/default/lib64;/opt/cray/wlm_detect/default/lib64/" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"key": "docker", | ||
"value": { | ||
"index": 0, | ||
"data": { | ||
"image": "rfaas-registry/rfaas-base", | ||
"network": "mynet", | ||
"ip": "172.31.82.202", | ||
"volume": "/home/ubuntu/rfaas/containers/opt", | ||
"registry_ip": "172.31.82.200", | ||
"registry_port": 5000 | ||
} | ||
} | ||
}, | ||
{ | ||
"key": "singularity", | ||
"value": { | ||
"index": 2, | ||
"data": { | ||
"container": "rfaas-container-singularity" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
|
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,3 @@ | ||
#!/bin/bash | ||
|
||
docker build -t rfaas-base:latest - < rfaas-base.Dockerfile |
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,80 @@ | ||
#!/bin/bash | ||
|
||
# This script builds the rfaas-base docker container, pushes it to the | ||
# registry, sets up a docker volume, and generates example configuration | ||
# json which should then be updated in config/executor_manager.json. | ||
# The script also configures a docker network for suitable use with | ||
# docker_rdma_sriov | ||
|
||
# NOTE: Run this script from repo root, and make sure the sriov docker plugin | ||
# is installed | ||
|
||
set -e | ||
|
||
if [ $# -lt 2 ]; then | ||
echo "usage: ./init_docker.sh <REGISTRY IP> <REGISTRY PORT> <NETWORK MODE> [<NETWORK DEVICE> <SUBNET>]" | ||
exit | ||
fi | ||
|
||
REG_IP=$1 # IP or name of the docker registry | ||
REG_PORT=$2 # Port of the docker registry | ||
NET_MODE=$3 # Docker networking mode -- sriov or host | ||
DEVICE=$4 # The RDMA adapter to use for networking | ||
SUBNET=$5 # Subnet for the docker network | ||
|
||
IMG_NAME=rfaas-base | ||
REG_IMG=$REG_IP:$REG_PORT/$IMG_NAME | ||
|
||
# Build the docker container, login and push to the registry | ||
docker build -t $IMG_NAME - < containers/rfaas-base.Dockerfile | ||
echo "built rfaas-base image" | ||
docker login $REG_IP:$REG_PORT | ||
echo "logged into docker daemon" | ||
|
||
if docker push $REG_IMG; then | ||
echo "ERROR: make sure a docker registry is actually running on $REG_IP:$REG_PORT. | ||
Start one with scripts/run_registry.sh" | ||
exit | ||
else | ||
echo "pushed rfaas-base image to $REG_IMG" | ||
fi | ||
|
||
# Set up docker network | ||
net_name=testnet | ||
if ["$NET_MODE" = "sriov"]; then | ||
docker network create -d sriov --subnet=$SUBNET -o netdevice=$DEVICE $net_name | ||
elif ["$NET_MODE" = "host"]; then | ||
net_name="host" | ||
else | ||
echo "ERROR: invalid networking mode $NET_MODE. Valid options are sriov and host." | ||
exit | ||
fi | ||
echo "set up docker network" | ||
|
||
# Configure volume | ||
volume=$(pwd)/volumes/rfaas-test/opt # Do not put a trailing slash | ||
mkdir -p $volume/bin | ||
cp bin/executor $volume/bin | ||
cp examples/libfunctions.so $volume | ||
|
||
# Print json to be updated | ||
config=$(jq -n --arg use_docker "true" \ | ||
--arg image "$REG_IMG" \ | ||
--arg network "$net_name" \ | ||
--arg ip "<ip of container (any available ip within $SUBNET)>" \ | ||
--arg volume $volume \ | ||
--arg registry_ip "$REG_IP" \ | ||
--arg registry_port "$REG_PORT" \ | ||
'{ | ||
"image": $image, | ||
"network": $network, | ||
"ip": $ip, | ||
"volume": $volume, | ||
"registry_ip": $registry_ip, | ||
"registry_port": $registry_port | ||
}' | ||
) | ||
|
||
echo "Update config/executor_manager.json with" | ||
echo "$config" | ||
|
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,13 @@ | ||
#!/bin/bash | ||
|
||
# Push an image to the local docker registry | ||
|
||
if [ $# -lt 3 ]; then | ||
echo "usage: ./push_image.sh <IMAGE NAME> <REGISTRY NAME or IP> <REGISTRY PORT>"; | ||
exit | ||
fi | ||
|
||
IMAGE=$1 | ||
IP=$2 | ||
PORT=$3 | ||
docker push $IP:$PORT/$IMAGE |
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,20 @@ | ||
version: "3" | ||
|
||
services: | ||
registry: | ||
image: registry:2 | ||
container_name: rfaas-registry | ||
ports: | ||
- "5000:5000" | ||
environment: | ||
REGISTRY_AUTH: htpasswd | ||
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd | ||
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm | ||
REGISTRY_STORAGE_DELETE_ENABLED: "true" | ||
#REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt | ||
#REGISTRY_HTTP_TLS_KEY: /certs/domain.unencrypted.key | ||
#REGISTRY_HTTP_SECRET: supersecrettext | ||
volumes: | ||
- /home/ubuntu/rfaas/containers/registry:/var/lib/registry | ||
- /home/ubuntu/rfaas/containers/config:/auth | ||
#- /home/ubuntu/rfaas/containers/config/certs:/certs |
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,14 @@ | ||
# Container version should be same ubuntu version as where `executor` | ||
# was built (due to glibc versioning) | ||
|
||
FROM ubuntu:22.04 | ||
|
||
#ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update -y && apt-get upgrade -y \ | ||
&& apt-get install -y \ | ||
libibverbs-dev librdmacm-dev | ||
|
||
RUN mkdir -p /opt/bin | ||
WORKDIR "/opt/bin" | ||
|
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,47 @@ | ||
#!/bin/bash | ||
|
||
# Run this script on the server where you want the docker registry to be hosted | ||
# Recommended to host the registry on the same server as the executor manager | ||
|
||
# NOTE: Run this script from the repo root | ||
|
||
PORT=5000 | ||
NAME="rfaas-registry" | ||
|
||
set -e | ||
|
||
# Make password file if it doesn't already exist | ||
cfg=containers/config | ||
mkdir -p $cfg | ||
if [ -s $cfg/htpasswd ]; then | ||
echo "htpasswd exists" | ||
else | ||
sudo htpasswd -Bc $cfg/htpasswd $USER | ||
echo "created htpasswd file" | ||
fi | ||
|
||
# Generate certs to use TLS (if they dont already exist) | ||
## if [ -s $cfg/certs/domain.key ]; then | ||
## echo "using certs in $cfg/certs" | ||
## else | ||
## mkdir -p $cfg/certs | ||
## openssl genpkey -algorithm RSA -out $cfg/certs/domain.key -aes256 | ||
## | ||
## openssl req -new \ | ||
## -key $cfg/certs/domain.key \ | ||
## -out $cfg/certs/domain.csr \ | ||
## -addext 'subjectAltName = IP:172.31.82.200' | ||
## | ||
## openssl x509 -req -days 365 \ | ||
## -in $cfg/certs/domain.csr \ | ||
## -signkey $cfg/certs/domain.key \ | ||
## -out $cfg/certs/domain.crt | ||
## | ||
## openssl rsa -in $cfg/certs/domain.key -out $cfg/certs/domain.unencrypted.key | ||
## echo "generated certs in $cfg/certs" | ||
## fi | ||
|
||
# Start registry | ||
sudo docker-compose -f scripts/registry.yaml up -d | ||
echo "started docker registry $NAME on port $PORT" | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that necessary? It seems that it might prevent user from starting a registry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you referring to the volume mount?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the mounting of
/home/ubuntu/rfaas/..
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, starting a registry does require a volume. The user can mount to wherever they please on their local machine. We should either (a) make it clear that this is a point of configuration, or (b) mount to a set place, like
/opt/rfaas/registry
or something like that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattnappo Then I think we need to make it clear that it needs to be adapted by the user. Can we maybe put some hardcoded value like
REGISTRY_LOCATION_REPLACE_ME
? Otherwise people might miss it easily.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcopik Latest commit should resolve this. The documentation is still a WIP: I am going to add more to it.
I am also currently performing a final test of running the benchmarks with Docker. I will notify you when these tests pass, and then we can merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to merge!