-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(dev): Add Flox for local environment setup #26805
Conversation
Size Change: 0 B Total Size: 1.11 MB ℹ️ View Unchanged
|
65cd4a9
to
5e44092
Compare
@@ -20,4 +25,4 @@ python manage.py run_async_migrations --complete-noop-migrations | |||
# k8s pod deployments. | |||
python manage.py run_async_migrations --check | |||
|
|||
python manage.py sync_replicated_schema | |||
wait $(jobs -p) # Make sure CH migrations are done before we exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log message letting us know what we're doing would be helpful, otherwise it might feel like we're stuck
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still get CH migration logs as migrations progress, so there shouldn't be that feeling – have you seen otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 (didnt test it myself, looks good)
Oops, you can remove lines |
We should probably post about this in Slack and update the Developing Locally doc. I ran into an issue this morning because I didn't have |
Oh, right, the switch to |
Fix here: #27052 |
Out of curiosity, why not also specify |
Problem
To get started developing PostHog, you have to install an array of dependencies with the correct versions, running a dozen of commands from the Developing locally guide. And then
xmlsec
ruins your day anyway. What if it took just one command to install all the right components with actual version control of the environment, without relying on janky system-wide deps?Changes
Flox (
brew install flox
) is a take on this problem – specifically, a dev environment manager backed by Nix. As opposed to Homebrew, Nix has real versioning (xmlsec
issues begone).This PR adds a Flox manifest for the PostHog local environment, which turns basically the whole "Developing locally" guide into these few steps:
brew install flox ruff rustup && rustup-init && rustup default stable
– to install the only system-level dependencies needed:flox
itself,ruff
for Python pre-commit checks,cargo
viarustup
for Rust checks:flox activate
That's it actually. This gets you a full-fledged environment under
.flox/
in the repository directory's, with everything needed to run and develop PostHog. Once done, you'll see instructions for migrations and running the app.On the first activation you'll also be prompted if you'd like the environment to be activated automatically.
As a bonus, this PR replaces the old
bin/start
withbin/start-mprocs
, by popular demand.