From 7bd471c5001d4755f23341e837d444b0bfef2861 Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Wed, 14 Aug 2024 20:04:43 +0530 Subject: [PATCH 1/4] mount certs to each workers --- functions/onprem/orborus/orborus.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index 411571bb..e4166008 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -104,6 +104,8 @@ var memcached = os.Getenv("SHUFFLE_MEMCACHED") var tenzirUrl = os.Getenv("SHUFFLE_TENZIR_URL") var apiKey = os.Getenv("AUTH_FOR_ORBORUS") +var certPath = os.Getenv("SHUFFLE_CERT_DIR") + var executionIds = []string{} var namespacemade = false // For K8s @@ -1150,6 +1152,18 @@ func deployWorker(image string, identifier string, env []string, executionReques }, Resources: container.Resources{}, } + + _, err := os.ReadDir(certPath) + + if certPath != "" && err == nil { + certVol := mount.Mount{ + Type: mount.TypeBind, + Source: certPath, + Target: "/certs", + } + + hostConfig.Mounts = append(hostConfig.Mounts, certVol) + } if len(os.Getenv("DOCKER_HOST")) == 0 { if runtime.GOOS == "windows" { From e67c23a5c0e3b1db14a646d5403debc540e7d731 Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Tue, 20 Aug 2024 17:54:13 +0530 Subject: [PATCH 2/4] fix logic for cert mounting --- functions/onprem/orborus/orborus.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index e4166008..271b3bb1 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -104,8 +104,6 @@ var memcached = os.Getenv("SHUFFLE_MEMCACHED") var tenzirUrl = os.Getenv("SHUFFLE_TENZIR_URL") var apiKey = os.Getenv("AUTH_FOR_ORBORUS") -var certPath = os.Getenv("SHUFFLE_CERT_DIR") - var executionIds = []string{} var namespacemade = false // For K8s @@ -1152,7 +1150,17 @@ func deployWorker(image string, identifier string, env []string, executionReques }, Resources: container.Resources{}, } - + + certPath := "/certs" + + // This is just to test the mounting locally so + // I can control from what source I'm mounting + // the certs to. Default behaviour is: + // /certs:/certs. + if os.Getenv("SHUFFLE_CERT_PATH") != "" { + certPath = os.Getenv("SHUFFLE_CERT_PATH") + } + _, err := os.ReadDir(certPath) if certPath != "" && err == nil { From c07088e5cde5d08ed61ca013693c51aca64900c1 Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Sat, 30 Nov 2024 20:39:23 +0530 Subject: [PATCH 3/4] use swarm by default --- docker-compose.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 64155cc9..4bca9b95 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,11 +49,12 @@ services: - ORG_ID=Shuffle - BASE_URL=http://${OUTER_HOSTNAME}:5001 - DOCKER_API_VERSION=1.40 - - HTTP_PROXY=${HTTP_PROXY} - - HTTPS_PROXY=${HTTPS_PROXY} - SHUFFLE_PASS_WORKER_PROXY=${SHUFFLE_PASS_WORKER_PROXY} - SHUFFLE_PASS_APP_PROXY=${SHUFFLE_PASS_APP_PROXY} - SHUFFLE_STATS_DISABLED=true + - SHUFFLE_SWARM_CONFIG=run + - SHUFFLE_LOGS_DISABLED=true + - SHUFFLE_WORKER_IMAGE=ghcr.io/shuffle/shuffle-worker:nightly env_file: .env restart: unless-stopped security_opt: From 8f0b5029ab68de40036a319d4cfef92c95600f63 Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Sat, 30 Nov 2024 20:41:46 +0530 Subject: [PATCH 4/4] added back the http --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 4bca9b95..12e1a011 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,6 +49,8 @@ services: - ORG_ID=Shuffle - BASE_URL=http://${OUTER_HOSTNAME}:5001 - DOCKER_API_VERSION=1.40 + - HTTP_PROXY=${HTTP_PROXY} + - HTTPS_PROXY=${HTTPS_PROXY} - SHUFFLE_PASS_WORKER_PROXY=${SHUFFLE_PASS_WORKER_PROXY} - SHUFFLE_PASS_APP_PROXY=${SHUFFLE_PASS_APP_PROXY} - SHUFFLE_STATS_DISABLED=true