From 2fca52e65a4365ccdbf4c9e490b952d21355fb56 Mon Sep 17 00:00:00 2001 From: Erik Sipsma Date: Wed, 4 Dec 2019 23:58:46 +0000 Subject: [PATCH 1/2] Add buildkite step to verify proto is up-to-date. I noticed there was a difference in generated proto after a recent commit (it was insignificant, just a difference in the comments of the generated .pb.go), so it seemed like a good time to add this check. Signed-off-by: Erik Sipsma --- .buildkite/pipeline.yml | 11 +++++++++++ proto/Makefile | 2 +- proto/firecracker.pb.go | 21 +++++++++++++++++---- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 2688669e8..3af830847 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -45,6 +45,16 @@ steps: - label: 'git log validation' command: './.buildkite/logcheck.sh' + - label: ":protractor: verify proto" + agents: + queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}" + env: + DOCKER_IMAGE_TAG: "$BUILDKITE_BUILD_NUMBER" + command: + - make proto + - test -z "$(git status --porcelain)" && exit 0 || git status && echo -e '\nGenerated protobuf code differs from committed, please run "make proto" and commit the updated files.\n' && exit 1 + timeout_in_minutes: 1 + - label: ":gear: unit tests" agents: queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}" @@ -78,3 +88,4 @@ steps: command: - make -C examples integ-test TEST_SS=devmapper TEST_POOL=build_${BUILDKITE_BUILD_NUMBER}_example timeout_in_minutes: 10 + diff --git a/proto/Makefile b/proto/Makefile index 32cee1210..0ac66eb50 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -37,4 +37,4 @@ clean: - $(MAKE) -C service/fccontrol clean - $(MAKE) -C service/drivemount clean -.PHONY: clean proto +.PHONY: clean proto proto-docker diff --git a/proto/firecracker.pb.go b/proto/firecracker.pb.go index 723e77c83..203046a18 100644 --- a/proto/firecracker.pb.go +++ b/proto/firecracker.pb.go @@ -534,11 +534,24 @@ func (m *GetVMMetadataResponse) GetMetadata() string { type JailerConfig struct { NetNS string `protobuf:"bytes,1,opt,name=NetNS,json=netNS,proto3" json:"NetNS,omitempty"` - // The list of CPUs to run the jailed application on. This field can only - // be used on numa architectures + // List of the physical numbers of the CPUs on which processes in that + // cpuset are allowed to execute. See List Format below for a description + // of the format of cpus. + // + // The CPUs allowed to a cpuset may be changed by writing a new list to its + // cpus file. + // Taken from http://man7.org/linux/man-pages/man7/cpuset.7.html + // + // This is formatted as specified in the cpuset man page under "List Format" + // http://man7.org/linux/man-pages/man7/cpuset.7.html CPUs string `protobuf:"bytes,2,opt,name=CPUs,json=cPUs,proto3" json:"CPUs,omitempty"` - // The list of memory nodes to run with the jailed application on. This - // field can only be used on numa architectures + // List of memory nodes on which processes in this cpuset are allowed to + // allocate memory. See List Format below for a description of the format + // of mems. + // Taken from http://man7.org/linux/man-pages/man7/cpuset.7.html + // + // This is formatted as specified in the cpuset man page under "List Format" + // http://man7.org/linux/man-pages/man7/cpuset.7.html Mems string `protobuf:"bytes,3,opt,name=Mems,json=mems,proto3" json:"Mems,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` From 83a66d7af1769427accfbacceb6fba3456b4935f Mon Sep 17 00:00:00 2001 From: Erik Sipsma Date: Thu, 5 Dec 2019 00:42:34 +0000 Subject: [PATCH 2/2] Add buildkite step to verify go mod tidy has run. Signed-off-by: Erik Sipsma --- .buildkite/pipeline.yml | 10 ++++++++++ Makefile | 5 ++++- go.mod | 5 ++--- go.sum | 4 ---- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 3af830847..1907ccfc4 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -55,6 +55,16 @@ steps: - test -z "$(git status --porcelain)" && exit 0 || git status && echo -e '\nGenerated protobuf code differs from committed, please run "make proto" and commit the updated files.\n' && exit 1 timeout_in_minutes: 1 + - label: ":golang: go mod tidy" + agents: + queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}" + env: + DOCKER_IMAGE_TAG: "$BUILDKITE_BUILD_NUMBER" + command: + - make tidy-in-docker + - test -z "$(git status --porcelain)" && exit 0 || git status && echo -e '\ngo.mod and/or go.sum differ from committed, please run "go mod tidy" and commit the updated files.\n' && exit 1 + timeout_in_minutes: 1 + - label: ":gear: unit tests" agents: queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}" diff --git a/Makefile b/Makefile index 38c0ffecf..2defada75 100644 --- a/Makefile +++ b/Makefile @@ -98,6 +98,9 @@ lint: $(BINPATH)/git-validation -run DCO,short-subject -range HEAD~20..HEAD $(BINPATH)/golangci-lint run +tidy: + go mod tidy + deps: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(BINPATH) v1.21.0 $(BINPATH)/golangci-lint --version @@ -153,7 +156,7 @@ firecracker-containerd-test-image: all-in-docker firecracker runc test-cni-bins --build-arg FIRECRACKER_TARGET=$(FIRECRACKER_TARGET) \ --tag $(FIRECRACKER_CONTAINERD_TEST_IMAGE):${DOCKER_IMAGE_TAG} . -.PHONY: all $(SUBDIRS) clean proto deps lint install image test-images firecracker-container-test-image firecracker-containerd-integ-test-image test test-in-docker $(TEST_SUBDIRS) integ-test $(INTEG_TEST_SUBDIRS) +.PHONY: all $(SUBDIRS) clean proto deps lint install image test-images firecracker-container-test-image firecracker-containerd-integ-test-image test test-in-docker $(TEST_SUBDIRS) integ-test $(INTEG_TEST_SUBDIRS) tidy ########################## # Runtime config diff --git a/go.mod b/go.mod index af09a501d..f16334b95 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/containerd/cgroups v0.0.0-20181105182409-82cb49fc1779 // indirect github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50 // indirect github.com/containerd/containerd v1.3.1 - github.com/containerd/continuity v0.0.0-20181027224239-bea7585dbfac + github.com/containerd/continuity v0.0.0-20181027224239-bea7585dbfac // indirect github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c github.com/containerd/go-runc v0.0.0-20190226155025-7d11b49dc076 // indirect github.com/containerd/ttrpc v0.0.0-20190613183316-1fb3814edf44 @@ -17,7 +17,6 @@ require ( github.com/docker/distribution v2.7.1+incompatible // indirect github.com/docker/go-events v0.0.0-20170721190031-9461782956ad // indirect github.com/docker/go-metrics v0.0.0-20181218153428-b84716841b82 // indirect - github.com/docker/go-units v0.3.3 github.com/firecracker-microvm/firecracker-go-sdk v0.19.1-0.20191114205152-9e2ff62839b2 github.com/go-ole/go-ole v1.2.4 // indirect github.com/godbus/dbus v0.0.0-20181025153459-66d97aec3384 // indirect @@ -43,7 +42,7 @@ require ( github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 // indirect github.com/urfave/cli v1.20.0 // indirect github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf - go.etcd.io/bbolt v1.3.1-etcd.8 + go.etcd.io/bbolt v1.3.1-etcd.8 // indirect golang.org/x/sync v0.0.0-20181108010431-42b317875d0f golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f google.golang.org/genproto v0.0.0-20181109154231-b5d43981345b // indirect diff --git a/go.sum b/go.sum index e353a3516..b2bb1f115 100644 --- a/go.sum +++ b/go.sum @@ -18,7 +18,6 @@ github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:l github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/checkpoint-restore/go-criu v0.0.0-20190109184317-bdb7599cd87b/go.mod h1:TrMrLQfeENAPYPRsJuq3jsqdlRh3lvi6trTZJG8+tho= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/containerd/cgroups v0.0.0-20181105182409-82cb49fc1779 h1:j1IsLW6/hNZPIyBH1v0hhEeB1WXE2ffhHaqSuXhgknY= github.com/containerd/cgroups v0.0.0-20181105182409-82cb49fc1779/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= @@ -45,7 +44,6 @@ github.com/coreos/go-iptables v0.4.2/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmeka github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142 h1:3jFq2xL4ZajGK4aZY8jz+DAF0FHjI51BXjjSwCzS1Dk= github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= @@ -149,7 +147,6 @@ github.com/miekg/dns v1.1.16 h1:iMEQ/IVHxPTtx2Q07JP/k4CKRvSjiAZjZ0hnhgYEDmE= github.com/miekg/dns v1.1.16/go.mod h1:YNV562EiewvSmpCB6/W4c6yqjK7Z+M/aIS1JHsIVeg8= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b h1:Ey6yH0acn50T/v6CB75bGP4EMJqnv9WvnjN7oZaj+xE= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a h1:KfNOeFvoAssuZLT7IntKZElKwi/5LRuxY71k+t6rfaM= @@ -162,7 +159,6 @@ github.com/opencontainers/runc v1.0.0-rc9 h1:/k06BMULKF5hidyoZymkoDCzdJzltZpz/UU github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runtime-spec v0.1.2-0.20181106065543-31e0d16c1cb7 h1:vg5OQBKq2D0TX7q7loKQBLZ54IUAbUvq1rlwDRdn1gY= github.com/opencontainers/runtime-spec v0.1.2-0.20181106065543-31e0d16c1cb7/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/selinux v1.3.0/go.mod h1:+BLncwf63G4dgOzykXAxcmnFlUaOlkDdmw/CqsW6pjs= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=