Skip to content

Commit

Permalink
Merge branch 'main' into chore/upgrade-all-k8s-1.29
Browse files Browse the repository at this point in the history
  • Loading branch information
edude03 authored Nov 25, 2024
2 parents a430cbb + 15b68b9 commit 116305b
Show file tree
Hide file tree
Showing 55 changed files with 1,023 additions and 927 deletions.
36 changes: 0 additions & 36 deletions .github/actions/set-docker-config-dir/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
echo "info=$(git describe --tags --long --dirty)" >> $GITHUB_OUTPUT
- name: set custom docker config directory
uses: ./.github/actions/set-docker-config-dir
uses: neondatabase/dev-actions/set-docker-config-dir@6094485bf440001c94a94a3f9e221e81ff6b6193

- uses: docker/setup-buildx-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
retention-days: 2

- name: set custom docker config directory
uses: ./.github/actions/set-docker-config-dir
uses: neondatabase/dev-actions/set-docker-config-dir@6094485bf440001c94a94a3f9e221e81ff6b6193

- name: login to docker hub
uses: docker/login-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-ca-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v4

- name: set custom docker config directory
uses: ./.github/actions/set-docker-config-dir
uses: neondatabase/dev-actions/set-docker-config-dir@6094485bf440001c94a94a3f9e221e81ff6b6193

- uses: docker/setup-buildx-action@v3
- name: Login to Docker cache registry
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
retention-days: 2 # minimum is 1 day; 0 is default. These are only used temporarily.

- name: set custom docker config directory
uses: ./.github/actions/set-docker-config-dir
uses: neondatabase/dev-actions/set-docker-config-dir@6094485bf440001c94a94a3f9e221e81ff6b6193

- uses: docker/login-action@v3
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/vm-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: vm-example
on:
schedule:
- cron: '42 4 * * 2' # run once a week
pull_request:
paths:
- ".github/workflows/vm-example.yaml"
workflow_dispatch: # adds ability to run this manually

jobs:
Expand All @@ -19,6 +22,9 @@ jobs:
go-version-file: 'go.mod'
timeout-minutes: 10

- name: build daemon
run: make docker-build-daemon

- name: build vm-builder
run: make bin/vm-builder

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vm-kernel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
uses: actions/checkout@v4

- name: set custom docker config directory
uses: ./.github/actions/set-docker-config-dir
uses: neondatabase/dev-actions/set-docker-config-dir@6094485bf440001c94a94a3f9e221e81ff6b6193

- name: docker - setup buildx
uses: docker/setup-buildx-action@v3
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ linters:
- staticcheck # some rules from staticcheck.io
- typecheck # typechecks code, like the compiler
- unused # checks for unused constants/variables/functions/types
- gofumpt # Formatter.

# explicitly enabled:
- asciicheck # all identifiers are ASCII
Expand Down
23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PG16_DISK_TEST_IMG ?= pg16-disk-test:dev
GOARCH ?= $(shell go env GOARCH)
GOOS ?= $(shell go env GOOS)

# The target architecture for linux kernel. Possible values: amd64 or arm64.
# The target architecture for linux kernel. Possible values: amd64 or arm64.
# Any other supported by linux kernel architecture could be added by introducing new build step into neonvm/hack/kernel/Dockerfile.kernel-builder
KERNEL_TARGET_ARCH ?= amd64

Expand All @@ -33,6 +33,8 @@ endif
# https://github.com/neondatabase/autoscaling/pull/130#issuecomment-1496276620
export GOFLAGS=-buildvcs=false

GOFUMPT_VERSION ?= v0.7.0

# Setting SHELL to bash allows bash commands to be executed by recipes.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
Expand Down Expand Up @@ -108,7 +110,7 @@ generate: ## Generate boilerplate DeepCopy methods, manifests, and Go client

.PHONY: fmt
fmt: ## Run go fmt against code.
go fmt ./...
go run mvdan.cc/gofumpt@${GOFUMPT_VERSION} -w .

.PHONY: vet
vet: ## Run go vet against code.
Expand All @@ -119,7 +121,7 @@ vet: ## Run go vet against code.

TESTARGS ?= ./...
.PHONY: test
test: fmt vet envtest ## Run tests.
test: vet envtest ## Run tests.
# chmodding KUBEBUILDER_ASSETS dir to make it deletable by owner,
# otherwise it fails with actions/checkout on self-hosted GitHub runners
# ref: https://github.com/kubernetes-sigs/controller-runtime/pull/2245
Expand All @@ -132,16 +134,19 @@ test: fmt vet envtest ## Run tests.
##@ Build

.PHONY: build
build: fmt vet bin/vm-builder ## Build all neonvm binaries.
GOOS=linux go build -o bin/controller neonvm/main.go
GOOS=linux go build -o bin/vxlan-controller neonvm/tools/vxlan/controller/main.go
GOOS=linux go build -o bin/runner neonvm/runner/*.go
build: vet bin/vm-builder ## Build all neonvm binaries.
GOOS=linux go build -o bin/controller neonvm-controller/cmd/main.go
GOOS=linux go build -o bin/vxlan-controller neonvm-vxlan-controller/cmd/main.go
GOOS=linux go build -o bin/runner neonvm-runner/cmd/main.go
GOOS=linux go build -o bin/daemon neonvm-daemon/cmd/main.go
GOOS=linux go build -o bin/autoscaler-agent autoscaler-agent/cmd/main.go
GOOS=linux go build -o bin/scheduler autoscale-scheduler/cmd/main.go

.PHONY: bin/vm-builder
bin/vm-builder: ## Build vm-builder binary.
GOOS=linux CGO_ENABLED=0 go build -o bin/vm-builder -ldflags "-X main.Version=${GIT_INFO} -X main.NeonvmDaemonImage=${IMG_DAEMON}" vm-builder/main.go
GOOS=linux CGO_ENABLED=0 go build -o bin/vm-builder -ldflags "-X main.Version=${GIT_INFO} -X main.NeonvmDaemonImage=${IMG_DAEMON}" vm-builder/main.go
.PHONY: run
run: fmt vet ## Run a controller from your host.
run: vet ## Run a controller from your host.
go run ./neonvm/main.go

.PHONY: lint
Expand Down
10 changes: 10 additions & 0 deletions autoscale-scheduler/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@ spec:
- name: plugin-config-volume
configMap:
name: scheduler-plugin-config

tolerations:
# Add explicit (short) tolerations for node failure, because otherwise the default of 5m
# will be used, which is unacceptably long for us.
- key: node.kubernetes.io/not-ready
tolerationSeconds: 30
effect: NoExecute
- key: node.kubernetes.io/unreachable
tolerationSeconds: 30
effect: NoExecute
2 changes: 1 addition & 1 deletion cluster-autoscaler/ca.branch
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cluster-autoscaler-release-1.29
cluster-autoscaler-release-1.29
2 changes: 1 addition & 1 deletion cluster-autoscaler/ca.commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d4bbc686ac02a77a6ad1362fe7bbda387e8f074a
d4bbc686ac02a77a6ad1362fe7bbda387e8f074a
8 changes: 4 additions & 4 deletions neonvm-runner/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func getLines(input []byte, commentMarker []byte) [][]byte {
lines := bytes.Split(input, []byte("\n"))
var output [][]byte
for _, currentLine := range lines {
var commentIndex = bytes.Index(currentLine, commentMarker)
commentIndex := bytes.Index(currentLine, commentMarker)
if commentIndex == -1 {
output = append(output, currentLine)
} else {
Expand Down Expand Up @@ -335,7 +335,7 @@ func createISO9660runtime(
}
}

outputFile, err := os.OpenFile(diskPath, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644)
outputFile, err := os.OpenFile(diskPath, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0o644)
if err != nil {
return err
}
Expand Down Expand Up @@ -534,7 +534,7 @@ func createISO9660FromPath(logger *zap.Logger, diskName string, diskPath string,
}
}

outputFile, err := os.OpenFile(diskPath, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644)
outputFile, err := os.OpenFile(diskPath, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0o644)
if err != nil {
return err
}
Expand Down Expand Up @@ -1733,7 +1733,7 @@ func defaultNetwork(logger *zap.Logger, cidr string, ports []vmv1.Port) (mac.MAC
// Adding VM's IP address to the /etc/hosts, so we can access it easily from
// the pod. This is particularly useful for ssh into the VM from the runner
// pod.
f, err := os.OpenFile("/etc/hosts", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
f, err := os.OpenFile("/etc/hosts", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
if err != nil {
return nil, err
}
Expand Down
6 changes: 1 addition & 5 deletions neonvm-vxlan-controller/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ const (
extraNetCidr = "10.100.0.0/16"
)

var (
deleteIfaces = flag.Bool("delete", false, `delete VXLAN interfaces`)
)
var deleteIfaces = flag.Bool("delete", false, `delete VXLAN interfaces`)

func main() {
flag.Parse()
Expand Down Expand Up @@ -192,7 +190,6 @@ func createVxlanInterface(name string, vxlanID int, ownIP string, bridgeName str
}

func updateFDB(vxlanName string, nodeIPs []string, ownIP string) error {

broadcastFdbMac, _ := net.ParseMAC("00:00:00:00:00:00")

// get vxlan interface details
Expand Down Expand Up @@ -248,7 +245,6 @@ func deleteLink(name string) error {
}

func upsertIptablesRules() error {

// manage iptables
ipt, err := iptables.New(iptables.IPFamily(iptables.ProtocolIPv4), iptables.Timeout(5))
if err != nil {
Expand Down
13 changes: 7 additions & 6 deletions neonvm/apis/neonvm/v1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ import (
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.

var cfg *rest.Config
var k8sClient client.Client
var testEnv *envtest.Environment
var ctx context.Context
var cancel context.CancelFunc
var (
cfg *rest.Config
k8sClient client.Client
testEnv *envtest.Environment
ctx context.Context
cancel context.CancelFunc
)

func TestAPIs(t *testing.T) {
RegisterFailHandler(Fail)
Expand Down Expand Up @@ -127,7 +129,6 @@ var _ = BeforeSuite(func() {
conn.Close()
return nil
}).Should(Succeed())

})

var _ = AfterSuite(func() {
Expand Down
Loading

0 comments on commit 116305b

Please sign in to comment.