Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,71 @@ jobs:
- name: Cleaning
if: ${{ always() }}
run: ./scripts/setup_tool clean_fcctr

remote-firecracker-snapshots-test:
name: "Unit tests: Remote Firecracker snapshots"
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
module: [storage, snapshotting] # ctriface
services:
minio: # MinIO service for testing remote snapshots
image: lazybit/minio # Can't use minio/minio because there's still no support for the jobs.<job_id>.services.<service_id>.command option in GH Actions
ports:
- 9000:9000
options: >-
--health-cmd "curl -f http://localhost:9000/minio/health/live || exit 1"
--health-interval 5s
--health-timeout 5s
--health-retries 5
volumes:
- ${{ github.workspace }}/data:/data
env:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
# command: server /data
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
lfs: true
path: vhive # Use a specific path to avoid conflicts with the MinIO volume

- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/vhive/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod

- name: Add rsync
run: |
sudo apt update
sudo apt install rsync -y

- name: Cleanup runner disk space
run: ./vhive/scripts/github_runner/gh-actions-disk-cleanup.sh

- name: Build setup scripts
run: pushd ./vhive/scripts && go build -o setup_tool && popd

- name: Pull binaries
run: ./vhive/scripts/setup_tool setup_firecracker_containerd

- name: Setup Stargz
run: ./vhive/scripts/setup_tool setup_stargz firecracker

- name: Build
run: cd ./vhive && go build -race -v -a ./...

- name: Run tests in submodules
env:
MODULE: ${{ matrix.module }}
run: |
make -C vhive/$MODULE test-remote-snaps

- name: Cleaning
if: ${{ always() }}
run: ./vhive/scripts/setup_tool clean_fcctr
40 changes: 21 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ EXTRATESTFILES:=vhive_test.go stats.go vhive.go functions.go
# WITHLAZY:=-lazyTest
WITHUPF:=
WITHLAZY:=
WITHSNAPSHOTS:=-snapshotsTest
STARGZ:=-ss 'proxy' -img 'ghcr.io/vhive-serverless/helloworld:var_workload-esgz'
DOCKER_CREDENTIALS:=-dockerCredentials '{"docker-credentials":{"ghcr.io":{"username":"","password":""}}}'
WITH_LOCAL_SNAPSHOTS:=-snapshotsTest 'local'
CTRDLOGDIR:=/tmp/ctrd-logs

vhive: proto
Expand All @@ -51,13 +53,13 @@ test:
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -short $(EXTRAGOARGS)
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log.err &
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -short $(EXTRAGOARGS) -args $(WITHSNAPSHOTS)
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -short $(EXTRAGOARGS) -args $(WITH_LOCAL_SNAPSHOTS)
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_upf_log.out 2>$(CTRDLOGDIR)/fccd_orch_upf_log.err &
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -short $(EXTRAGOARGS) -args $(WITHSNAPSHOTS) $(WITHUPF)
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -short $(EXTRAGOARGS) -args $(WITH_LOCAL_SNAPSHOTS) $(WITHUPF)
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_upf_lazy_log.out 2>$(CTRDLOGDIR)/fccd_orch_upf_lazy_log.err &
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -short $(EXTRAGOARGS) -args $(WITHSNAPSHOTS) $(WITHUPF) $(WITHLAZY)
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -short $(EXTRAGOARGS) -args $(WITH_LOCAL_SNAPSHOTS) $(WITHUPF) $(WITHLAZY)
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test -short $(EXTRAGOARGS) -run TestProfileSingleConfiguration -args -test -loadStep 100 && sudo rm -rf bench_results
Expand All @@ -70,46 +72,46 @@ test-man:
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_man_travis.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_man_travis.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS_NORACE) -run TestParallelServe
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestServeThree
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestServeThree -args $(WITHSNAPSHOTS)
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestServeThree -args $(WITH_LOCAL_SNAPSHOTS)
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_both_log_man_travis.out 2>$(CTRDLOGDIR)/fccd_orch_both_log_man_travis.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestServeThree -args $(WITHSNAPSHOTS) $(WITHUPF)
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestServeThree -args $(WITH_LOCAL_SNAPSHOTS) $(WITHUPF)
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_both_lazy_log_man_travis.out 2>$(CTRDLOGDIR)/fccd_orch_both_lazy_log_man_travis.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestServeThree -args $(WITHSNAPSHOTS) $(WITHUPF) $(WITHLAZY)
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestServeThree -args $(WITH_LOCAL_SNAPSHOTS) $(WITHUPF) $(WITHLAZY)
./scripts/clean_fcctr.sh

test-skip:
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_man_skip.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_man_skip.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS_NORACE) -run TestParallelServe -args $(WITHSNAPSHOTS)
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS_NORACE) -run TestParallelServe -args $(WITH_LOCAL_SNAPSHOTS)
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_both_log_man_skip.out 2>$(CTRDLOGDIR)/fccd_orch_both_log_man_skip.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS_NORACE) -run TestParallelServe -args $(WITHSNAPSHOTS) $(WITHUPF)
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS_NORACE) -run TestParallelServe -args $(WITH_LOCAL_SNAPSHOTS) $(WITHUPF)
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_both_lazy_log_man_skip.out 2>$(CTRDLOGDIR)/fccd_orch_both_lazy_log_man_skip.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS_NORACE) -run TestParallelServe -args $(WITHSNAPSHOTS) $(WITHUPF) $(WITHLAZY)
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS_NORACE) -run TestParallelServe -args $(WITH_LOCAL_SNAPSHOTS) $(WITHUPF) $(WITHLAZY)
./scripts/clean_fcctr.sh

bench:
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITHSNAPSHOTS) -benchDirTest configBase -metricsTest -funcName helloworld && sudo rm -rf configBase
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITH_LOCAL_SNAPSHOTS) -benchDirTest configBase -metricsTest -funcName helloworld && sudo rm -rf configBase
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITHSNAPSHOTS) $(WITHUPF) -benchDirTest configREAP -metricsTest -funcName helloworld && sudo rm -rf configREAP
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITH_LOCAL_SNAPSHOTS) $(WITHUPF) -benchDirTest configREAP -metricsTest -funcName helloworld && sudo rm -rf configREAP
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITHSNAPSHOTS) $(WITHLAZY) -benchDirTest configLazy -metricsTest -funcName helloworld && sudo rm -rf configLazy
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITH_LOCAL_SNAPSHOTS) $(WITHLAZY) -benchDirTest configLazy -metricsTest -funcName helloworld && sudo rm -rf configLazy
./scripts/clean_fcctr.sh

sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITHSNAPSHOTS) -benchDirTest configBase -metricsTest -funcName helloworld && sudo rm -rf configBase
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITH_LOCAL_SNAPSHOTS) -benchDirTest configBase -metricsTest -funcName helloworld && sudo rm -rf configBase
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITHSNAPSHOTS) $(WITHUPF) -benchDirTest configREAP -metricsTest -funcName helloworld && sudo rm -rf configREAP
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITH_LOCAL_SNAPSHOTS) $(WITHUPF) -benchDirTest configREAP -metricsTest -funcName helloworld && sudo rm -rf configREAP
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITHSNAPSHOTS) $(WITHLAZY) -benchDirTest configLazy -metricsTest -funcName helloworld && sudo rm -rf configLazy
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITH_LOCAL_SNAPSHOTS) $(WITHLAZY) -benchDirTest configLazy -metricsTest -funcName helloworld && sudo rm -rf configLazy
./scripts/clean_fcctr.sh

test-man-bench:
Expand All @@ -119,13 +121,13 @@ test-man-bench:
nightly-test:
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log.err &
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -run TestAllFunctions $(EXTRAGOARGS)
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -run TestAllFunctions $(EXTRAGOARGS) -args $(WITHSNAPSHOTS)
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -run TestAllFunctions $(EXTRAGOARGS) -args $(WITH_LOCAL_SNAPSHOTS)
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_upf_log.out 2>$(CTRDLOGDIR)/fccd_orch_upf_log.err &
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -run TestAllFunctions $(EXTRAGOARGS) -args $(WITHSNAPSHOTS) $(WITHUPF)
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -run TestAllFunctions $(EXTRAGOARGS) -args $(WITH_LOCAL_SNAPSHOTS) $(WITHUPF)
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_upf_lazy_log.out 2>$(CTRDLOGDIR)/fccd_orch_upf_lazy_log.err &
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -run TestAllFunctions $(EXTRAGOARGS) -args $(WITHSNAPSHOTS) $(WITHUPF) $(WITHLAZY)
sudo env "PATH=$(PATH)" go test $(EXTRATESTFILES) -run TestAllFunctions $(EXTRAGOARGS) -args $(WITH_LOCAL_SNAPSHOTS) $(WITHUPF) $(WITHLAZY)
./scripts/clean_fcctr.sh

test-skip-all:
Expand Down
6 changes: 3 additions & 3 deletions bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestBenchParallelServe(t *testing.T) {
imageName, isPresent := images[*funcName]
require.True(t, isPresent, "Function is not supported")

funcPool = NewFuncPool(!isSaveMemoryConst, servedTh, pinnedFuncNum, isTestModeConst)
funcPool = NewFuncPool(!isSaveMemoryConst, servedTh, pinnedFuncNum, isTestModeConst, *snapshotTestMode, *minioAddr, *minioAccessKey, *minioSecretKey)

createResultsDir()

Expand Down Expand Up @@ -136,7 +136,7 @@ func TestBenchWarmServe(t *testing.T) {
imageName, isPresent := images[*funcName]
require.True(t, isPresent, "Function is not supported")

funcPool = NewFuncPool(!isSaveMemoryConst, servedTh, pinnedFuncNum, isTestModeConst)
funcPool = NewFuncPool(!isSaveMemoryConst, servedTh, pinnedFuncNum, isTestModeConst, *snapshotTestMode, *minioAddr, *minioAccessKey, *minioSecretKey)

createResultsDir()

Expand Down Expand Up @@ -201,7 +201,7 @@ func TestBenchServe(t *testing.T) {
imageName, isPresent := images[*funcName]
require.True(t, isPresent, "Function is not supported")

funcPool = NewFuncPool(!isSaveMemoryConst, servedTh, pinnedFuncNum, isTestModeConst)
funcPool = NewFuncPool(!isSaveMemoryConst, servedTh, pinnedFuncNum, isTestModeConst, *snapshotTestMode, *minioAddr, *minioAccessKey, *minioSecretKey)

createResultsDir()

Expand Down
1 change: 1 addition & 0 deletions configs/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ SMI
sms
SMT
snapshotted
snapshotters
snapshotting
SoC
SOCACHE
Expand Down
63 changes: 59 additions & 4 deletions cri/firecracker/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ import (

log "github.com/sirupsen/logrus"
"github.com/vhive-serverless/vhive/ctriface"

"github.com/vhive-serverless/vhive/storage"

"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
)

type coordinator struct {
Expand Down Expand Up @@ -67,10 +72,27 @@ func newFirecrackerCoordinator(orch *ctriface.Orchestrator, opts ...coordinatorO
}

snapshotsDir := "/fccd/test/snapshots"
var objectStore storage.ObjectStorage

if !c.withoutOrchestrator {
snapshotsDir = orch.GetSnapshotsDir()
snapshotsBucket := orch.GetSnapshotsBucket()

if orch.GetSnapshotMode() == "remote" {
minioClient, _ := minio.New(orch.GetMinioAddr(), &minio.Options{
Creds: credentials.NewStaticV4(orch.GetMinioAccessKey(), orch.GetMinioSecretKey(), ""),
Secure: false,
})

var err error
objectStore, err = storage.NewMinioStorage(minioClient, snapshotsBucket)
if err != nil {
log.WithError(err).Fatalf("failed to create MinIO storage for snapshots in bucket %s", snapshotsBucket)
}
}
}
c.snapshotManager = snapshotting.NewSnapshotManager(snapshotsDir)

c.snapshotManager = snapshotting.NewSnapshotManager(snapshotsDir, objectStore, false)

return c
}
Expand All @@ -80,9 +102,17 @@ func (c *coordinator) startVM(ctx context.Context, image, revision string) (*fun
}

func (c *coordinator) startVMWithEnvironment(ctx context.Context, image, revision string, environment []string) (*funcInstance, error) {
if c.orch != nil && c.orch.GetSnapshotsEnabled() {
if c.orch != nil && c.orch.GetSnapshotMode() != "disabled" {
// Check if snapshot is available
if snap, err := c.snapshotManager.AcquireSnapshot(revision); err == nil {
if snap, _ := c.snapshotManager.AcquireSnapshot(revision); snap == nil {
if c.orch.GetSnapshotMode() == "remote" {
if exists, _ := c.snapshotManager.SnapshotExists(revision); exists {
_, _ = c.snapshotManager.DownloadSnapshot(revision)
}
}
}

if snap, _ := c.snapshotManager.AcquireSnapshot(revision); snap != nil {
return c.orchLoadInstance(ctx, snap)
}
}
Expand All @@ -102,13 +132,20 @@ func (c *coordinator) stopVM(ctx context.Context, containerID string) error {
return nil
}

if c.orch != nil && c.orch.GetSnapshotsEnabled() && !fi.SnapBooted {
if c.orch != nil && c.orch.GetSnapshotMode() != "disabled" && !fi.SnapBooted {
err := c.orchCreateSnapshot(ctx, fi)
if err != nil {
log.Printf("Err creating snapshot %s\n", err)
}
}

if c.orch != nil && c.orch.GetSnapshotMode() == "remote" && fi.SnapBooted && !c.orch.GetCacheSnaps() {
if err := c.snapshotManager.DeleteSnapshot(fi.Revision); err != nil {
fi.Logger.WithError(err).Error("failed to delete snapshot")
return err
}
}

return c.orchStopVM(ctx, fi)
}

Expand Down Expand Up @@ -230,11 +267,29 @@ func (c *coordinator) orchCreateSnapshot(ctx context.Context, fi *funcInstance)
}
}

if err := snap.SerializeSnapInfo(); err != nil {
fi.Logger.WithError(err).Error("failed to serialize snapshot info")
return err
}

if err := c.snapshotManager.CommitSnapshot(fi.Revision); err != nil {
fi.Logger.WithError(err).Error("failed to commit snapshot")
return err
}

if !c.withoutOrchestrator && c.orch.GetSnapshotMode() == "remote" {
if err := c.snapshotManager.UploadSnapshot(fi.Revision); err != nil {
fi.Logger.WithError(err).Error("failed to upload snapshot")
}

if !c.orch.GetCacheSnaps() {
if err := c.snapshotManager.DeleteSnapshot(fi.Revision); err != nil {
fi.Logger.WithError(err).Error("failed to delete snapshot")
return err
}
}
}

return nil
}

Expand Down
Loading
Loading