Skip to content

Commit

Permalink
Merge pull request #77 from Bolodya1997/sdk-update
Browse files Browse the repository at this point in the history
Sdk update
  • Loading branch information
haiodo authored Mar 1, 2021
2 parents df50da2 + a6ee3ee commit 24686ad
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 32 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ go 1.15
require (
github.com/antonfisher/nested-logrus-formatter v1.1.0
github.com/edwarnicke/exechelper v1.0.2
github.com/edwarnicke/grpcfd v0.0.0-20200920223154-d5b6e1f19bd0
github.com/edwarnicke/grpcfd v0.0.0-20210219150442-10fb469a6976
github.com/kelseyhightower/envconfig v1.4.0
github.com/networkservicemesh/api v0.0.0-20210218170701-1a72f1cba074
github.com/networkservicemesh/sdk v0.0.0-20210220122417-bab01203bb73
github.com/networkservicemesh/sdk v0.0.0-20210226095245-acdecd4599ac
github.com/networkservicemesh/sdk-k8s v0.0.0-20210220123047-b200a6b6b974
github.com/networkservicemesh/sdk-sriov v0.0.0-20210217064121-69fae3fcd42e
github.com/networkservicemesh/sdk-sriov v0.0.0-20210226100411-20d85b751bdb
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.7.0
github.com/spiffe/go-spiffe/v2 v2.0.0-alpha.4.0.20200528145730-dc11d0c74e85
github.com/stretchr/testify v1.6.1
google.golang.org/grpc v1.33.2
google.golang.org/grpc v1.35.0
k8s.io/kubelet v0.20.1
)
22 changes: 14 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3
github.com/Djarvur/go-err113 v0.0.0-20200511133814-5174e21577d5/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/HdrHistogram/hdrhistogram-go v1.0.0 h1:jivTvI9tBw5B8wW9Qd0uoQ2qaajb29y4TPhYTgh8Lb0=
github.com/HdrHistogram/hdrhistogram-go v1.0.0/go.mod h1:YzE1EgsuAz8q9lfGdlxBZo2Ma655+PfKp2mlzcAqIFw=
github.com/HdrHistogram/hdrhistogram-go v1.0.1 h1:GX8GAYDuhlFQnI2fRDHQhTlkHMz8bEn0jTI6LJU0mpw=
github.com/HdrHistogram/hdrhistogram-go v1.0.1/go.mod h1:BWJ+nMSHY3L41Zj7CA3uXnloDp7xxV0YvstAE7nKTaM=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
Expand Down Expand Up @@ -83,6 +85,7 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
Expand All @@ -106,6 +109,8 @@ github.com/edwarnicke/exechelper v1.0.2 h1:dD49Ui2U0FBFxxhalnKw6vLS0P0TkgnXBRvKL
github.com/edwarnicke/exechelper v1.0.2/go.mod h1:/T271jtNX/ND4De6pa2aRy2+8sNtyCDB1A2pp4M+fUs=
github.com/edwarnicke/grpcfd v0.0.0-20200920223154-d5b6e1f19bd0 h1:FHjcIM6YU8DnCw94+29EZX0bUqh016oqrtJrO8ZYiIY=
github.com/edwarnicke/grpcfd v0.0.0-20200920223154-d5b6e1f19bd0/go.mod h1:rHihB9YvNMixz8rS+ZbwosI2kj65VLkeyYAI2M+/cGA=
github.com/edwarnicke/grpcfd v0.0.0-20210219150442-10fb469a6976 h1:qYvyZmwMS7wdlMlf/r8jPeBUIkjuPO/Ns9T7g1p7c2A=
github.com/edwarnicke/grpcfd v0.0.0-20210219150442-10fb469a6976/go.mod h1:rHihB9YvNMixz8rS+ZbwosI2kj65VLkeyYAI2M+/cGA=
github.com/edwarnicke/serialize v0.0.0-20200705214914-ebc43080eecf h1:/lViRfaDxKINb2X6kOR3EJKJGR+MxUvqfgtYt5nh+qc=
github.com/edwarnicke/serialize v0.0.0-20200705214914-ebc43080eecf/go.mod h1:XvbCO/QGsl3X8RzjBMoRpkm54FIAZH5ChK2j+aox7pw=
github.com/edwarnicke/serialize v1.0.7 h1:geX8vmyu8Ij2S5fFIXjy9gBDkKxXnrMIzMoDvV0Ddac=
Expand All @@ -115,6 +120,7 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
Expand Down Expand Up @@ -393,20 +399,18 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/nats-io/stan.go v0.6.0/go.mod h1:eIcD5bi3pqbHT/xIIvXMwvzXYElgouBvaVRftaE+eac=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
github.com/networkservicemesh/api v0.0.0-20210202152048-ec956057eb3a h1:26MmmU399gnahAC+f6OfWsP5MpnLdJ4UjvBa6fXYvNU=
github.com/networkservicemesh/api v0.0.0-20210202152048-ec956057eb3a/go.mod h1:qvxdY1Zt4QTtiG+uH1XmjpegeHjlt5Jj4A8iK55iJPI=
github.com/networkservicemesh/api v0.0.0-20210218170701-1a72f1cba074 h1:lMU+bavS8l0vKZKtCYutUFtTaU5jzTEA7bD/s843XYU=
github.com/networkservicemesh/api v0.0.0-20210218170701-1a72f1cba074/go.mod h1:qvxdY1Zt4QTtiG+uH1XmjpegeHjlt5Jj4A8iK55iJPI=
github.com/networkservicemesh/sdk v0.0.0-20210216095211-a36209b21c4b h1:6M4ZAQwAJxcI2ii7QF2oK2btsx/qwjbtnpILMLsecQw=
github.com/networkservicemesh/sdk v0.0.0-20210216095211-a36209b21c4b/go.mod h1:7Y9JsBKKjgvOT2faCXy/aM76bWsA//xvdVfbdLe0WXk=
github.com/networkservicemesh/sdk v0.0.0-20210220122417-bab01203bb73 h1:m7UW86tzJrJkmZPtgvGDgpXsU2LX3DmzYGLymC34Q+s=
github.com/networkservicemesh/sdk v0.0.0-20210220122417-bab01203bb73/go.mod h1:cK8mHGgBoxNO7Y3pwozi2a+NdALq+3H0wWc1J/TqJQg=
github.com/networkservicemesh/sdk v0.0.0-20210226095245-acdecd4599ac h1:U9LDdSiCrQTt61NiWf6iIL+1f139RmImaExfGkGzWd4=
github.com/networkservicemesh/sdk v0.0.0-20210226095245-acdecd4599ac/go.mod h1:IrL3IsUBr/iQrtLQEtmBRFKoIKjYZEW+Z7ZFDt9TbRc=
github.com/networkservicemesh/sdk-k8s v0.0.0-20210220123047-b200a6b6b974 h1:P6Bejf9wfq0dsLUmnwrPcniNFeBccsPwh27E/azZtJA=
github.com/networkservicemesh/sdk-k8s v0.0.0-20210220123047-b200a6b6b974/go.mod h1:6MdZduLVqsvd8RaXTi+woH3eUJFQwzdmS8HZbG/tMzo=
github.com/networkservicemesh/sdk-kernel v0.0.0-20210216095528-c177e58a0d03 h1:ooGOUOXve7Dwdt25oyDrKINenrfG86UoxfEIXsQSorE=
github.com/networkservicemesh/sdk-kernel v0.0.0-20210216095528-c177e58a0d03/go.mod h1:fYNkQR64twi8v9ATVTXDfMRbfKktUHA49nxI/kqwvDE=
github.com/networkservicemesh/sdk-sriov v0.0.0-20210217064121-69fae3fcd42e h1:dsbp9wJc4ZB8P8gOt6+lXMUhBTyM7eyc0OmvBNjTvdA=
github.com/networkservicemesh/sdk-sriov v0.0.0-20210217064121-69fae3fcd42e/go.mod h1:SAfJDaAfFQ7z+2hRlddcqP4MVdMY6LEl6v2ApU2HkQQ=
github.com/networkservicemesh/sdk-kernel v0.0.0-20210226095937-76847e2a604b h1:nXkV/JZahKezBaNm1d/ZK8X7qYhldbqbNF5zNCF/H60=
github.com/networkservicemesh/sdk-kernel v0.0.0-20210226095937-76847e2a604b/go.mod h1:P2OFnGk/D8/ofa17KRKk80302uQvxVFPZM+IxzXMop8=
github.com/networkservicemesh/sdk-sriov v0.0.0-20210226100411-20d85b751bdb h1:eBQwLJozNp+1Rc9sfBb25LR4FqCmMfD5c60qJJ1zqhw=
github.com/networkservicemesh/sdk-sriov v0.0.0-20210226100411-20d85b751bdb/go.mod h1:+4WbIteyx02EwW2zEk45Krj6TwaQjX9JZFV/u4CfeAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nishanths/exhaustive v0.0.0-20200811152831-6cf413ae40e0/go.mod h1:wBEpHwM2OdmeNpdCvRPUlkEbBuaFmcK4Wv8Q7FuGW3c=
Expand Down Expand Up @@ -886,6 +890,8 @@ google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0=
google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.35.0 h1:TwIQcH3es+MojMVojxxfQ3l3OF2KzlRxML2xZq0kRo8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down
7 changes: 3 additions & 4 deletions internal/imports/imports_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@ import (
_ "github.com/networkservicemesh/sdk-k8s/pkg/tools/k8stest/podresources"
_ "github.com/networkservicemesh/sdk-k8s/pkg/tools/podresources"
_ "github.com/networkservicemesh/sdk-k8s/pkg/tools/socketpath"
_ "github.com/networkservicemesh/sdk-sriov/pkg/networkservice/chains/sriovns"
_ "github.com/networkservicemesh/sdk-sriov/pkg/networkservice/chains/xconnectns"
_ "github.com/networkservicemesh/sdk-sriov/pkg/sriov/config"
_ "github.com/networkservicemesh/sdk-sriov/pkg/sriov/pci"
_ "github.com/networkservicemesh/sdk-sriov/pkg/sriov/resource"
_ "github.com/networkservicemesh/sdk-sriov/pkg/sriov/token"
_ "github.com/networkservicemesh/sdk-sriov/pkg/tools/tokens"
_ "github.com/networkservicemesh/sdk/pkg/networkservice/common/authorize"
_ "github.com/networkservicemesh/sdk/pkg/registry/chains/client"
_ "github.com/networkservicemesh/sdk/pkg/registry/common/expire"
_ "github.com/networkservicemesh/sdk/pkg/registry/common/interpose"
_ "github.com/networkservicemesh/sdk/pkg/registry/common/memory"
_ "github.com/networkservicemesh/sdk/pkg/registry/common/recvfd"
_ "github.com/networkservicemesh/sdk/pkg/registry/common/refresh"
_ "github.com/networkservicemesh/sdk/pkg/registry/common/sendfd"
_ "github.com/networkservicemesh/sdk/pkg/registry/common/setid"
_ "github.com/networkservicemesh/sdk/pkg/registry/core/adapters"
_ "github.com/networkservicemesh/sdk/pkg/registry/core/chain"
Expand All @@ -39,6 +37,7 @@ import (
_ "github.com/networkservicemesh/sdk/pkg/tools/signalctx"
_ "github.com/networkservicemesh/sdk/pkg/tools/spiffejwt"
_ "github.com/networkservicemesh/sdk/pkg/tools/spire"
_ "github.com/networkservicemesh/sdk/pkg/tools/token"
_ "github.com/pkg/errors"
_ "github.com/sirupsen/logrus"
_ "github.com/spiffe/go-spiffe/v2/bundle/x509bundle"
Expand Down
28 changes: 13 additions & 15 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,13 @@ import (
registryapi "github.com/networkservicemesh/api/pkg/api/registry"
k8sdeviceplugin "github.com/networkservicemesh/sdk-k8s/pkg/tools/deviceplugin"
k8spodresources "github.com/networkservicemesh/sdk-k8s/pkg/tools/podresources"
"github.com/networkservicemesh/sdk-sriov/pkg/networkservice/chains/sriovns"
"github.com/networkservicemesh/sdk-sriov/pkg/networkservice/chains/xconnectns"
sriovconfig "github.com/networkservicemesh/sdk-sriov/pkg/sriov/config"
"github.com/networkservicemesh/sdk-sriov/pkg/sriov/pci"
"github.com/networkservicemesh/sdk-sriov/pkg/sriov/resource"
"github.com/networkservicemesh/sdk-sriov/pkg/sriov/token"
sriovtoken "github.com/networkservicemesh/sdk-sriov/pkg/sriov/token"
"github.com/networkservicemesh/sdk/pkg/networkservice/common/authorize"
"github.com/networkservicemesh/sdk/pkg/registry/common/interpose"
"github.com/networkservicemesh/sdk/pkg/registry/common/refresh"
registrysendfd "github.com/networkservicemesh/sdk/pkg/registry/common/sendfd"
registrychain "github.com/networkservicemesh/sdk/pkg/registry/core/chain"
registryclient "github.com/networkservicemesh/sdk/pkg/registry/chains/client"
"github.com/networkservicemesh/sdk/pkg/tools/debug"
"github.com/networkservicemesh/sdk/pkg/tools/grpcutils"
"github.com/networkservicemesh/sdk/pkg/tools/jaeger"
Expand All @@ -56,6 +53,7 @@ import (
"github.com/networkservicemesh/sdk/pkg/tools/opentracing"
"github.com/networkservicemesh/sdk/pkg/tools/signalctx"
"github.com/networkservicemesh/sdk/pkg/tools/spiffejwt"
"github.com/networkservicemesh/sdk/pkg/tools/token"

"github.com/networkservicemesh/cmd-forwarder-sriov/internal/deviceplugin"
)
Expand Down Expand Up @@ -148,7 +146,7 @@ func main() {
log.FromContext(ctx).Infof("executing phase 3: init pools (time since start: %s)", time.Since(starttime))
// ********************************************************************************

tokenPool := token.NewPool(sriovConfig)
tokenPool := sriovtoken.NewPool(sriovConfig)

pciPool, err := pci.NewPool(config.PCIDevicesPath, config.PCIDriversPath, config.VFIOPath, sriovConfig)
if err != nil {
Expand Down Expand Up @@ -188,7 +186,7 @@ func main() {
// ********************************************************************************
log.FromContext(ctx).Infof("executing phase 6: create sriovns network service endpoint (time since start: %s)", time.Since(starttime))
// ********************************************************************************
endpoint := sriovns.NewServer(
endpoint := xconnectns.NewServer(
ctx,
config.Name,
authorize.NewServer(),
Expand All @@ -203,7 +201,12 @@ func main() {
credentials.NewTLS(tlsconfig.MTLSClientConfig(source, source, tlsconfig.AuthorizeAny())),
),
),
grpc.WithDefaultCallOptions(grpc.WaitForReady(true)),
grpc.WithDefaultCallOptions(
grpc.WaitForReady(true),
grpc.PerRPCCredentials(token.NewPerRPCCredentials(spiffejwt.TokenGeneratorFunc(source, config.MaxTokenLifetime))),
),
grpcfd.WithChainStreamInterceptor(),
grpcfd.WithChainUnaryInterceptor(),
)

// ********************************************************************************
Expand Down Expand Up @@ -250,12 +253,7 @@ func main() {
log.FromContext(ctx).Fatalf("failed to connect to registry: %+v", err)
}

registryClient := registrychain.NewNetworkServiceEndpointRegistryClient(
refresh.NewNetworkServiceEndpointRegistryClient(),
interpose.NewNetworkServiceEndpointRegistryClient(),
registrysendfd.NewNetworkServiceEndpointRegistryClient(),
registryapi.NewNetworkServiceEndpointRegistryClient(registryCC),
)
registryClient := registryclient.NewNetworkServiceEndpointRegistryInterposeClient(ctx, registryCC)
_, err = registryClient.Register(ctx, &registryapi.NetworkServiceEndpoint{
Name: config.Name,
NetworkServiceNames: []string{config.NSName},
Expand Down
2 changes: 1 addition & 1 deletion suite_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (f *ForwarderTestSuite) SetupSuite() {
memrg := memory.NewNetworkServiceEndpointRegistryServer()
registryServer := registrychain.NewNetworkServiceEndpointRegistryServer(
setid.NewNetworkServiceEndpointRegistryServer(),
expire.NewNetworkServiceEndpointRegistryServer(24*time.Hour),
expire.NewNetworkServiceEndpointRegistryServer(f.ctx, 24*time.Hour),
registryrecvfd.NewNetworkServiceEndpointRegistryServer(),
memrg,
)
Expand Down

0 comments on commit 24686ad

Please sign in to comment.