opensergo / opensergo-control-plane

Universal cloud-native microservice governance control plane (微服务治理控制面)
Apache License 2.0
35 stars 23 forks source link

Add Makefile (#9) #22

Closed joaoepj closed 1 year ago

joaoepj commented 1 year ago

Fixes #9

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

joaoepj commented 1 year ago

Just found a more complete Makefile in the develop branch. Should we use this instead?

jnan806 commented 1 year ago

That's OK ~ And there are some commands is not needed at this time in the Makefile of develop branch, You can ignore them by delete or comment. And also should verify the availability of commands you picked.

joaoepj commented 1 year ago

I have reviewed both Makefiles. Most of the develop branch recipes perform tasks like usage help, code generation, docker resource management, as well as compiling go code. As this tasks are now executed by other tools I kept my branch's Makefile as simple as possible.

jnan806 commented 1 year ago

em.... In the relation ISSUE, commands for generating CRD and proto stub cod is required :joy: , could you help to complete the commands please ?

joaoepj commented 1 year ago

em.... In the relation ISSUE, commands for generating CRD and proto stub cod is required 😂 , could you help to complete the commands please ?

Well, I sure can! But I need to acquire a more comprehensive view of the whole CI/CD process. I'll do my home work but, can you give some advice in this sense?

jnan806 commented 1 year ago

the whole CI/CD process? the CRD means Custom Resource Definition in kubernetes, I think your understanding of CRD is biased

joaoepj commented 1 year ago

This Makefile is automatically generated by operator-sdk and only care about k8s operator aspects.

joaoepj commented 1 year ago

@jnan806 , @sczyh30 I reached a point that k8s operator automatically generate its own Makefile, and grpc/protobuf needs another Makefile. In order accomodate both maybe the project folder structure should change. But I'm not in position to propose/foresee such changes. Are you willing to review this contribution? Or should I abandon it?

jnan806 commented 1 year ago

In order accomodate both maybe the project folder structure should change. But I'm not in position to propose/foresee such changes. Are you willing to review this contribution? Or should I abandon it?

The Makefile generated by operator-sdk is a template for universal project, not for all projects. Every project can modify it by self to adjust the actual demands in project. So I think we can accomodate both by modify the generated Makefile template according to project.

joaoepj commented 1 year ago

@jnan806, @sczyh30

Now, typing make help the Makefile outputs additional recipes:

protoc Download protoc locally if necessary. proto Generate protobuf/gRPC interface code proto-gen-go Download proto-gen-go locally if necessary. proto-gen-go-grpc Download proto-gen-go locally if necessary.

make proto installs protoc, proto-gen-go and proto-gen-go-grpc and generates protobuf code.

joaoepj commented 1 year ago

@jnan806, Can you review my humble contribution? I would appreciate! 謝謝