Skip to content

Commit 08a550e

Browse files
CLI: Update hypeman SDK to e77b77e3fe42c57676648f873cf87701d80728fa and add standby compression delay flags
Bump the CLI to the latest hypeman-go release and wire through the new standby compression delay settings so the existing run and standby flows stay aligned with the SDK surface. Made-with: Cursor
1 parent 4085805 commit 08a550e

4 files changed

Lines changed: 41 additions & 22 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/google/go-containerregistry v0.20.7
1212
github.com/gorilla/websocket v1.5.3
1313
github.com/itchyny/json2yaml v0.1.4
14-
github.com/kernel/hypeman-go v0.17.1-0.20260408200916-deb21b92fea7
14+
github.com/kernel/hypeman-go v0.18.0
1515
github.com/knadh/koanf/parsers/yaml v1.1.0
1616
github.com/knadh/koanf/providers/env v1.1.0
1717
github.com/knadh/koanf/providers/file v1.2.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 h1:8Tjv8EJ+pM1xP8mK6egEbD1OgnV
7878
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2/go.mod h1:pkJQ2tZHJ0aFOVEEot6oZmaVEZcRme73eIFmhiVuRWs=
7979
github.com/itchyny/json2yaml v0.1.4 h1:/pErVOXGG5iTyXHi/QKR4y3uzhLjGTEmmJIy97YT+k8=
8080
github.com/itchyny/json2yaml v0.1.4/go.mod h1:6iudhBZdarpjLFRNj+clWLAkGft+9uCcjAZYXUH9eGI=
81-
github.com/kernel/hypeman-go v0.17.1-0.20260408200916-deb21b92fea7 h1:71uvHkL9pTCwTyoTOitBvrwIBq2OQvwGFiQZT7+Ji+o=
82-
github.com/kernel/hypeman-go v0.17.1-0.20260408200916-deb21b92fea7/go.mod h1:guRrhyP9QW/ebUS1UcZ0uZLLJeGAAhDNzSi68U4M9hI=
81+
github.com/kernel/hypeman-go v0.18.0 h1:lznsO93fxpBfOLzr0mdMEMM0SsJHbeQhZ1Z7uyxLmOI=
82+
github.com/kernel/hypeman-go v0.18.0/go.mod h1:guRrhyP9QW/ebUS1UcZ0uZLLJeGAAhDNzSi68U4M9hI=
8383
github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co=
8484
github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0=
8585
github.com/knadh/koanf/maps v0.1.2 h1:RBfmAW5CnZT+PJ1CVc1QSJKf4Xu9kxfQgYVQSu8hpbo=

pkg/cmd/lifecycle.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ var standbyCmd = cli.Command{
4646
Name: "compression-enabled",
4747
Usage: "Enable memory compression for this standby operation",
4848
},
49+
&cli.StringFlag{
50+
Name: "compression-delay",
51+
Usage: `Delay before standby snapshot compression begins (e.g., "30s", "5m")`,
52+
},
4953
&cli.StringFlag{
5054
Name: "compression-algorithm",
5155
Usage: `Compression algorithm: "zstd" or "lz4"`,
@@ -153,7 +157,12 @@ func handleStandby(ctx context.Context, cmd *cli.Command) error {
153157
}
154158

155159
params := hypeman.InstanceStandbyParams{}
156-
if cmd.IsSet("compression-enabled") || cmd.IsSet("compression-algorithm") || cmd.IsSet("compression-level") {
160+
if cmd.IsSet("compression-enabled") || cmd.IsSet("compression-delay") || cmd.IsSet("compression-algorithm") || cmd.IsSet("compression-level") {
161+
request := hypeman.StandbyInstanceRequestParam{}
162+
if delay := cmd.String("compression-delay"); delay != "" {
163+
request.CompressionDelay = hypeman.Opt(delay)
164+
}
165+
157166
compression := shared.SnapshotCompressionConfigParam{
158167
Enabled: cmd.Bool("compression-enabled"),
159168
}
@@ -170,7 +179,8 @@ func handleStandby(ctx context.Context, cmd *cli.Command) error {
170179
}
171180
compression.Algorithm = parsedAlgorithm
172181
}
173-
params.Compression = compression
182+
request.Compression = compression
183+
params.StandbyInstanceRequest = request
174184
}
175185

176186
fmt.Fprintf(os.Stderr, "Putting %s into standby...\n", args[0])

pkg/cmd/run.go

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ Examples:
142142
Name: "snapshot-compression-enabled",
143143
Usage: "Enable snapshot memory compression for this instance policy",
144144
},
145+
&cli.StringFlag{
146+
Name: "snapshot-compression-delay",
147+
Usage: `Delay before standby snapshot compression begins (e.g., "30s", "5m")`,
148+
},
145149
&cli.StringFlag{
146150
Name: "snapshot-compression-algorithm",
147151
Usage: `Snapshot compression algorithm: "zstd" or "lz4"`,
@@ -347,26 +351,31 @@ func handleRun(ctx context.Context, cmd *cli.Command) error {
347351
}
348352

349353
// Snapshot policy compression
350-
if cmd.IsSet("snapshot-compression-enabled") || cmd.IsSet("snapshot-compression-algorithm") || cmd.IsSet("snapshot-compression-level") {
351-
compression := shared.SnapshotCompressionConfigParam{
352-
Enabled: cmd.Bool("snapshot-compression-enabled"),
353-
}
354-
if !cmd.IsSet("snapshot-compression-enabled") {
355-
compression.Enabled = true
354+
if cmd.IsSet("snapshot-compression-enabled") || cmd.IsSet("snapshot-compression-delay") || cmd.IsSet("snapshot-compression-algorithm") || cmd.IsSet("snapshot-compression-level") {
355+
policy := hypeman.SnapshotPolicyParam{}
356+
if delay := cmd.String("snapshot-compression-delay"); delay != "" {
357+
policy.StandbyCompressionDelay = hypeman.Opt(delay)
356358
}
357-
if cmd.IsSet("snapshot-compression-level") {
358-
compression.Level = hypeman.Opt(int64(cmd.Int("snapshot-compression-level")))
359-
}
360-
if algorithm := cmd.String("snapshot-compression-algorithm"); algorithm != "" {
361-
parsedAlgorithm, err := parseSnapshotCompressionAlgorithm(algorithm)
362-
if err != nil {
363-
return fmt.Errorf("invalid snapshot compression algorithm: %w", err)
359+
if cmd.IsSet("snapshot-compression-enabled") || cmd.IsSet("snapshot-compression-algorithm") || cmd.IsSet("snapshot-compression-level") {
360+
compression := shared.SnapshotCompressionConfigParam{
361+
Enabled: cmd.Bool("snapshot-compression-enabled"),
364362
}
365-
compression.Algorithm = parsedAlgorithm
366-
}
367-
params.SnapshotPolicy = hypeman.SnapshotPolicyParam{
368-
Compression: compression,
363+
if !cmd.IsSet("snapshot-compression-enabled") {
364+
compression.Enabled = true
365+
}
366+
if cmd.IsSet("snapshot-compression-level") {
367+
compression.Level = hypeman.Opt(int64(cmd.Int("snapshot-compression-level")))
368+
}
369+
if algorithm := cmd.String("snapshot-compression-algorithm"); algorithm != "" {
370+
parsedAlgorithm, err := parseSnapshotCompressionAlgorithm(algorithm)
371+
if err != nil {
372+
return fmt.Errorf("invalid snapshot compression algorithm: %w", err)
373+
}
374+
compression.Algorithm = parsedAlgorithm
375+
}
376+
policy.Compression = compression
369377
}
378+
params.SnapshotPolicy = policy
370379
}
371380

372381
// Volume mounts

0 commit comments

Comments
 (0)