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

chore: add mprocs as an alternative to bin/start #26624

Merged
merged 5 commits into from
Dec 9, 2024
Merged

Conversation

andehen
Copy link
Contributor

@andehen andehen commented Dec 3, 2024

Problem

Separate dev processes. Make it easy to see logs separately and restart stuff separately.

mprocs is a nice tool for this. You can install it with brew install mprocs

With these changes, you can run ./bin/start-mprocs and get this

Screenshot 2024-12-06 at 14 02 53

Changes

Add mprocs.yaml and a wrapper script to run mprocs with default env vars.
Just added stuff, nothing existing has been changed.

@andehen andehen changed the title (feat): add mprocs as an alternative to bin/start chore: add mprocs as an alternative to bin/start Dec 3, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024

Size Change: 0 B

Total Size: 1.11 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.11 MB

compressed-size-action

@andehen andehen marked this pull request as ready for review December 6, 2024 12:39
Copy link
Contributor

@danielbachhuber danielbachhuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fancy! Seems to work well:

CleanShot 2024-12-06 at 04 48 00@2x

In fact, a common use case for me is to stop the backend server from running so I can run it inside of Cursor with the debugger:

diff --git a/bin/start b/bin/start
index 171656ed0e..239f7ffd82 100755
--- a/bin/start
+++ b/bin/start
@@ -19,7 +19,7 @@ curl -s 'http://localhost:8123/ping' || ( service_warning 'ClickHouse'; bin/chec
 [ ! -f ./share/GeoLite2-City.mmdb ] && ( curl -L "https://mmdbcdn.posthog.net/" --http1.1 | brotli --decompress --output=./share/GeoLite2-City.mmdb )
 
 ./bin/start-worker &
-./bin/start-backend &
+# ./bin/start-backend &
 ./bin/start-frontend &
 ./bin/temporal-django-worker &
 

Looks like I can easily stop the process in mproc instead 😁

CleanShot 2024-12-06 at 04 52 38@2x

@danielbachhuber
Copy link
Contributor

It'd be worth documenting this in https://posthog.com/handbook/engineering/developing-locally

@andehen
Copy link
Contributor Author

andehen commented Dec 6, 2024

It'd be worth documenting this in https://posthog.com/handbook/engineering/developing-locally

thanks for the reminder! i'll open a PR for that as well

@andehen andehen merged commit df20817 into master Dec 9, 2024
94 checks passed
@andehen andehen deleted the add-mprocs-config branch December 9, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants