@@ -14,6 +14,7 @@ func (job benchJob) run(ctx context.Context, WarmVMs <-chan runningFirecracker)
14
14
15
15
err := q .setjobReceived (ctx , job )
16
16
if err != nil {
17
+ log .WithError (err ).Error ("Could not set job received" )
17
18
q .setjobFailed (ctx , job )
18
19
return
19
20
}
@@ -31,9 +32,10 @@ func (job benchJob) run(ctx context.Context, WarmVMs <-chan runningFirecracker)
31
32
var reqJSON []byte
32
33
33
34
reqJSON , err = json .Marshal (agentRunReq {
34
- ID : job .ID ,
35
- Variant : job .Variant ,
36
- Code : job .Code ,
35
+ ID : job .ID ,
36
+ Language : job .Language ,
37
+ Code : job .Code ,
38
+ Variant : "TODO" ,
37
39
})
38
40
if err != nil {
39
41
log .WithError (err ).Error ("Failed to marshal JSON request" )
@@ -43,6 +45,7 @@ func (job benchJob) run(ctx context.Context, WarmVMs <-chan runningFirecracker)
43
45
44
46
err = q .setjobRunning (ctx , job )
45
47
if err != nil {
48
+ log .WithError (err ).Error ("Could not set job running" )
46
49
q .setjobFailed (ctx , job )
47
50
return
48
51
}
@@ -51,7 +54,7 @@ func (job benchJob) run(ctx context.Context, WarmVMs <-chan runningFirecracker)
51
54
var agentRes agentExecRes
52
55
53
56
// FIXME
54
- httpRes , err = http .Post ("http://" + vm .ip .String ()+ ":8080/run/python " , "application/json" , bytes .NewBuffer (reqJSON ))
57
+ httpRes , err = http .Post ("http://" + vm .ip .String ()+ ":8080/run" , "application/json" , bytes .NewBuffer (reqJSON ))
55
58
if err != nil {
56
59
log .WithError (err ).Error ("Failed to request execution to agent" )
57
60
q .setjobFailed (ctx , job )
@@ -60,7 +63,11 @@ func (job benchJob) run(ctx context.Context, WarmVMs <-chan runningFirecracker)
60
63
json .NewDecoder (httpRes .Body ).Decode (& agentRes )
61
64
log .WithField ("result" , agentRes ).Info ("Job execution finished" )
62
65
if httpRes .StatusCode != 200 {
63
- log .WithField ("res" , agentRes ).Error ("Failed to compile and run code" )
66
+ log .WithFields (log.Fields {
67
+ "httpRes" : httpRes ,
68
+ "agentRes" : agentRes ,
69
+ "reqJSON" : string (reqJSON ),
70
+ }).Error ("Failed to compile and run code" )
64
71
q .setjobFailed (ctx , job )
65
72
return
66
73
}
0 commit comments