Skip to content

Commit

Permalink
Add minikube to create volume snapshot development environment locally (
Browse files Browse the repository at this point in the history
#2228)

* Add minikube to create volume snapshot development environment locally

* Fix devcontainer build

* Add triggers for devcontainer build

* apply format
  • Loading branch information
ykadowak authored Nov 6, 2023
1 parent e59ded2 commit 248a82a
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 8 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/dockers-dev-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,31 @@ on:
- ".github/actions/docker-build/actions.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-dev-container-image.yml"
- "dockers/ci/**"
- "dockers/dev/**"
- "Makefile"
- "Makefile.d/**"
- "versions/GO_VERSION"
- "versions/NGT_VERSION"
pull_request:
paths:
- ".github/actions/docker-build/actions.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-dev-container-image.yml"
- "dockers/ci/**"
- "dockers/dev/**"
- "Makefile"
- "Makefile.d/**"
- "versions/GO_VERSION"
- "versions/NGT_VERSION"
pull_request_target:
paths:
- ".github/actions/docker-build/actions.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-dev-container-image.yml"
- "dockers/ci/**"
- "dockers/dev/**"
- "Makefile"
- "Makefile.d/**"
- "versions/GO_VERSION"
- "versions/NGT_VERSION"
schedule:
- cron: "0 1 * * *"

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -579,3 +579,4 @@ include Makefile.d/kind.mk
include Makefile.d/proto.mk
include Makefile.d/test.mk
include Makefile.d/tools.mk
include Makefile.d/minikube.mk
42 changes: 42 additions & 0 deletions Makefile.d/minikube.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Copyright (C) 2019-2023 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
.PHONY: minikube/install
minikube/install: $(BINDIR)/minikube

$(BINDIR)/minikube:
mkdir -p $(BINDIR)
curl -L https://storage.googleapis.com/minikube/releases/latest/minikube-$(shell echo $(UNAME) | tr '[:upper:]' '[:lower:]')-$(subst x86_64,amd64,$(shell echo $(ARCH) | tr '[:upper:]' '[:lower:]')) -o $(BINDIR)/minikube
chmod a+x $(BINDIR)/minikube

# Start minikube with CSI Driver and Volume Snapshots support
# Only use this for development related to Volume Snapshots. Usually k3d is faster.
.PHONY: minikube/start
minikube/start:
minikube start --force
minikube addons enable volumesnapshots
minikube addons enable csi-hostpath-driver
minikube addons disable storage-provisioner
minikube addons disable default-storageclass
kubectl patch storageclass csi-hostpath-sc -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

.PHONY: minikube/delete
minikube/delete:
minikube delete

.PHONY: minikube/restart
minikube/restart:
@make minikube/delete
@make minikube/start
6 changes: 2 additions & 4 deletions Makefile.d/proto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ proto/deps: \
$(GOPATH)/src/github.com/planetscale/vtprotobuf \
$(GOPATH)/src/github.com/protocolbuffers/protobuf \
$(GOPATH)/src/google.golang.org/genproto \
$(GOPATH)/src/google.golang.org/protobuf \
$(ROOTDIR)/apis/proto/v1/rpc/error_details.proto
$(GOPATH)/src/google.golang.org/protobuf

.PHONY: proto/clean/deps
## uninstall all protobuf dependencies
Expand All @@ -79,8 +78,7 @@ proto/clean/deps:
$(GOPATH)/src/github.com/planetscale/vtprotobuf \
$(GOPATH)/src/github.com/protocolbuffers/protobuf \
$(GOPATH)/src/google.golang.org/genproto \
$(GOPATH)/src/google.golang.org/protobuf \
$(ROOTDIR)/apis/proto/v1/rpc/error_details.proto
$(GOPATH)/src/google.golang.org/protobuf


$(GOPATH)/src/github.com/protocolbuffers/protobuf:
Expand Down
3 changes: 2 additions & 1 deletion dockers/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ RUN make deps \
# additional deps
RUN make k3d/install \
&& make buf/install \
&& make k9s/install
&& make k9s/install \
&& make minikube/install

0 comments on commit 248a82a

Please sign in to comment.