Skip to content

Commit e21bbd7

Browse files
committed
Adapting Dandelion
Signed-off-by: Lazar Cvetković <l.cvetkovic.997@gmail.com>
1 parent f2f4477 commit e21bbd7

4 files changed

Lines changed: 19 additions & 12 deletions

File tree

cmd/worker_node/config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ workerNodeIp: "127.0.0.1"
22
controlPlaneAddress: "127.0.0.1:9090"
33
port: "10010"
44
verbosity: "trace"
5-
criType: "containerd"
5+
criType: "dandelion"
66
cpuConstraints: false
77

88
containerd:
@@ -19,8 +19,8 @@ firecracker:
1919
NetworkPoolSize: 4
2020

2121
dandelion:
22-
daemonPort: 8082
23-
binaryPath: "configs/dandelion/sysld_wasm_x86_64_busy_loop"
22+
daemonPort: 8083
23+
binaryPath: "/home/lcvetkovic/projects/cluster_manager/configs/dandelion/sysld_wasm_x86_64_busy_loop"
2424
engineType: "Process"
2525
#binaryPath: "configs/dandelion/sysld_wasm_x86_64_matmul"
2626
#engineType: "RWasm"

cmd/worker_node/config_cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ workerNodeIp: "dynamic"
22
controlPlaneAddress: "10.0.1.2:9090"
33
port: "10010"
44
verbosity: "trace"
5-
criType: "containerd"
5+
criType: "dandelion"
66
cpuConstraints: false
77

88
containerd:

internal/worker_node/sandbox/dandelion/runtime.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ func (dr *Runtime) CreateSandbox(ctx context.Context, in *proto.ServiceInfo) (*p
426426

427427
if !ok {
428428
// check if binary exists
429-
binaryInfo, err := os.Stat(in.Image)
429+
/*binaryInfo, err := os.Stat(in.Image)
430430
if err != nil {
431431
logrus.Errorf("Error validating binary file - %v", err)
432432
return getFailureStatus(), nil
@@ -435,7 +435,7 @@ func (dr *Runtime) CreateSandbox(ctx context.Context, in *proto.ServiceInfo) (*p
435435
logrus.Errorf("Error validating binary file - file is a directory")
436436
return getFailureStatus(), nil
437437
}
438-
logrus.Infof("Registering binary file %s (size=%d)", in.Image, binaryInfo.Size())
438+
logrus.Infof("Registering binary file %s (size=%d)", in.Image, binaryInfo.Size())*/
439439

440440
// operator load/store
441441
fName := in.Name
@@ -460,14 +460,21 @@ func (dr *Runtime) CreateSandbox(ctx context.Context, in *proto.ServiceInfo) (*p
460460
if dr.dandelionConfig.LogFunctionStdioOutset { // add "stdio" to get the stdio output from dandelion
461461
outputSets = append(outputSets, "stdio")
462462
}
463+
464+
binaryData, err := os.ReadFile(dr.dandelionConfig.BinaryPath)
465+
if err != nil {
466+
logrus.Errorf("Error reading binary file - %v", err)
467+
return getFailureStatus(), nil
468+
}
469+
463470
registerRequest := bson.D{
464471
{Key: "name", Value: fName},
465472
{Key: "context_size", Value: 0x8020000},
466473
{Key: "engine_type", Value: dr.dandelionConfig.EngineType},
467-
{Key: "local_path", Value: in.Image},
468-
{Key: "binary", Value: bytesToInts([]byte{0})},
469-
{Key: "input_sets", Value: inputSets},
470-
{Key: "output_sets", Value: outputSets},
474+
//{Key: "local_path", Value: in.Image},
475+
{Key: "binary", Value: bytesToInts(binaryData)},
476+
{Key: "input_sets", Value: bson.A{bson.A{"input", nil}}},
477+
{Key: "output_sets", Value: []string{"output"}}, // add "stdio" for debugging purpose
471478
}
472479

473480
// send registration request to dandelion

scripts/setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ DAEMONS_PER_NODE=1
1313
FIRECRACKER_VERSION="v1.7.0"
1414
# Local directory with Dandelion for finding the current remote tracking branch
1515
# Set to an empty string if you do not wish to clone Dandelion.
16-
DANDELION_DIR="" # $HOME/projects/dandelion
16+
DANDELION_DIR="$HOME/projects/dandelion"
1717

1818
# Select the runtime to use: containerd, firecracker, dandelion, fcctr.
1919
# This should match criType in the worker node configuration, and determines
2020
# which tools to install during setup.
21-
RUNTIME="containerd"
21+
RUNTIME="dandelion"

0 commit comments

Comments
 (0)