Skip to content

Commit ee8fb3b

Browse files
authored
chore: migrate from Devbox to Mise for development environment setup (#581)
- Removed devbox.lock file as it is no longer needed. - Updated README.md to reflect the transition to Mise, including installation and usage instructions. - Updated go.mod to specify Go version 1.26.4. - Removed devbox group from renovate.json5. - Added mise.toml configuration file to define toolchain and tasks for the project. Signed-off-by: Moshe Vayner <moshe@vayner.me>
1 parent 37f347c commit ee8fb3b

11 files changed

Lines changed: 225 additions & 914 deletions

File tree

.github/copilot-instructions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ Two distinct implementations:
4343

4444
### Building & Testing
4545
```bash
46-
# Use devbox for development environment
47-
devbox shell
46+
# Use mise for the development environment
47+
mise install
4848

4949
# Build binary
50-
make build
50+
mise run build
5151

5252
# Run tests with coverage
53-
make test-coverage
53+
mise run test
5454

5555
# Generate mocks (run after changing client interface)
5656
make mockgen

.github/workflows/build-test.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,39 +53,47 @@ jobs:
5353
golang.org:443
5454
proxy.golang.org:443
5555
sum.golang.org:443
56+
dl.google.com:443
5657
*.githubusercontent.com:443
5758
storage.googleapis.com:443
5859
cli.codecov.io:443
5960
api.codecov.io:443
6061
ingest.codecov.io:443
6162
get.helm.sh:443
6263
golangci-lint.run:443
64+
mise.jdx.dev:443
65+
mise-versions.jdx.dev:443
66+
tuf-repo-cdn.sigstore.dev:443
67+
dl.k8s.io:443
68+
get.helm.sh:443
69+
githubapp.com:443
6370
6471
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6572
with:
6673
fetch-depth: 0
67-
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
74+
75+
- name: Set up Mise
76+
uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
6877
with:
69-
go-version-file: go.mod
70-
check-latest: true
78+
install_args: go golangci-lint helm
7179

7280
- name: Vet
73-
run: make vet
81+
run: mise run vet
7482

7583
- name: lint
76-
run: make lint
84+
run: mise run lint
7785

7886
- name: nilcheck
79-
run: make nilcheck
87+
run: mise run nilcheck
8088

8189
- name: Helm Lint
82-
run: make helm-lint
90+
run: mise run helm-lint
8391

8492
- name: Test
85-
run: make test
93+
run: mise run test
8694

8795
- name: Build
88-
run: make build
96+
run: mise run build
8997

9098
docker-build:
9199
runs-on: ubuntu-latest
@@ -99,13 +107,17 @@ jobs:
99107
api.github.com:443
100108
auth.docker.io:443
101109
dl-cdn.alpinelinux.org:443
110+
dl.google.com:443
102111
github.com:443
103112
production.cloudflare.docker.com:443
104113
proxy.golang.org:443
105114
registry-1.docker.io:443
106115
storage.googleapis.com:443
107116
production.cloudfront.docker.com:443
108117
sentry.io:443
118+
dl.k8s.io:443
119+
get.helm.sh:443
120+
githubapp.com:443
109121
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
110122
with:
111123
fetch-depth: 0

.github/workflows/ci.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,25 @@ jobs:
6060
cli.codecov.io:443
6161
api.codecov.io:443
6262
ingest.codecov.io:443
63+
mise.jdx.dev:443
64+
mise-versions.jdx.dev:443
65+
tuf-repo-cdn.sigstore.dev:443
66+
dl.google.com:443
67+
dl.k8s.io:443
68+
get.helm.sh:443
69+
githubapp.com:443
6370
6471
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6572
with:
6673
ref: ${{ github.event.pull_request.head.sha }}
67-
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
74+
75+
- name: Set up Mise
76+
uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
6877
with:
69-
go-version-file: go.mod
70-
check-latest: true
78+
install_args: go
7179

7280
- name: Test
73-
run: make test
81+
run: mise run test
7482

7583
- name: Upload coverage reports to Codecov
7684
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
@@ -102,33 +110,27 @@ jobs:
102110
with:
103111
ref: ${{ github.event.pull_request.head.sha }}
104112

105-
- name: Set up Go
106-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
107-
with:
108-
go-version-file: 'go.mod'
109-
check-latest: true
110-
111113
- name: Login to Docker Hub
112114
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
113115
with:
114116
username: ${{ secrets.DOCKER_USERNAME }}
115117
password: ${{ secrets.DOCKER_PASSWORD }}
116118

117-
- name: Install devbox
118-
uses: jetify-com/devbox-install-action@8c6a66ed6273138b1915457069de78cb52fe3bd7 # v0.15.0
119+
- name: Set up Mise
120+
uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
119121

120122
- name: Setup CAPL Management Kind Cluster and CAPL Child Cluster For Testing
121-
run: devbox run mgmt-and-capl-cluster
123+
run: mise run mgmt-and-capl-cluster
122124

123125
- name: Run E2E Tests
124-
run: devbox run e2e-test
126+
run: mise run e2e-test
125127

126128
- name: Run Cilium BGP e2e test
127-
run: devbox run e2e-test-bgp
129+
run: mise run e2e-test-bgp
128130

129131
- name: Run subnet filtering test
130-
run: devbox run e2e-test-subnet
132+
run: mise run e2e-test-subnet
131133

132134
- name: Cleanup Resources
133135
if: always()
134-
run: devbox run cleanup-cluster
136+
run: mise run cleanup-cluster

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ junit.xml
4444
*-manifests.yaml
4545
*-kubeconfig.yaml
4646
.opencode/
47+
48+
# Local dev setup
49+
.envrc

Makefile

Lines changed: 18 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@ IMG ?= linode/linode-cloud-controller-manager:canary
22
RELEASE_DIR ?= release
33
PLATFORM ?= linux/amd64
44

5-
# Use CACHE_BIN for tools that cannot use devbox and LOCALBIN for tools that can use either method
6-
CACHE_BIN ?= $(CURDIR)/bin
7-
LOCALBIN ?= $(CACHE_BIN)
8-
9-
DEVBOX_BIN ?= $(DEVBOX_PACKAGES_DIR)/bin
10-
HELM ?= $(LOCALBIN)/helm
11-
HELM_VERSION ?= v3.16.3
12-
CLUSTERCTL ?= $(CACHE_BIN)/clusterctl
13-
CLUSTERCTL_VERSION ?= v1.8.5
14-
15-
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
16-
GOLANGCI_LINT_NILAWAY ?= $(CACHE_BIN)/golangci-lint-nilaway
17-
185
#####################################################################
196
# Dev Setup
207
#####################################################################
@@ -38,9 +25,6 @@ CAAPH_VERSION ?= "v0.2.1"
3825
# renovate: datasource=github-tags depName=linode/cluster-api-provider-linode
3926
CAPL_VERSION ?= "v0.8.5"
4027

41-
# renovate: datasource=github-tags depName=golangci/golangci-lint
42-
GOLANGCI_LINT_VERSION ?= "v2.11.4"
43-
4428
CONTROLPLANE_NODES ?= 1
4529
WORKER_NODES ?= 1
4630
LINODE_FIREWALL_ENABLED ?= true
@@ -52,17 +36,6 @@ SUBNET_KUBECONFIG_PATH ?= $(CURDIR)/subnet-testing-kubeconfig.yaml
5236
MGMT_KUBECONFIG_PATH ?= $(CURDIR)/mgmt-cluster-kubeconfig.yaml
5337
IPV6_KUBECONFIG_PATH ?= $(CURDIR)/ipv6-kubeconfig.yaml
5438

55-
# if the $DEVBOX_PACKAGES_DIR env variable exists that means we are within a devbox shell and can safely
56-
# use devbox's bin for our tools
57-
ifdef DEVBOX_PACKAGES_DIR
58-
LOCALBIN = $(DEVBOX_BIN)
59-
endif
60-
61-
export PATH := $(CACHE_BIN):$(PATH)
62-
TOOL_DIRS := $(sort $(LOCALBIN) $(CACHE_BIN))
63-
$(TOOL_DIRS):
64-
mkdir -p $@
65-
6639
export GO111MODULE=on
6740

6841
.PHONY: all
@@ -74,7 +47,7 @@ clean:
7447
@rm -rf ./.tmp
7548
@rm -rf dist/*
7649
@rm -rf $(RELEASE_DIR)
77-
@rm -rf $(LOCALBIN)
50+
@rm -rf ./bin
7851

7952
.PHONY: codegen
8053
codegen:
@@ -85,12 +58,8 @@ vet: fmt
8558
go vet ./...
8659

8760
.PHONY: lint
88-
lint: golangci-lint
89-
$(GOLANGCI_LINT) run -c .golangci.yml --fix
90-
91-
.PHONY: lint
92-
nilcheck: golangci-lint-nilaway ## Run nilaway against code.
93-
$(GOLANGCI_LINT_NILAWAY) run -c .golangci-nilaway.yml
61+
lint:
62+
golangci-lint run -c .golangci.yml --fix
9463

9564
.PHONY: gosec
9665
gosec: ## Run gosec against code.
@@ -180,27 +149,27 @@ capl-ipv6-cluster: generate-capl-ipv6-cluster-manifests
180149
$(MAKE) create-capl-cluster
181150

182151
.PHONY: generate-capl-cluster-manifests
183-
generate-capl-cluster-manifests: clusterctl
152+
generate-capl-cluster-manifests:
184153
# Create the CAPL cluster manifests without any CSI driver stuff
185-
LINODE_FIREWALL_ENABLED=$(LINODE_FIREWALL_ENABLED) LINODE_OS=$(LINODE_OS) VPC_NAME=$(VPC_NAME) $(CLUSTERCTL) generate cluster $(CLUSTER_NAME) \
154+
LINODE_FIREWALL_ENABLED=$(LINODE_FIREWALL_ENABLED) LINODE_OS=$(LINODE_OS) VPC_NAME=$(VPC_NAME) clusterctl generate cluster $(CLUSTER_NAME) \
186155
--kubernetes-version $(K8S_VERSION) --infrastructure linode-linode:$(CAPL_VERSION) \
187156
--control-plane-machine-count $(CONTROLPLANE_NODES) --worker-machine-count $(WORKER_NODES) > $(MANIFEST_NAME).yaml
188157
IMG=$(IMG) SUBNET_NAME=$(SUBNET_NAME) ./hack/patch-capl-manifest.sh $(MANIFEST_NAME).yaml
189158

190159
.PHONY: generate-capl-ipv6-cluster-manifests
191-
generate-capl-ipv6-cluster-manifests: clusterctl
192-
LINODE_FIREWALL_ENABLED=$(LINODE_FIREWALL_ENABLED) LINODE_OS=$(LINODE_OS) VPC_NAME=$(IPV6_CLUSTER_NAME) $(CLUSTERCTL) generate cluster $(IPV6_CLUSTER_NAME) \
160+
generate-capl-ipv6-cluster-manifests:
161+
LINODE_FIREWALL_ENABLED=$(LINODE_FIREWALL_ENABLED) LINODE_OS=$(LINODE_OS) VPC_NAME=$(IPV6_CLUSTER_NAME) clusterctl generate cluster $(IPV6_CLUSTER_NAME) \
193162
--kubernetes-version $(K8S_VERSION) --infrastructure linode-linode:$(CAPL_VERSION) \
194163
--control-plane-machine-count $(CONTROLPLANE_NODES) --worker-machine-count $(WORKER_NODES) --flavor kubeadm-dual-stack > $(IPV6_MANIFEST_NAME).yaml
195164
IMG=$(IMG) ./hack/patch-capl-manifest.sh $(IPV6_MANIFEST_NAME).yaml
196165

197166
.PHONY: create-capl-cluster
198-
create-capl-cluster: clusterctl
167+
create-capl-cluster:
199168
# Create a CAPL cluster with updated CCM and wait for it to be ready
200169
kubectl apply -f $(MANIFEST_NAME).yaml
201170
kubectl wait --for=condition=ControlPlaneReady cluster/$(CLUSTER_NAME) --timeout=600s || (kubectl get cluster -o yaml; kubectl get linodecluster -o yaml; kubectl get linodemachines -o yaml; kubectl logs -n capl-system deployments/capl-controller-manager --tail=50)
202171
kubectl wait --for=condition=NodeHealthy=true machines -l cluster.x-k8s.io/cluster-name=$(CLUSTER_NAME) --timeout=900s
203-
$(CLUSTERCTL) get kubeconfig $(CLUSTER_NAME) > $(KUBECONFIG_PATH)
172+
clusterctl get kubeconfig $(CLUSTER_NAME) > $(KUBECONFIG_PATH)
204173
KUBECONFIG=$(KUBECONFIG_PATH) kubectl wait --for=condition=Ready nodes --all --timeout=600s
205174
# Remove all taints from control plane node so that pods scheduled on it by tests can run (without this, some tests fail)
206175
KUBECONFIG=$(KUBECONFIG_PATH) kubectl taint nodes -l node-role.kubernetes.io/control-plane node-role.kubernetes.io/control-plane-
@@ -214,10 +183,10 @@ patch-linode-ccm:
214183
KUBECONFIG=$(KUBECONFIG_PATH) kubectl -n kube-system get daemonset/ccm-linode -o yaml
215184

216185
.PHONY: mgmt-cluster
217-
mgmt-cluster: clusterctl
186+
mgmt-cluster:
218187
# Create a mgmt cluster
219188
ctlptl apply -f e2e/setup/ctlptl-config.yaml
220-
$(CLUSTERCTL) init \
189+
clusterctl init \
221190
--wait-providers \
222191
--wait-provider-timeout 600 \
223192
--core cluster-api:$(CAPI_VERSION) \
@@ -283,60 +252,15 @@ e2e-test-subnet:
283252
SECOND_CONFIG=$(SUBNET_KUBECONFIG_PATH) \
284253
chainsaw test e2e/subnet-test $(E2E_FLAGS)
285254

286-
#####################################################################
287-
# OS / ARCH
288-
#####################################################################
289-
290-
# Set the host's OS. Only linux and darwin supported for now
291-
HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
292-
ifeq ($(filter darwin linux,$(HOSTOS)),)
293-
$(error build only supported on linux and darwin host currently)
294-
endif
295-
ARCH=$(shell uname -m)
296-
ARCH_SHORT=$(ARCH)
297-
ifeq ($(ARCH_SHORT),x86_64)
298-
ARCH_SHORT := amd64
299-
else ifeq ($(ARCH_SHORT),aarch64)
300-
ARCH_SHORT := arm64
301-
endif
302-
303-
.PHONY: helm
304-
helm: $(HELM) ## Download helm locally if necessary
305-
$(HELM): $(LOCALBIN)
306-
@curl -fsSL https://get.helm.sh/helm-$(HELM_VERSION)-$(HOSTOS)-$(ARCH_SHORT).tar.gz | tar -xz
307-
@mv $(HOSTOS)-$(ARCH_SHORT)/helm $(HELM)
308-
@rm -rf helm.tgz $(HOSTOS)-$(ARCH_SHORT)
309-
310255
.PHONY: helm-lint
311-
helm-lint: helm
256+
helm-lint:
312257
#Verify lint works when region and apiToken are passed, and when it is passed as reference.
313-
@$(HELM) lint deploy/chart --set apiToken="apiToken",region="us-east"
314-
@$(HELM) lint deploy/chart --set secretRef.apiTokenRef="apiToken",secretRef.name="api",secretRef.regionRef="us-east"
258+
@helm lint deploy/chart --set apiToken="apiToken",region="us-east"
259+
@helm lint deploy/chart --set secretRef.apiTokenRef="apiToken",secretRef.name="api",secretRef.regionRef="us-east"
315260

316261
.PHONY: helm-template
317-
helm-template: helm
262+
helm-template:
318263
#Verify template works when region and apiToken are passed, and when it is passed as reference.
319-
@$(HELM) template foo deploy/chart --set apiToken="apiToken",region="us-east" > /dev/null
320-
@$(HELM) template foo deploy/chart --set secretRef.apiTokenRef="apiToken",secretRef.name="api",secretRef.regionRef="us-east" > /dev/null
321-
322-
.PHONY: kubectl
323-
kubectl: $(KUBECTL) ## Download kubectl locally if necessary.
324-
$(KUBECTL): $(LOCALBIN)
325-
curl -fsSL https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/$(HOSTOS)/$(ARCH_SHORT)/kubectl -o $(KUBECTL)
326-
chmod +x $(KUBECTL)
327-
328-
.PHONY: clusterctl
329-
clusterctl: $(CLUSTERCTL) ## Download clusterctl locally if necessary.
330-
$(CLUSTERCTL): $(CACHE_BIN)
331-
curl -fsSL https://github.com/kubernetes-sigs/cluster-api/releases/download/$(CLUSTERCTL_VERSION)/clusterctl-$(HOSTOS)-$(ARCH_SHORT) -o $(CLUSTERCTL)
332-
chmod +x $(CLUSTERCTL)
333-
334-
.phony: golangci-lint-nilaway
335-
golangci-lint-nilaway: $(GOLANGCI_LINT_NILAWAY)
336-
$(GOLANGCI_LINT_NILAWAY): $(GOLANGCI_LINT) # Build golangci-lint-nilaway from custom configuration.
337-
$(GOLANGCI_LINT) custom
338-
339-
.phony: golangci-lint
340-
golangci-lint: $(GOLANGCI_LINT)
341-
$(GOLANGCI_LINT): # Build golangci-lint from tools folder.
342-
GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
264+
@helm template foo deploy/chart --set apiToken="apiToken",region="us-east" > /dev/null
265+
@helm template foo deploy/chart --set secretRef.apiTokenRef="apiToken",secretRef.name="api",secretRef.regionRef="us-east" > /dev/null
266+

devbox.json

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)