Skip to content
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

Fix Scheduler Data Dir Permissions Issue #1432

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions pkg/standalone/standalone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand All @@ -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 {
Expand Down
Loading