Unverified Commit 6831020f authored by Schwinn Saereesitthipitak's avatar Schwinn Saereesitthipitak Committed by GitHub
Browse files

chore: rename chrek to Dynamo Snapshot (#7028)


Signed-off-by: default avatarSchwinn Saereesitthipitak <17022745+galletas1712@users.noreply.github.com>
parent 7dbebf3c
......@@ -7,7 +7,7 @@ import (
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/types"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/types"
)
func TestClassifyMounts(t *testing.T) {
......
// Package common provides low-level container, process, and device primitives
// shared across chrek packages.
// shared across snapshot packages.
package common
import (
......
......@@ -10,7 +10,7 @@ import (
"github.com/go-logr/logr"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/types"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/types"
)
const (
......
......@@ -8,7 +8,7 @@ import (
"github.com/go-logr/logr/testr"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/types"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/types"
)
func TestBuildExclusions(t *testing.T) {
......
......@@ -12,8 +12,8 @@ import (
"github.com/go-logr/logr"
"google.golang.org/protobuf/proto"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/common"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/types"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/common"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/types"
)
const (
......
......@@ -11,8 +11,8 @@ import (
"github.com/go-logr/logr"
"google.golang.org/protobuf/proto"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/logging"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/types"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/logging"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/types"
)
// RestoreLogFilename is the CRIU restore log filename (also used by orchestrate/restore.go).
......
......@@ -9,7 +9,7 @@ import (
"golang.org/x/sys/unix"
"google.golang.org/protobuf/proto"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/types"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/types"
)
// parseManageCgroupsMode normalizes and validates the CRIU cgroup mode setting.
......
......@@ -5,7 +5,7 @@ import (
criurpc "github.com/checkpoint-restore/go-criu/v8/rpc"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/types"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/types"
)
func TestParseManageCgroupsMode(t *testing.T) {
......
......@@ -9,7 +9,7 @@ import (
"github.com/go-logr/logr"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/common"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/common"
)
// LogProcessDiagnostics logs process state and CRIU restore log for debugging a failed restore.
......
// Package logging provides shared logger configuration for chrek binaries.
// Package logging provides shared logger configuration for snapshot binaries.
package logging
import (
......@@ -12,11 +12,11 @@ import (
"go.uber.org/zap/zapcore"
)
// ConfigureLogger creates a logr.Logger from the CHREK_LOG_LEVEL environment variable.
// ConfigureLogger creates a logr.Logger from the SNAPSHOT_LOG_LEVEL environment variable.
// output controls where log lines are written ("stdout" or "stderr").
// Supported levels: trace, debug, info, warn, error. Defaults to info.
func ConfigureLogger(output string) logr.Logger {
level := strings.TrimSpace(strings.ToLower(os.Getenv("CHREK_LOG_LEVEL")))
level := strings.TrimSpace(strings.ToLower(os.Getenv("SNAPSHOT_LOG_LEVEL")))
if level == "" {
level = "info"
}
......@@ -57,7 +57,7 @@ func ConfigureLogger(output string) logr.Logger {
log := zapr.NewLogger(zapLog)
if parseErr != nil {
log.WithName("setup").Info("Invalid CHREK_LOG_LEVEL, falling back to info", "value", level, "error", parseErr)
log.WithName("setup").Info("Invalid SNAPSHOT_LOG_LEVEL, falling back to info", "value", level, "error", parseErr)
}
return log
}
......@@ -13,10 +13,10 @@ import (
"github.com/containerd/containerd"
"github.com/go-logr/logr"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/common"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/criu"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/cuda"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/types"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/common"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/criu"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/cuda"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/types"
)
// CheckpointRequest holds per-checkpoint identifiers for a checkpoint operation.
......
......@@ -9,10 +9,10 @@ import (
criurpc "github.com/checkpoint-restore/go-criu/v8/rpc"
"github.com/go-logr/logr"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/common"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/criu"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/cuda"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/types"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/common"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/criu"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/cuda"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/types"
)
// RestoreOptions holds configuration for an in-namespace restore.
......
......@@ -15,11 +15,11 @@ import (
"github.com/containerd/containerd"
"github.com/go-logr/logr"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/common"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/criu"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/cuda"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/logging"
"github.com/ai-dynamo/dynamo/deploy/chrek/pkg/types"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/common"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/criu"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/cuda"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/logging"
"github.com/ai-dynamo/dynamo/deploy/snapshot/pkg/types"
)
// RestoreRequest holds the parameters for a restore operation.
......@@ -153,6 +153,8 @@ func execNSRestore(ctx context.Context, log logr.Logger, req RestoreRequest, sna
}
cmd := exec.CommandContext(ctx, "nsenter", args...)
// Inherit the agent environment so nsrestore uses the same logger settings.
cmd.Env = os.Environ()
log.V(1).Info("Executing nsenter + nsrestore", "cmd", cmd.String())
var stdout bytes.Buffer
......@@ -175,4 +177,3 @@ func execNSRestore(ctx context.Context, log logr.Logger, req RestoreRequest, sna
return result.RestoredPID, nil
}
// Package types defines shared data types used across chrek packages.
// Package types defines shared data types used across snapshot packages.
package types
import (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment