From d3a5b67f61f0bc80e5f17165cd1e89cff859112f Mon Sep 17 00:00:00 2001 From: Cassandra Coyle Date: Fri, 19 Jul 2024 12:09:57 -0500 Subject: [PATCH 1/2] fix w/ @joshvanl & anton Signed-off-by: Cassandra Coyle --- pkg/standalone/standalone.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/standalone/standalone.go b/pkg/standalone/standalone.go index ac9e7ae97..43420432a 100644 --- a/pkg/standalone/standalone.go +++ b/pkg/standalone/standalone.go @@ -643,7 +643,16 @@ func runSchedulerService(wg *sync.WaitGroup, errorChan chan<- error, info initIn "--entrypoint", "./scheduler", } if info.schedulerVolume != nil { - args = append(args, "--volume", *info.schedulerVolume+":/var/lib/dapr/scheduler") + // Don't touch this file location unless things start breaking. + // In Docker, when Docker creates a volume and mounts that volume. Docker + // assumes the file permissions of that directory if it exists in the container. + // If that directory didn't exist in the container previously, then Docker sets + // the permissions owned by root and not writeable. + // We are lucky in that the Dapr containers have a world writeable directory at + // /var/lock and can therefore mount the Docker volume here. + // TODO: update the Dapr scheduler dockerfile to create a scheduler user id writeable + // directory at /var/lib/dapr/scheduler, then update the path here + args = append(args, "--volume", *info.schedulerVolume+":/var/lock") } if info.dockerNetwork != "" { @@ -664,7 +673,7 @@ func runSchedulerService(wg *sync.WaitGroup, errorChan chan<- error, info initIn ) } - args = append(args, image, "--etcd-data-dir=/var/lib/dapr/scheduler") + args = append(args, image, "--etcd-data-dir=/var/lock/dapr/scheduler") _, err = utils.RunCmdAndWait(runtimeCmd, args...) if err != nil { From e5fe319fd4c7ada7fa4f1cea62ff475cd9cc4246 Mon Sep 17 00:00:00 2001 From: Cassandra Coyle Date: Fri, 19 Jul 2024 12:23:05 -0500 Subject: [PATCH 2/2] add a . Signed-off-by: Cassandra Coyle --- pkg/standalone/standalone.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/standalone/standalone.go b/pkg/standalone/standalone.go index 43420432a..bc7fba008 100644 --- a/pkg/standalone/standalone.go +++ b/pkg/standalone/standalone.go @@ -651,7 +651,7 @@ func runSchedulerService(wg *sync.WaitGroup, errorChan chan<- error, info initIn // We are lucky in that the Dapr containers have a world writeable directory at // /var/lock and can therefore mount the Docker volume here. // TODO: update the Dapr scheduler dockerfile to create a scheduler user id writeable - // directory at /var/lib/dapr/scheduler, then update the path here + // directory at /var/lib/dapr/scheduler, then update the path here. args = append(args, "--volume", *info.schedulerVolume+":/var/lock") }