Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kernel liveness check for heal client #407

Merged
Merged
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
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ require (
github.com/kelseyhightower/envconfig v1.4.0
github.com/networkservicemesh/api v1.3.0-rc.1.0.20220405210054-fbcde048efa5
github.com/networkservicemesh/sdk v0.5.1-0.20220505102418-8d6762737896
github.com/networkservicemesh/sdk-sriov v0.0.0-20220505140026-a0c110da4f69
github.com/networkservicemesh/sdk-kernel v0.0.0-20220505135539-cd6d5151610b
github.com/networkservicemesh/sdk-sriov v0.0.0-20220505103434-6e176f2d8bc4
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1
github.com/spiffe/go-spiffe/v2 v2.0.0
Expand Down
7 changes: 5 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,11 @@ github.com/networkservicemesh/api v1.3.0-rc.1.0.20220405210054-fbcde048efa5 h1:5
github.com/networkservicemesh/api v1.3.0-rc.1.0.20220405210054-fbcde048efa5/go.mod h1:B6meq/SWjWR6bGXZdXPfbOeaBK+T1JayLdtEJQCsXKU=
github.com/networkservicemesh/sdk v0.5.1-0.20220505102418-8d6762737896 h1:ApKny2pqGEwxNk1LxRj/ISQOc7hXKcsuGSAACShdf70=
github.com/networkservicemesh/sdk v0.5.1-0.20220505102418-8d6762737896/go.mod h1:G+NdPbtzcOWx1VljOj+L4kvZPQyYpiwCp84JYs+hGtc=
github.com/networkservicemesh/sdk-kernel v0.0.0-20220505102750-b3ec72b7dfa8/go.mod h1:oDYMR2sPpIhiFvtojhc3cfkwyoaK9ZXQB+dGfPRi9S8=
github.com/networkservicemesh/sdk-kernel v0.0.0-20220505135539-cd6d5151610b h1:yrLmDz+806gEmvvqiINGuQtzPRjGWTHp45SgpteDy94=
github.com/networkservicemesh/sdk-kernel v0.0.0-20220505135539-cd6d5151610b/go.mod h1:oDYMR2sPpIhiFvtojhc3cfkwyoaK9ZXQB+dGfPRi9S8=
github.com/networkservicemesh/sdk-sriov v0.0.0-20220505140026-a0c110da4f69 h1:5Gi0XKhHDAvBymjl02BVXrXAIL8N7cr74VbVtR/xhCI=
github.com/networkservicemesh/sdk-sriov v0.0.0-20220505140026-a0c110da4f69/go.mod h1:JZv2kHl6t8fCgUWGYyVyekJ0jDK7rBFnGCNL+cwptQU=
github.com/networkservicemesh/sdk-sriov v0.0.0-20220505103434-6e176f2d8bc4 h1:M5GMRi+TY6uOel4XyypUpc/OOjxKCT1SpdLQlo5/6M8=
github.com/networkservicemesh/sdk-sriov v0.0.0-20220505103434-6e176f2d8bc4/go.mod h1:aCkxTJEL+xKqDMTUoLfLV/gvmFG9i36PxfJor//yCcQ=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
Expand Down Expand Up @@ -231,6 +233,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e h1:nt2877sKfojlHCTOBXbpWjBkuWKritFaGIfgQwbQUls=
github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e/go.mod h1:B4+Kq1u5FlULTjFSM707Q6e/cOHFv0z/6QRoxubDIQ8=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
Expand Down
3 changes: 3 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ type Config struct {
AwarenessGroups awarenessgroups.Decoder `defailt:"" desc:"Awareness groups for mutually aware NSEs" split_words:"true"`
LogLevel string `default:"INFO" desc:"Log level" split_words:"true"`
OpenTelemetryEndpoint string `default:"otel-collector.observability.svc.cluster.local:4317" desc:"OpenTelemetry Collector Endpoint"`

LivenessCheckInterval time.Duration `default:"200ms" desc:"Dataplane liveness check interval"`
LivenessCheckTimeout time.Duration `default:"100ms" desc:"Dataplane liveness check timeout"`
}

// IsValid - check if configuration is valid
Expand Down
1 change: 1 addition & 0 deletions internal/imports/imports_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) 2020-2022 Doc.ai and/or its affiliates.
//
// Copyright (c) 2022 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -37,6 +39,8 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"

kernelheal "github.com/networkservicemesh/sdk-kernel/pkg/kernel/tools/heal"

"github.com/networkservicemesh/api/pkg/api/networkservice"
kernelmech "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/kernel"
vfiomech "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/vfio"
Expand Down Expand Up @@ -149,7 +153,12 @@ func main() {
client.WithClientURL(&c.ConnectTo),
client.WithName(c.Name),
client.WithAuthorizeClient(authorize.NewClient()),
client.WithHealClient(heal.NewClient(ctx)),
client.WithHealClient(
heal.NewClient(
ctx,
heal.WithLivenessCheck(kernelheal.KernelLivenessCheck),
heal.WithLivenessCheckInterval(c.LivenessCheckInterval),
heal.WithLivenessCheckTimeout(c.LivenessCheckTimeout))),
client.WithAdditionalFunctionality(
sriovtoken.NewClient(),
mechanisms.NewClient(map[string]networkservice.NetworkServiceClient{
Expand Down