Skip to content

Improve developer experience on local environment #6152

@linhdangduy

Description

@linhdangduy

Problem

I'm getting familiar and exploring the code base of the project. I build and run the project by the guidance in https://github.com/pipe-cd/pipecd/blob/master/CONTRIBUTING.md page.
Every time I make change to frontend (web/) or backend source code (pkg), I have to execute make run/pipecd again to bring the changes to the local kind cluster to see the change on running program.

The problem is make run/pipecd takes very longgg time to be completed. It hinders the development process and I could not do many experiments as I wished.

How should the development process be?

  1. For frontend development, developer usually want to see the changes reflected as soon as possible.
    Webpack provide Hot Module Replacement (HRM) by default, where change in source code is reflected immediately, so we don't have to execute make run/pipecd again. We should utilize this feature to speed up frontend development. -> Refer to web/README guidance in CONTRIBUTING for faster local web development #6226

  2. For backend development, I haven't yet come up with the proper way to apply hot reloading for the Go web server with current local development structure.
    But there could be several improvements for make run/pipecd so that it can be completed faster, helping us to see the result of code changes faster on pipecd program (like add dockerignore file, decrease the build step if possible): Improve make run/pipecd execution speed #6184

  3. For backend, I have created piped properly, have the applications run, all good...but after I shutdown the kind cluster (for example: make stop/pipecd), all local data is gone and I have to create it all over again -> we need to persisted the local data to local folder, so developer does not have to create piped, application... again when they execute make stop/pipecd or make kind-down even restart her computer: Keep pipecd server data even when developer shut down pipecd or kind on local computer #6192

Question

Do you have the same experience as the problem I described above?

  • If yes, I'm happy to raise the PR. I did PoC and verified behavior on my local.
  • If you have your own setup to speed it up, please share in this issue so we can further improve the local development.

Some thoughts / The approaches that I have explored

On frontend development, originally, I tried mounting the local web/static folder into the web/static folder used by pipecd web service, so after making some changes, we can just execute make build/web to reflect the change and don't need make run/pipecd. But I found that we can try HRM as described above.

Beside that, I did try to understand the deployment structures / infra we are using for local. The nice point is the whole setup (kind / helm chart / gateway ...) seems similar with what we use for running on stg / prod environment, but I feel that somehow it is quite complicate for local development. Then I tried to simplify the setup on local so we can have more straightforward code hot reloading for both frontend and backend (using Air for example!?), but I have not come up with the any promising solution.
(Now I'm ok to use the current local deployment structure, it is helpful for understanding how the whole service is run.)

Metadata

Metadata

Assignees

Labels

contribexImprove contributor experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions