@@ -2,6 +2,7 @@
---
+name: ab2
x-base-service: &base-service
build:
context: ..
@@ -17,15 +18,18 @@ x-base-service: &base-service
services:
controller:
<<: *base-service
+ command: controller
ports:
- 8010:8010
cpus: 4
worker: &base-worker
<<: *base-service
+ command: worker
cpus: 8
mem_limit: 16gb
extraworker:
<<: *base-worker
+ command: extraworker
cpus: 1
mem_limit: 2gb
deploy:
@@ -6,9 +6,9 @@ chown pokybuild:nogroup /home/pokybuild/git/mirror
chown pokybuild:nogroup /srv/autobuilder
cd /home/pokybuild/ || exit 1
+role=${1}
docker_name=$(host "$(host "$(hostname)" | awk '{print $NF}')" | awk '{print $NF}' | awk -F . '{print $1}')
-role=$(echo "${docker_name}" | cut -d_ -f 2)
-instance=$(echo "${docker_name}" | cut -d_ -f 3)
+instance=$(echo "${docker_name}" | sed -e 's/.*[^0-9]\([0-9]*\)$/\1/')
if [ "${role}" = "controller" ]; then
su pokybuild -c "yocto-autobuilder-helper/janitor/ab-janitor" &
It looks like the name of docker containers created with docker-compose is not always the same: is is generated from various values, sometimes separated by underscores, sometimes by dashes, breaking role detection. Try to use another method that should be a bit more reliable. Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> --- docker/compose.yaml | 4 ++++ docker/entry.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-)