Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial implementation of microvm create #98

Merged
merged 2 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ linters-settings:
go: "1.16"
stylecheck:
go: "1.16"
cyclop:
max-complexity: 12
skip-tests: true

linters:
enable-all: true
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ PROTOC_GEN_GO := $(TOOLS_BIN_DIR)/protoc-gen-go
PROTOC_GEN_GO_GRPC := $(TOOLS_BIN_DIR)/protoc-gen-go-grpc
PROTO_GEN_GRPC_GW := $(TOOLS_BIN_DIR)/protoc-gen-grpc-gateway
PROTO_GEN_GRPC_OAPI := $(TOOLS_BIN_DIR)/protoc-gen-openapiv2
WIRE := $(TOOLS_BIN_DIR)/wire

.DEFAULT_GOAL := help

Expand All @@ -57,6 +58,7 @@ generate: $(BUF) $(MOCKGEN) ## Generate code
generate: ## Generate code
$(MAKE) generate-go
$(MAKE) generate-proto
$(MAKE) generate-di

.PHONY: generate-go
generate-go: $(MOCKGEN) ## Generate Go Code
Expand All @@ -65,7 +67,11 @@ generate-go: $(MOCKGEN) ## Generate Go Code
.PHONY: generate-proto ## Generate protobuf/grpc code
generate-proto: $(BUF) $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_GRPC) $(PROTO_GEN_GRPC_GW) $(PROTO_GEN_GRPC_OAPI)
$(BUF) generate


.PHONY: generate-di ## Generate the dependency injection code
generate-di: $(WIRE)
$(WIRE) gen github.com/weaveworks/reignite/internal/inject

##@ Linting

.PHONY: lint
Expand Down Expand Up @@ -114,6 +120,9 @@ $(PROTO_GEN_GRPC_GW): $(TOOLS_DIR)/go.mod
$(PROTO_GEN_GRPC_OAPI): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go build -tags=tools -o $(subst hack/tools/,,$@) github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2

$(WIRE): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go build -tags=tools -o $(subst hack/tools/,,$@) github.com/google/wire/cmd/wire

BUF_TARGET := buf-Linux-x86_64.tar.gz

ifeq ($(OS), darwin)
Expand Down
44 changes: 24 additions & 20 deletions api/services/microvm/v1alpha1/microvms.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 9 additions & 35 deletions api/services/microvm/v1alpha1/microvms.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions api/services/microvm/v1alpha1/microvms.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ option go_package = "github.com/weaveworks/reignite/api/services/microvm/v1alpha

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "Reignite MicroVM API",
version: "0.1";
description: "The Reignite MicroVM API handles operations for provisioning and managing microvms";
};
consumes: "application/json";
produces: "application/json";
title: "Reignite MicroVM API"
version: "0.1"
description: "The Reignite MicroVM API handles operations for provisioning and managing microvms"
}
consumes: "application/json"
produces: "application/json"
};

// MicroVM providers a service to create and manage the lifecycle of microvms.
Expand Down
Loading