Merge branch 'dev' into 'master'

Adding a formal way to contribute to the project

See merge request arm-research/smarter/smarter-device-manager!14
This commit is contained in:
Alexandre Ferreira 2021-02-23 20:23:16 +00:00
commit 2dfd0f1461
7 changed files with 33 additions and 12 deletions

16
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,16 @@
# Contributing to SMARTER
SMARTER is an open-source, software platform for the Edge. Contributions are an important part of the platform, and our goal is to make it as simple as possible to become a contributor.
# Project license, and developer certificate of origin
The SMARTER codebase is licensed under the Apache 2.0 open source license, individual components may have their own licenses.
Please see the LICENSE file in the SMARTER documentation repository for the full text of this license, or the LICENSE file
in respective repositories. New contributions are expected to be lisensed under the Apache 2.0 license or something compatible
with that license.
Please note that we expect contributors to the project to self-certify that they are authorized to contribute code
using the Linux Foundation's Developer Certificate of Origin. See http://developercertificate.org for more details.
Contributors sign-off that they adhere to these requirements by adding a Signed-off-by line to commit messages.
Pull requests for contributions without a signed-off-by line will not be accepted.

View File

@ -1,4 +0,0 @@
We sincerely appreciate your interest of contributing to this project but for now
we are not able to accept contributions. We expect to change this policy soon and
provide a contribution procedure. We suggest that the project be maintained on a
different branch until the contribution policy is changed.

View File

@ -5,11 +5,12 @@ RUN apk update && apk upgrade && apk add tar ca-certificates build-base
ENV GOPATH /go ENV GOPATH /go
RUN go version RUN go version
WORKDIR /go/src/smarter-device-management WORKDIR /arm.com/smarter-device-management
COPY . . COPY . .
RUN echo $PATH;export CGO_LDFLAGS_ALLOW='-Wl,--unresolved-symbols=ignore-in-object-files' && \ RUN echo $PATH;export CGO_LDFLAGS_ALLOW='-Wl,--unresolved-symbols=ignore-in-object-files' && \
go install -ldflags="-s -w" -v smarter-device-management go mod init arm.com/smarter-device-management && go mod tidy && go mod vendor && \
go build -ldflags="-s -w" .
FROM alpine FROM alpine
@ -18,6 +19,6 @@ RUN apk update && apk upgrade
WORKDIR /root WORKDIR /root
COPY conf.yaml /root/config/conf.yaml COPY conf.yaml /root/config/conf.yaml
COPY --from=build /go/bin/smarter-device-management /usr/bin/smarter-device-management COPY --from=build /arm.com/smarter-device-management/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

@ -4,7 +4,7 @@ package main
import ( import (
"github.com/golang/glog" "github.com/golang/glog"
pluginapi "k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1beta1" pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"
) )
func check(err error) { func check(err error) {

View File

@ -14,7 +14,7 @@ import (
"github.com/fsnotify/fsnotify" "github.com/fsnotify/fsnotify"
"github.com/golang/glog" "github.com/golang/glog"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
pluginapi "k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1beta1" pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"
) )
var confFileName string var confFileName string

View File

@ -13,7 +13,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"golang.org/x/net/context" "golang.org/x/net/context"
"google.golang.org/grpc" "google.golang.org/grpc"
pluginapi "k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1beta1" pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"
) )
var passDeviceSpecs = flag.Bool("pass-device-specs", false, "pass the list of DeviceSpecs to the kubelet on Allocate()") var passDeviceSpecs = flag.Bool("pass-device-specs", false, "pass the list of DeviceSpecs to the kubelet on Allocate()")
@ -182,6 +182,10 @@ func (m *NvidiaDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreSt
return &pluginapi.PreStartContainerResponse{}, nil return &pluginapi.PreStartContainerResponse{}, nil
} }
func (m *NvidiaDevicePlugin) GetPreferredAllocation(context.Context, *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error) {
return &pluginapi.PreferredAllocationResponse{}, nil
}
func (m *NvidiaDevicePlugin) cleanup() error { func (m *NvidiaDevicePlugin) cleanup() error {
if err := os.Remove(m.socket); err != nil && !os.IsNotExist(err) { if err := os.Remove(m.socket); err != nil && !os.IsNotExist(err) {
return err return err

View File

@ -13,7 +13,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"golang.org/x/net/context" "golang.org/x/net/context"
"google.golang.org/grpc" "google.golang.org/grpc"
pluginapi "k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1beta1" pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"
) )
const ( const (
@ -180,6 +180,10 @@ func (m *SmarterDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreS
return &pluginapi.PreStartContainerResponse{}, nil return &pluginapi.PreStartContainerResponse{}, nil
} }
func (m *SmarterDevicePlugin) GetPreferredAllocation(context.Context, *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error) {
return &pluginapi.PreferredAllocationResponse{}, nil
}
func (m *SmarterDevicePlugin) cleanup() error { func (m *SmarterDevicePlugin) cleanup() error {
glog.V(0).Info("Removing file ",m.socket) glog.V(0).Info("Removing file ",m.socket)
if err := os.Remove(m.socket); err != nil && !os.IsNotExist(err) { if err := os.Remove(m.socket); err != nil && !os.IsNotExist(err) {