Skip to content

Commit

Permalink
mark stargz configuration as experimental
Browse files Browse the repository at this point in the history
As the stargz compatiblity feature is not production ready
 and reliable enought.

Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
  • Loading branch information
changweige committed Feb 7, 2023
1 parent fcca6f9 commit f6d9be0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 5 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ const (
FsDriverFscache string = "fscache"
)

type Experimental struct {
EnableStargz bool `toml:"enable_stargz"`
}

// Configure how to start and recover nydusd daemons
type DaemonConfig struct {
NydusdPath string `toml:"nydusd_path"`
Expand Down Expand Up @@ -169,7 +173,6 @@ type SnapshotterConfig struct {
Address string `toml:"address"`
EnableSystemController bool `toml:"enable_system_controller"`
DaemonMode string `toml:"daemon_mode"`
EnableStargz bool `toml:"enable_stargz"`
// Clean up all the resources when snapshotter is closed
CleanupOnClose bool `toml:"cleanup_on_close"`

Expand All @@ -180,6 +183,7 @@ type SnapshotterConfig struct {
ImageConfig ImageConfig `toml:"image"`
CacheManagerConfig CacheManagerConfig `toml:"cache_manager"`
LoggingConfig LoggingConfig `toml:"log"`
Experimental Experimental `toml:"experimental"`
}

func LoadSnapshotterConfig(path string) (*SnapshotterConfig, error) {
Expand Down
2 changes: 1 addition & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestLoadSnapshotterTOMLConfig(t *testing.T) {
Address: "/run/containerd-nydus/containerd-nydus-grpc.sock",
DaemonMode: "multiple",
EnableSystemController: true,
EnableStargz: false,
Experimental: Experimental{EnableStargz: false},
CleanupOnClose: false,
DaemonConfig: DaemonConfig{
NydusdPath: "/usr/local/bin/nydusd",
Expand Down
7 changes: 5 additions & 2 deletions misc/snapshotter/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ address = "/run/containerd-nydus/containerd-nydus-grpc.sock"
daemon_mode = "multiple"
# Snapshotter's debug and trace HTTP server interface
enable_system_controller = true
# Whether tp enable stargz support
enable_stargz = false
# Whether snapshotter should try to clean up resources when it is closed
cleanup_on_close = false

Expand Down Expand Up @@ -75,3 +73,8 @@ cache_dir = ""
[image]
public_key_file = ""
validate_signature = false

# The configuraions for features that are not production ready
[experimental]
# Whether tp enable stargz support
enable_stargz = false
2 changes: 1 addition & 1 deletion snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func NewSnapshotter(ctx context.Context, cfg *config.SnapshotterConfig) (snapsho
filesystem.WithNydusImageBinaryPath(cfg.DaemonConfig.NydusdPath),
filesystem.WithVerifier(verifier),
filesystem.WithRootMountpoint(path.Join(cfg.Root, "mnt")),
filesystem.WithEnableStargz(cfg.EnableStargz),
filesystem.WithEnableStargz(cfg.Experimental.EnableStargz),
}

cacheConfig := &cfg.CacheManagerConfig
Expand Down

0 comments on commit f6d9be0

Please sign in to comment.