From a26471548b78585fb9685c3ec3b455d0439fbdf0 Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Mon, 2 Dec 2024 20:19:54 +0530 Subject: [PATCH 1/3] pull memcached image if not exists --- functions/onprem/orborus/orborus.go | 39 ++++++++++++++++------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index 8283b741..58b7b1d9 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -341,6 +341,7 @@ func deployServiceWorkers(image string) { log.Printf("[ERROR] Memcached is not running. Will try to deploy it.") deployMemcached(dockercli) } + ip := "shuffle-cache" os.Setenv("SHUFFLE_MEMCACHED", fmt.Sprintf("%s:11211", ip)) @@ -1256,27 +1257,27 @@ func deployWorker(image string, identifier string, env []string, executionReques Resources: container.Resources{}, } - certPath := "/certs" + 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") - } + // 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) + _, err := os.ReadDir(certPath) - if certPath != "" && err == nil { - certVol := mount.Mount{ - Type: mount.TypeBind, - Source: certPath, - Target: "/certs", - } + if certPath != "" && err == nil { + certVol := mount.Mount{ + Type: mount.TypeBind, + Source: certPath, + Target: "/certs", + } - hostConfig.Mounts = append(hostConfig.Mounts, certVol) - } + hostConfig.Mounts = append(hostConfig.Mounts, certVol) + } if len(os.Getenv("DOCKER_HOST")) == 0 { if runtime.GOOS == "windows" { @@ -3985,8 +3986,9 @@ func deployMemcached(dockercli *dockerclient.Client) error { ctx := context.Background() + memcachedImage := "memcached" containerConfig := &container.Config{ - Image: "memcached", + Image: memcachedImage, Cmd: []string{"-m", defaultMem}, } @@ -3996,6 +3998,7 @@ func deployMemcached(dockercli *dockerclient.Client) error { }, } + dockercli.ImagePull(ctx, memcachedImage, image.PullOptions{}) containerName := "shuffle-cache" resp, err := dockercli.ContainerCreate(ctx, containerConfig, hostConfig, nil, nil, containerName) From 045f20c9484101e2b32aa1f7e0aebed889deb386 Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Mon, 2 Dec 2024 20:56:45 +0530 Subject: [PATCH 2/3] removed noproxy as default from https and http in .env --- .env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 3fc249f7..b7b65b8f 100755 --- a/.env +++ b/.env @@ -48,8 +48,8 @@ DB_LOCATION=./shuffle-database DOCKER_API_VERSION=1.40 # Orborus/Proxy configurations -HTTP_PROXY=noproxy -HTTPS_PROXY=noproxy +HTTP_PROXY= +HTTPS_PROXY= SHUFFLE_PASS_WORKER_PROXY=TRUE SHUFFLE_PASS_APP_PROXY=TRUE SHUFFLE_INTERNAL_HTTP_PROXY=noproxy From 974682925387b30abeec6ff82ddcd3a0f82d7212 Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Mon, 2 Dec 2024 21:51:11 +0530 Subject: [PATCH 3/3] added full image for memcached --- functions/onprem/orborus/orborus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index 58b7b1d9..a9af0dd9 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -3986,7 +3986,7 @@ func deployMemcached(dockercli *dockerclient.Client) error { ctx := context.Background() - memcachedImage := "memcached" + memcachedImage := "docker.io/library/memcached:latest" containerConfig := &container.Config{ Image: memcachedImage, Cmd: []string{"-m", defaultMem},