Skip to content

fix(quake): prepare local service volume dirs#52

Open
giwaov wants to merge 1 commit intocirclefin:mainfrom
giwaov:fix/wsl2-volume-permissions
Open

fix(quake): prepare local service volume dirs#52
giwaov wants to merge 1 commit intocirclefin:mainfrom
giwaov:fix/wsl2-volume-permissions

Conversation

@giwaov
Copy link
Copy Markdown

@giwaov giwaov commented May 1, 2026

Summary

  • pre-create local monitoring data directories for Grafana and Prometheus during Quake setup
  • pre-create local Blockscout logs/dets bind mount directories during Quake setup
  • apply the existing local writable-directory permission handling to those service volume paths
  • add a unit test covering the generated local service volume directories

Fixes #32

Testing

  • cargo +1.93 fmt --check

I also tried cargo +1.93 check -p quake --bin quake, but this Windows environment is missing libclang for reth-mdbx-sys, so the build stops before checking the quake target.

Copy link
Copy Markdown

@bastienfaivre bastienfaivre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, left two nits!

Comment thread crates/quake/src/setup.rs
Comment on lines 343 to 344
/// Create EL data dirs and set directory permissions so containers (running as non-root user arc)
/// can write to mounted volumes. Required on Linux where bind-mount permissions are strict.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment needs a slight adjustment due to the changes made.

Suggested change
/// can write to mounted volumes. Required on Linux where bind-mount permissions are strict.
/// Create EL data dirs and set directory permissions so containers (running as non-root user)
/// can write to mounted volumes. Required on Linux where bind-mount permissions are strict.

Comment thread crates/quake/src/setup.rs
] {
assert!(path.is_dir(), "expected {} to exist", path.display());
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extend the test to also verify that the directories have the correct permissions.

Suggested change
}
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
let writable_dirs = [
testnet_dir.join("logs"),
monitoring_dir.join("data").join("grafana"),
monitoring_dir.join("data").join("prometheus"),
testnet_dir.join("blockscout").join("logs"),
testnet_dir.join("blockscout").join("dets"),
];
for path in &writable_dirs {
let mode = fs::metadata(path).unwrap().permissions().mode() & 0o777;
assert_eq!(mode, 0o777, "{} mode = {:o}, want 0o777", path.display(), mode);
}
}
}

Comment thread crates/quake/src/setup.rs
Comment on lines +353 to +356
monitoring_dir.join("data").join("grafana"),
monitoring_dir.join("data").join("prometheus"),
testnet_dir.join("blockscout").join("logs"),
testnet_dir.join("blockscout").join("dets"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Monitoring directories should not be created here. There's a setup method in MonitoringManager for that.

@giwaov
Copy link
Copy Markdown
Author

giwaov commented May 4, 2026

Thanks, fixed.

I moved the monitoring data dir creation/permissions into MonitoringManager::setup() and kept set_local_testnet_directory_permissions() focused on the local testnet/blockscout/node volume dirs.

Also added a focused test for the monitoring setup path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WSL2: Volume permission errors for Grafana, Prometheus, and Blockscout on startup

3 participants