Skip to content

Commit 870dccb

Browse files
committed
Merge branch 'main' into workflows-merging-main
2 parents 0c4256e + 0e636da commit 870dccb

28 files changed

Lines changed: 407 additions & 210 deletions

File tree

.github/workflows/makefile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Go
1616
uses: actions/setup-go@v3
1717
with:
18-
go-version: "1.20.0"
18+
go-version: "1.21.0"
1919

2020
- uses: actions/checkout@v2
2121

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ bin/
33
.run/
44
__pycache__*
55
images/*/executor
6+
*.backup
7+
default.etcd

README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,9 @@ As functions are executed within Docker containers, you need Docker to
5050
be installed on the host. Furthermore, Serverledge needs
5151
permissions to create containers.
5252

53-
If you have more than one context (docker context ls), be sure to set up the DOCKER_HOST environment variable to the correct Host context.
54-
To set correctly, use the following three commands from cli:
55-
56-
1) docker context ls
57-
2) docker context inspect <current-context>
58-
3) Take the Endpoints.docker.Host value and save it into the DOCKER_HOST environment variable. The default value is unix:///var/run/docker.sock
59-
60-
61-
62-
You also need an **etcd** server to run Serverledge. To quickly start a local
63-
server:
64-
65-
$ ./scripts/start-etcd.sh # stop it with ./scripts/stop-etcd.sh
53+
You also need an `etcd` server to run Serverledge. To quickly start a local
54+
server, just download [a recent
55+
release](https://github.com/etcd-io/etcd/releases) of `etcd` and just run `./etcd`.
6656

6757
Start a local Serverledge node:
6858

@@ -117,7 +107,7 @@ Note that we currently support output capture only for some runtimes (e.g., Pyth
117107

118108
## Distributed Deployment
119109

120-
[This repository](https://github.com/grussorusso/serverledge-deploy) provides an
110+
[This repository](https://github.com/serverledge-faas/serverledge-deploy) provides an
121111
Ansible playbook to deploy Serverledge in a distributed configuration.
122112

123113
In this case, you can instruct `serverledge-cli` to

cmd/serverledge/main.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
package main
22

33
import (
4+
"errors"
45
"fmt"
56
"log"
67
"os"
8+
"os/signal"
9+
"time"
10+
11+
"golang.org/x/net/context"
712

813
"github.com/serverledge-faas/serverledge/internal/api"
914
"github.com/serverledge-faas/serverledge/internal/config"
1015
"github.com/serverledge-faas/serverledge/internal/metrics"
1116
"github.com/serverledge-faas/serverledge/internal/node"
1217
"github.com/serverledge-faas/serverledge/internal/registration"
1318
"github.com/serverledge-faas/serverledge/internal/scheduling"
19+
"github.com/serverledge-faas/serverledge/internal/telemetry"
1420
"github.com/serverledge-faas/serverledge/utils"
1521

1622
"github.com/labstack/echo/v4"
@@ -55,6 +61,25 @@ func main() {
5561

5662
go metrics.Init()
5763

64+
if config.GetBool(config.TRACING_ENABLED, false) {
65+
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
66+
defer stop()
67+
68+
tracesOutfile := config.GetString(config.TRACING_OUTFILE, "")
69+
if len(tracesOutfile) < 1 {
70+
tracesOutfile = fmt.Sprintf("traces-%s.json", time.Now().Format("20060102-150405"))
71+
}
72+
log.Printf("Enabling tracing to %s\n", tracesOutfile)
73+
otelShutdown, err := telemetry.SetupOTelSDK(ctx, tracesOutfile)
74+
if err != nil {
75+
log.Fatal(err)
76+
}
77+
// Handle shutdown properly so nothing leaks.
78+
defer func() {
79+
err = errors.Join(err, otelShutdown(context.Background()))
80+
}()
81+
}
82+
5883
e := echo.New()
5984

6085
// Register a signal handler to cleanup things on termination

docs/api.md

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,68 @@ An example response for a successful **asynchronous** request:
156156
> | `503` | `text/plain` | | Prewarming failed |
157157
158158
------------------------------------------------------------------------------------------
159+
### Status information
159160

160-
<!--
161-
status API
162-
function API
163-
-->
161+
<code>GET</code> <code><b>/status</b></code> (get current status of the node)
162+
163+
##### Parameters
164+
165+
None
166+
167+
##### Responses
168+
169+
> | http code | content-type | response | comments |
170+
> |---------------|-----------------------------------|---------------------------------|-----------------------------------|
171+
> | `200` | `application/json` | *See response example.* | |
172+
> | `500` | `text/plain` | `Could not retrieve results` |
173+
174+
An example response for a successful request:
175+
176+
```
177+
{
178+
"Url": "http://192.168.1.23:1323",
179+
"AvailableWarmContainers": {
180+
"isprime": 1,
181+
"sleepSec": 2
182+
},
183+
"AvailableMemMB": 3072,
184+
"AvailableCPUs": 8,
185+
"Coordinates": {
186+
"Vec": [
187+
0,
188+
0,
189+
0
190+
],
191+
"Error": 1.5,
192+
"Height": 0.00001
193+
},
194+
"LoadAvg": [
195+
1.34,
196+
1.43,
197+
0.94
198+
]
199+
}
200+
```
201+
202+
`AvailableMemMB` and `AvailableCPUs` indicate the currently amount of memory
203+
and CPUs (intended as vCPUs or fractions of them) that can be allocated to new
204+
requests in the node. `Coordinates.Vec` reports the coordinates of this node
205+
in the virtual coordinate space computed by Vivaldi algorithm.
206+
207+
### Listing functions
208+
209+
<code>GET</code> <code><b>/functions</b></code> (get list of registered functions)
210+
211+
##### Parameters
212+
213+
None
214+
215+
##### Responses
216+
217+
> | http code | content-type | response | comments |
218+
> |---------------|-----------------------------------|---------------------------------|-----------------------------------|
219+
> | `200` | `application/json` | *List of names of existing functions.* | |
220+
> | `500` | `text/plain` | `Could not retrieve results` |
221+
222+
Note that functions are globally registered in the system. Therefore, the same
223+
list is returned by every node in the same cluster.

docs/tracing.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Serverledge relies on [OpenTelemetry](https://opentelemetry.io) for optional
2+
request tracing, aimed at performance investigations.
3+
4+
## Enabling tracing
5+
6+
Tracing is disabled by default. It can enabled with the following configuration
7+
line:
8+
9+
tracing.enabled: true
10+
11+
By default, JSON-encoded traces are written to `./traces-<timestamp>.json`.
12+
The following line sets a custom output file:
13+
14+
tracing.outfile: /path/to/file.json
15+

go.mod

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/serverledge-faas/serverledge
22

3-
go 1.20
3+
go 1.21
4+
5+
toolchain go1.22.5
46

57
require (
68
github.com/LK4D4/trylock v0.0.0-20191027065348-ff7e133a5c54
@@ -11,10 +13,15 @@ require (
1113
github.com/labstack/echo/v4 v4.6.1
1214
github.com/labstack/gommon v0.3.0
1315
github.com/lithammer/shortuuid v3.0.0+incompatible
16+
github.com/mikoim/go-loadavg v0.0.0-20150917074714-35ece5f6d547
1417
github.com/prometheus/client_golang v1.14.0
1518
github.com/spf13/cobra v1.0.0
1619
github.com/spf13/viper v1.4.0
1720
go.etcd.io/etcd/client/v3 v3.5.1
21+
go.opentelemetry.io/otel v1.28.0
22+
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0
23+
go.opentelemetry.io/otel/sdk v1.28.0
24+
go.opentelemetry.io/otel/trace v1.28.0
1825
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
1926
golang.org/x/net v0.15.0
2027
google.golang.org/grpc v1.57.0
@@ -30,10 +37,12 @@ require (
3037
github.com/docker/go-connections v0.4.0 // indirect
3138
github.com/docker/go-units v0.5.0 // indirect
3239
github.com/fsnotify/fsnotify v1.6.0 // indirect
40+
github.com/go-logr/logr v1.4.2 // indirect
41+
github.com/go-logr/stdr v1.2.2 // indirect
3342
github.com/gogo/protobuf v1.3.2 // indirect
3443
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
3544
github.com/golang/protobuf v1.5.3 // indirect
36-
github.com/google/uuid v1.3.0 // indirect
45+
github.com/google/uuid v1.6.0 // indirect
3746
github.com/hashicorp/hcl v1.0.0 // indirect
3847
github.com/inconshreveable/mousetrap v1.0.0 // indirect
3948
github.com/kr/pretty v0.3.0 // indirect
@@ -56,19 +65,19 @@ require (
5665
github.com/spf13/cast v1.3.0 // indirect
5766
github.com/spf13/jwalterweatherman v1.0.0 // indirect
5867
github.com/spf13/pflag v1.0.5 // indirect
59-
github.com/stretchr/testify v1.8.4 // indirect
6068
github.com/valyala/bytebufferpool v1.0.0 // indirect
6169
github.com/valyala/fasttemplate v1.2.1 // indirect
6270
go.etcd.io/etcd/api/v3 v3.5.1 // indirect
6371
go.etcd.io/etcd/client/pkg/v3 v3.5.1 // indirect
72+
go.opentelemetry.io/otel/metric v1.28.0 // indirect
6473
go.uber.org/atomic v1.7.0 // indirect
6574
go.uber.org/multierr v1.6.0 // indirect
6675
go.uber.org/zap v1.17.0 // indirect
6776
golang.org/x/crypto v0.13.0 // indirect
6877
golang.org/x/mod v0.12.0 // indirect
69-
golang.org/x/sys v0.12.0 // indirect
78+
golang.org/x/sys v0.21.0 // indirect
7079
golang.org/x/text v0.13.0 // indirect
71-
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
80+
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect
7281
golang.org/x/tools v0.13.0 // indirect
7382
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
7483
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect

go.sum

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
3232
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
3333
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
3434
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
35+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
3536
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
3637
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
3738
github.com/LK4D4/trylock v0.0.0-20191027065348-ff7e133a5c54 h1:sg9CWNOhr58hMGmJ0q7x7jQ/B1RK/GyHNmeaYCJos9M=
@@ -112,6 +113,11 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9
112113
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
113114
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
114115
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
116+
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
117+
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
118+
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
119+
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
120+
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
115121
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
116122
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
117123
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
@@ -161,7 +167,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
161167
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
162168
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
163169
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
164-
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
170+
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
171+
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
165172
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
166173
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
167174
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -174,8 +181,8 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf
174181
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
175182
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
176183
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
177-
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
178-
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
184+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
185+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
179186
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
180187
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
181188
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
@@ -236,6 +243,8 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k
236243
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
237244
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
238245
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
246+
github.com/mikoim/go-loadavg v0.0.0-20150917074714-35ece5f6d547 h1:sKOBS3TQA6gIeu7xDDIJnH1cPmGAa3535gg2/cWrwC4=
247+
github.com/mikoim/go-loadavg v0.0.0-20150917074714-35ece5f6d547/go.mod h1:Gv1gEAo58s56eUbsb59IAFnEr6flyFg9lgryVQnKwhM=
239248
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
240249
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
241250
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
@@ -330,8 +339,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
330339
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
331340
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
332341
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
333-
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
334-
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
342+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
343+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
335344
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
336345
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
337346
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
@@ -358,6 +367,16 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
358367
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
359368
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
360369
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
370+
go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
371+
go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
372+
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 h1:EVSnY9JbEEW92bEkIYOVMw4q1WJxIAGoFTrtYOzWuRQ=
373+
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0/go.mod h1:Ea1N1QQryNXpCD0I1fdLibBAIpQuBkznMmkdKrapk1Y=
374+
go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
375+
go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
376+
go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE=
377+
go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg=
378+
go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
379+
go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
361380
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
362381
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
363382
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
@@ -470,6 +489,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
470489
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
471490
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
472491
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
492+
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
473493
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
474494
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
475495
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -519,8 +539,8 @@ golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0/go.mod h1:oPkhp1MJrh7nUepCBc
519539
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
520540
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
521541
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
522-
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
523-
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
542+
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
543+
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
524544
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
525545
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
526546
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -536,9 +556,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
536556
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
537557
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
538558
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
559+
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 h1:Hir2P/De0WpUhtrKGGjvSb2YxUgyZ7EFOSLIcSSpiwE=
539560
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
540-
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44=
541-
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
542561
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
543562
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
544563
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -700,6 +719,7 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
700719
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
701720
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
702721
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
722+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
703723
gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY=
704724
gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
705725
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

images/nodejs17ng/executor.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ http.createServer(async (request, response) => {
2222
var handler = reqbody["Handler"]
2323
var handler_dir = reqbody["HandlerDir"]
2424
var params = reqbody["Params"]
25+
var return_output = reqbody["ReturnOutput"]
2526

2627
var context = {}
2728
if (process.env.CONTEXT !== "undefined") {
@@ -35,7 +36,11 @@ http.createServer(async (request, response) => {
3536
resp = {}
3637
resp["Result"] = JSON.stringify(result);
3738
resp["Success"] = true
38-
resp["Output"] = "Output capture not supported for this runtime yet."
39+
if (return_output === true) {
40+
resp["Output"] = "Output capture not supported for this runtime yet."
41+
} else {
42+
resp["Output"] = ""
43+
}
3944

4045

4146
response.writeHead(200, { 'Content-Type': contentType });

0 commit comments

Comments
 (0)