Merge branch 'review' into 'master'

Initial review

See merge request arm-research/smarter/smarter-device-manager!1
This commit is contained in:
Alexandre Ferreira 2020-01-17 21:36:44 +00:00
commit 753e68e81b
7 changed files with 14 additions and 21 deletions

View File

@ -13,8 +13,6 @@ RUN echo $PATH;export CGO_LDFLAGS_ALLOW='-Wl,--unresolved-symbols=ignore-in-obje
FROM alpine
RUN apk update && apk upgrade
WORKDIR /root
@ -22,6 +20,4 @@ WORKDIR /root
COPY conf.yaml /root/config/conf.yaml
COPY --from=build /go/bin/smarter-device-management /usr/bin/smarter-device-management
CMD ["smarter-device-management","-logtostderr=true","-v=0"]
CMD ["smarter-device-management","-logtostderr=true","-v=0"]

View File

@ -1,4 +1,4 @@
// Copyright (c) 2019, ARM
// Copyright (c) 2019, Arm Ltd
package main

View File

@ -19,7 +19,7 @@ function printHelp() {
fi
if [ ${FLAG_USESQUASH} -gt 0 ]
then
echo " -S # Do not squash images - the default is squash the images"
echo " -S # Do not squash images - the default is to squash the images"
else
echo " -S # Squash images - the default is not to squash the images"
fi
@ -36,14 +36,13 @@ DIRECTORY_TO_RUN=.
ARCHS="linux/arm/v7"
# If the user does not change it the images will be uploaded to the registry
# Variable defaults
FLAG_UPLOADIMAGES=1
FLAG_USESQUASH=0
FLAG_UPLOADMANIFEST=1
# No changes to the image names
ADDITIONAL_TAG=""
ADDITIONAL_IMAGE_NAME=""
PUSH_OPTION=""
while getopts hA:B:MST:U name
do
@ -78,7 +77,7 @@ do
esac
done
# We need docker to support manifest for multiarch, try so see if we have it
# We need docker client to support manifest for multiarch, try so see if we have it enabled
if [ ${FLAG_UPLOADMANIFEST} -gt 0 ]
then
if [ -e ~/.docker/config.json ]
@ -94,7 +93,6 @@ EOF
fi
fi
PUSH_OPTION=""
if [ $FLAG_UPLOADIMAGES -gt 0 ]
then
PUSH_OPTION="--push"

View File

@ -15,4 +15,4 @@
- devicematch: ^vchiq$
nummaxdevices: 20
- devicematch: ^vcsm.*$
nummaxdevices: 20
nummaxdevices: 20

View File

@ -1,4 +1,4 @@
// Copyright (c) 2019, ARM
// Copyright (c) 2019, Arm Ltd
package main
@ -80,7 +80,6 @@ func main() {
glog.V(0).Info("Loading smarter-device-manager")
// Setting up the devices to check
var desiredDevices []DesiredDevice
glog.V(0).Info("Reading configuration file ",confFileName)
yamlFile, err := ioutil.ReadFile(confFileName)

View File

@ -1,4 +1,4 @@
// Copyright (c) 2019, ARM
// Copyright (c) 2019, Arm Ltd
package main
@ -63,7 +63,7 @@ func dial(unixSocketPath string, timeout time.Duration) (*grpc.ClientConn, error
return c, nil
}
// Start starts the gRPC server of the device plugin
// Start the gRPC server of the device plugin
func (m *SmarterDevicePlugin) Start() error {
err := m.cleanup()
if err != nil {
@ -92,7 +92,7 @@ func (m *SmarterDevicePlugin) Start() error {
return nil
}
// Stop stops the gRPC server
// Stop the gRPC server
func (m *SmarterDevicePlugin) Stop() error {
if m.server == nil {
return nil
@ -105,7 +105,7 @@ func (m *SmarterDevicePlugin) Stop() error {
return m.cleanup()
}
// Register registers the device plugin for the given resourceName with Kubelet.
// Register the device plugin for the given resourceName with Kubelet.
func (m *SmarterDevicePlugin) Register(kubeletEndpoint, resourceName string) error {
conn, err := dial(kubeletEndpoint, 5*time.Second)
if err != nil {
@ -192,13 +192,11 @@ func (m *SmarterDevicePlugin) healthcheck() {
disableHealthChecks = allHealthChecks
}
//ctx, cancel := context.WithCancel(context.Background())
_, cancel := context.WithCancel(context.Background())
var xids chan *pluginapi.Device
if !strings.Contains(disableHealthChecks, "xids") {
xids = make(chan *pluginapi.Device)
//go watchXIDs(ctx, m.devs, xids)
}
for {

View File

@ -1,3 +1,5 @@
// Copyright (c) 2019, Arm Ltd
package main
import (