-
Notifications
You must be signed in to change notification settings - Fork 4
Misiug/multi node docker containers #134
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
0ad9ed7
a496b61
4a21359
bf7ac7d
0d33647
52a4755
ae18cea
d265e0b
6753aea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,3 +28,44 @@ services: | |
| - ./config/generated/gpu/etc_common:/opt/presto-server/etc | ||
| - ./config/generated/gpu/etc_worker/node.properties:/opt/presto-server/etc/node.properties | ||
| - ./config/generated/gpu/etc_worker/config_native.properties:/opt/presto-server/etc/config.properties | ||
|
|
||
| # These workers are available to run on one node with a single GPU pinned to each. | ||
|
||
| presto-native-worker-gpu-0: | ||
|
||
| extends: | ||
| service: presto-native-worker-gpu | ||
| container_name: presto-native-worker-gpu-0 | ||
| environment: | ||
| - NVIDIA_VISIBLE_DEVICES=0 | ||
| volumes: | ||
| - ./config/generated/gpu/etc_worker_0/node.properties:/opt/presto-server/etc/node.properties | ||
| - ./config/generated/gpu/etc_worker_0/config_native.properties:/opt/presto-server/etc/config.properties | ||
|
|
||
| presto-native-worker-gpu-1: | ||
| extends: | ||
| service: presto-native-worker-gpu | ||
| container_name: presto-native-worker-gpu-1 | ||
| environment: | ||
| - NVIDIA_VISIBLE_DEVICES=1 | ||
| volumes: | ||
| - ./config/generated/gpu/etc_worker_1/node.properties:/opt/presto-server/etc/node.properties | ||
| - ./config/generated/gpu/etc_worker_1/config_native.properties:/opt/presto-server/etc/config.properties | ||
|
|
||
| presto-native-worker-gpu-2: | ||
| extends: | ||
| service: presto-native-worker-gpu | ||
| container_name: presto-native-worker-gpu-2 | ||
| environment: | ||
| - NVIDIA_VISIBLE_DEVICES=2 | ||
| volumes: | ||
| - ./config/generated/gpu/etc_worker_2/node.properties:/opt/presto-server/etc/node.properties | ||
| - ./config/generated/gpu/etc_worker_2/config_native.properties:/opt/presto-server/etc/config.properties | ||
|
|
||
| presto-native-worker-gpu-3: | ||
| extends: | ||
| service: presto-native-worker-gpu | ||
| container_name: presto-native-worker-gpu-3 | ||
| environment: | ||
| - NVIDIA_VISIBLE_DEVICES=3 | ||
| volumes: | ||
| - ./config/generated/gpu/etc_worker_3/node.properties:/opt/presto-server/etc/node.properties | ||
| - ./config/generated/gpu/etc_worker_3/config_native.properties:/opt/presto-server/etc/config.properties | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,19 +66,22 @@ function conditionally_add_build_target() { | |
| echo "Added $2 to the list of services to build because the '$BUILD_TARGET' build target was specified" | ||
| BUILD_TARGET_ARG+=($2) | ||
| fi | ||
| } | ||
| } | ||
|
|
||
| conditionally_add_build_target $COORDINATOR_IMAGE $COORDINATOR_SERVICE "coordinator|c" | ||
|
|
||
| if [[ "$VARIANT_TYPE" == "java" ]]; then | ||
| DOCKER_COMPOSE_FILE="java" | ||
| conditionally_add_build_target $JAVA_WORKER_IMAGE $JAVA_WORKER_SERVICE "worker|w" | ||
| WORKERS="$JAVA_WORKER_SERVICE" | ||
|
||
| elif [[ "$VARIANT_TYPE" == "cpu" ]]; then | ||
| DOCKER_COMPOSE_FILE="native-cpu" | ||
| conditionally_add_build_target $CPU_WORKER_IMAGE $CPU_WORKER_SERVICE "worker|w" | ||
| WORKERS="$CPU_WORKER_SERVICE" | ||
| elif [[ "$VARIANT_TYPE" == "gpu" ]]; then | ||
| DOCKER_COMPOSE_FILE="native-gpu" | ||
| conditionally_add_build_target $GPU_WORKER_IMAGE $GPU_WORKER_SERVICE "worker|w" | ||
| WORKERS="$GPU_WORKER_SERVICE" | ||
| else | ||
| echo "Internal error: unexpected VARIANT_TYPE value: $VARIANT_TYPE" | ||
| fi | ||
|
|
@@ -130,4 +133,26 @@ if (( ${#BUILD_TARGET_ARG[@]} )); then | |
| ${BUILD_TARGET_ARG[@]} | ||
| fi | ||
|
|
||
| docker compose -f $DOCKER_COMPOSE_FILE_PATH up -d | ||
| function duplicate_worker_configs() { | ||
|
||
| local worker_config="../docker/config/generated/gpu/etc_worker_${1}" | ||
| rm -rf ${worker_config} | ||
| cp -r ../docker/config/generated/gpu/etc_worker ${worker_config} | ||
|
|
||
| sed -i "s+http-server\.http\.port.*+http-server\.http\.port=808${1}+g" \ | ||
| ${worker_config}/config_native.properties | ||
| sed -i "s+single-node-execution-enabled.*+single-node-execution-enabled=false+g" \ | ||
| ${worker_config}/config_native.properties | ||
|
|
||
| # Give each worker a unique id. | ||
| sed -i "s+node\.id.*+node\.id=worker_${1}+g" ${worker_config}/node.properties | ||
| } | ||
|
|
||
| if [[ -n "$NUM_WORKERS" && "$VARIANT_TYPE" == "gpu" ]]; then | ||
| WORKERS="" | ||
| for i in $( seq 0 $(( $NUM_WORKERS - 1 )) ); do | ||
| WORKERS="$WORKERS ${GPU_WORKER_SERVICE}-${i}" | ||
| duplicate_worker_configs $i | ||
| done | ||
| fi | ||
|
|
||
| docker compose -f $DOCKER_COMPOSE_FILE_PATH up -d $WORKERS | ||
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.
This port should be distinct from the port used to connect to the presto-coordinator if they are on the same machine.
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.
Can you please expand on why this is required now? This should be running as a separate service on the docker network.
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.
I found it to be necessary when working in Slurm environments, but that is because there is no docker network. I'll remove this as it isn't a change that is required for the scope of this PR.