Skip to content

Commit

Permalink
Fix daemon startup latency issue by providing an option to skip snaps…
Browse files Browse the repository at this point in the history
…hotter supported flag
  • Loading branch information
Shubhranshu153 committed Jun 19, 2024
1 parent e1ceff5 commit 20513a7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cmd/soci-snapshotter-grpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,19 @@ func main() {
log.G(ctx).WithError(err).Fatal(err)
}

if err := service.Supported(*rootDir); err != nil {
log.G(ctx).WithError(err).Fatalf("snapshotter is not supported")
if !cfg.SkipCheckSnapshotterSupported {
if err := service.Supported(*rootDir); err != nil {
log.G(ctx).WithError(err).Fatalf("snapshotter is not supported")
}
log.G(ctx).WithFields(logrus.Fields{
"version": version.Version,
"revision": version.Revision,
}).Debug("snapshotter is supported")
} else {
log.G(ctx).WithFields(logrus.Fields{
"version": version.Version,
"revision": version.Revision,
}).Warn("Skipped snapshotter is supported check ")
}

// Create a gRPC server
Expand Down
1 change: 1 addition & 0 deletions config/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type FSConfig struct {
NoPrometheus bool `toml:"no_prometheus"`
MountTimeoutSec int64 `toml:"mount_timeout_sec"`
FuseMetricsEmitWaitDurationSec int64 `toml:"fuse_metrics_emit_wait_duration_sec"`
SkipCheckSnapshotterSupported bool `toml:"skip_check_snapshotter_supported"`

RetryableHTTPClientConfig `toml:"http"`
BlobConfig `toml:"blob"`
Expand Down
1 change: 1 addition & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This set of variables must be at the top of your TOML file due to not belonging
- `no_prometheus` (bool) — Toggle prometheus metrics. Default: false.
- `mount_timeout_sec` (int) — Timeout for mount if a layer can't be resolved. Default: 30.
- `fuse_metrics_emit_wait_duration_sec` (int) — The wait time before the snaphotter emits FUSE operation counts for an image. Default: 60.
- `skip_check_snapshotter_supported` (bool) - skip check for snapshotter is supported which can give performance benefits for soci daemon startup time. This config to be done if you are sure overlayfs is supported. Default: false

## config/config.go
### Config
Expand Down

0 comments on commit 20513a7

Please sign in to comment.