Skip to content

Commit

Permalink
use extended vpp connection
Browse files Browse the repository at this point in the history
Signed-off-by: NikitaSkrynnik <[email protected]>
  • Loading branch information
NikitaSkrynnik committed Dec 24, 2024
1 parent b1a5cdb commit 19c17a7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@ docker build .

## Environment config

* `NSM_NAME` - Name of vlan vpp responder (default: "vlan-vpp-responder")
* `NSM_BASE_DIR` - base directory (default: "./")
* `NSM_CONNECT_TO` - url to connect to (default: "unix:///var/lib/networkservicemesh/nsm.io.sock")
* `NSM_MAX_TOKEN_LIFETIME` - maximum lifetime of tokens (default: "10m")
* `NSM_REGISTRY_CLIENT_POLICIES` - paths to files and directories that contain registry client policies (default: "etc/nsm/opa/common/.*.rego,etc/nsm/opa/registry/.*.rego,etc/nsm/opa/client/.*.rego")
* `NSM_SERVICE_NAMES` - Name of provided services (default: "vlan-vpp-responder")
* `NSM_PAYLOAD` - Name of provided service payload (default: "ETHERNET")
* `NSM_LABELS` - Endpoint labels
* `NSM_DNS_CONFIGS` - DNSConfigs represents array of DNSConfig in json format. See at model definition: https://github.com/networkservicemesh/api/blob/main/pkg/api/networkservice/connectioncontext.pb.go#L426-L435 (default: "[]")
* `NSM_CIDR_PREFIX` - CIDR Prefix to assign IPs from (default: "169.254.0.0/16")
* `NSM_IDLE_TIMEOUT` - timeout for automatic shutdown when there were no requests for specified time. Set 0 to disable auto-shutdown. (default: "0")
* `NSM_REGISTER_SERVICE` - if true then registers network service on startup (default: "true")
* `NSM_OPEN_TELEMETRY_ENDPOINT` - OpenTelemetry Collector Endpoint (default: "otel-collector.observability.svc.cluster.local:4317")
* `NSM_METRICS_EXPORT_INTERVAL` - interval between mertics exports (default: "10s")
* `NSM_PPROF_ENABLED` - is pprof enabled (default: "false")
* `NSM_PPROF_LISTEN_ON` - pprof URL to ListenAndServe (default: "localhost:6060")
* `NSM_NAME` - Name of vlan vpp responder (default: "vlan-vpp-responder")
* `NSM_BASE_DIR` - base directory (default: "./")
* `NSM_CONNECT_TO` - url to connect to (default: "unix:///var/lib/networkservicemesh/nsm.io.sock")
* `NSM_MAX_TOKEN_LIFETIME` - maximum lifetime of tokens (default: "10m")
* `NSM_REGISTRY_CLIENT_POLICIES` - paths to files and directories that contain registry client policies (default: "etc/nsm/opa/common/.*.rego,etc/nsm/opa/registry/.*.rego,etc/nsm/opa/client/.*.rego")
* `NSM_SERVICE_NAMES` - Name of provided services (default: "vlan-vpp-responder")
* `NSM_PAYLOAD` - Name of provided service payload (default: "ETHERNET")
* `NSM_LABELS` - Endpoint labels
* `NSM_DNS_CONFIGS` - DNSConfigs represents array of DNSConfig in json format. See at model definition: https://github.com/networkservicemesh/api/blob/main/pkg/api/networkservice/connectioncontext.pb.go#L426-L435 (default: "[]")
* `NSM_CIDR_PREFIX` - CIDR Prefix to assign IPs from (default: "169.254.0.0/16")
* `NSM_IDLE_TIMEOUT` - timeout for automatic shutdown when there were no requests for specified time. Set 0 to disable auto-shutdown. (default: "0")
* `NSM_REGISTER_SERVICE` - if true then registers network service on startup (default: "true")
* `NSM_OPEN_TELEMETRY_ENDPOINT` - OpenTelemetry Collector Endpoint (default: "otel-collector.observability.svc.cluster.local:4317")
* `NSM_METRICS_EXPORT_INTERVAL` - interval between mertics exports (default: "10s")
* `NSM_PPROF_ENABLED` - is pprof enabled (default: "false")
* `NSM_PPROF_LISTEN_ON` - pprof URL to ListenAndServe (default: "localhost:6060")
* `NSM_VPP_MIN_OPERATION_TIMEOUT` - minimum timeout for every vpp operation

# Testing

Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import (
"google.golang.org/grpc/credentials"

"github.com/networkservicemesh/vpphelper"
"github.com/networkservicemesh/vpphelper/extendtimeout"

Check failure on line 55 in main.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

no required module provides package github.com/networkservicemesh/vpphelper/extendtimeout; to add it:

"github.com/networkservicemesh/api/pkg/api/networkservice"
kernelmech "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/kernel"
Expand Down Expand Up @@ -108,6 +109,7 @@ type Config struct {
MetricsExportInterval time.Duration `default:"10s" desc:"interval between mertics exports" split_words:"true"`
PprofEnabled bool `default:"false" desc:"is pprof enabled" split_words:"true"`
PprofListenOn string `default:"localhost:6060" desc:"pprof URL to ListenAndServe" split_words:"true"`
VPPMinOperationTimeout time.Duration `default:"2s" desc:"minimum timeout for every vpp operation" split_words:"true"`
}

// Process prints and processes env to config
Expand Down Expand Up @@ -316,6 +318,7 @@ func main() {
// ********************************************************************************
vppConn, vppErrCh := vpphelper.StartAndDialContext(ctx)
exitOnErr(ctx, cancel, vppErrCh)
vppConn = extendtimeout.NewConnection(vppConn, config.VPPMinOperationTimeout)

// ********************************************************************************
log.FromContext(ctx).Infof("executing phase 3: retrieving svid, check spire agent logs if this is the last line you see")
Expand Down

0 comments on commit 19c17a7

Please sign in to comment.