Skip to content

Commit 07296f9

Browse files
Shubhranshu153sondavidb
authored andcommitted
Fix daemon startup latency issue by providing an option to skip snapshotter supported flag
Signed-off-by: Shubharanshu Mahapatra <[email protected]>
1 parent e1ceff5 commit 07296f9

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

cmd/soci-snapshotter-grpc/main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,13 @@ func main() {
125125
log.G(ctx).WithError(err).Fatal(err)
126126
}
127127

128-
if err := service.Supported(*rootDir); err != nil {
129-
log.G(ctx).WithError(err).Fatalf("snapshotter is not supported")
128+
if !cfg.SkipCheckSnapshotterSupported {
129+
if err := service.Supported(*rootDir); err != nil {
130+
log.G(ctx).WithError(err).Fatalf("snapshotter is not supported")
131+
}
132+
log.G(ctx).Debug("snapshotter is supported")
133+
} else {
134+
log.G(ctx).Warn("skipped snapshotter is supported check")
130135
}
131136

132137
// Create a gRPC server

config/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ type Config struct {
6969

7070
// MetadataStore is the type of the metadata store to use.
7171
MetadataStore string `toml:"metadata_store" default:"db"`
72+
73+
// SkipCheckSnapshotterSupported is a flag to skip check for overlayfs support needed to confirm if SOCI can work
74+
SkipCheckSnapshotterSupported bool `toml:"skip_check_snapshotter_supported"`
7275
}
7376
type configParser func(*Config)
7477

config/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ metrics_network="" # Uses default metrics network
3131
# no_prometheus=true # Defined above, can't be redeclared
3232
debug_address=""
3333
metadata_store="db"
34+
skip_check_snapshotter_supported=false
3435

3536
[http]
3637
MaxRetries=0

docs/config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ This set of variables must be at the top of your TOML file due to not belonging
3434
- `no_prometheus` — Defined [above](#configfsgofsconfig), cannot be redeclared.
3535
- `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: "".
3636
- `metadata_store` (string) — Metadata storage type. Only "db" is valid. Default: "db".
37+
- `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
3738

3839
#
3940

0 commit comments

Comments
 (0)