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

Signed-off-by: Shubharanshu Mahapatra <[email protected]>
  • Loading branch information
Shubhranshu153 authored and sondavidb committed Jun 19, 2024
1 parent e1ceff5 commit 07296f9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/soci-snapshotter-grpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,13 @@ 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).Debug("snapshotter is supported")
} else {
log.G(ctx).Warn("skipped snapshotter is supported check")
}

// Create a gRPC server
Expand Down
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ type Config struct {

// MetadataStore is the type of the metadata store to use.
MetadataStore string `toml:"metadata_store" default:"db"`

// SkipCheckSnapshotterSupported is a flag to skip check for overlayfs support needed to confirm if SOCI can work
SkipCheckSnapshotterSupported bool `toml:"skip_check_snapshotter_supported"`
}
type configParser func(*Config)

Expand Down
1 change: 1 addition & 0 deletions config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ metrics_network="" # Uses default metrics network
# no_prometheus=true # Defined above, can't be redeclared
debug_address=""
metadata_store="db"
skip_check_snapshotter_supported=false

[http]
MaxRetries=0
Expand Down
1 change: 1 addition & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ This set of variables must be at the top of your TOML file due to not belonging
- `no_prometheus` — Defined [above](#configfsgofsconfig), cannot be redeclared.
- `debug_address` (string) — Address where [go pprof](https://pkg.go.dev/net/http/pprof) server will listen. If empty, no logs will be emitted. Default: "".
- `metadata_store` (string) — Metadata storage type. Only "db" is valid. Default: "db".
- `skip_check_snapshotter_supported` (bool) - skip check for snapshotter is supported which can give performance benefits for SOCI daemon startup time. This config should only be done if you are sure overlayfs is supported. Default: false

#

Expand Down

0 comments on commit 07296f9

Please sign in to comment.