Page MenuHomePhabricator

[Nix] Add easy way to start/stop localstack
ClosedPublic

Authored by jon on Jan 23 2023, 10:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 4:25 AM
Unknown Object (File)
Sun, Nov 10, 4:25 AM
Unknown Object (File)
Sat, Nov 9, 12:00 PM
Unknown Object (File)
Tue, Nov 5, 2:09 AM
Unknown Object (File)
Thu, Oct 24, 5:36 AM
Unknown Object (File)
Sun, Oct 20, 9:03 PM
Unknown Object (File)
Oct 6 2024, 5:06 PM
Unknown Object (File)
Oct 2 2024, 7:22 PM
Subscribers

Details

Summary

Allow for services needed to do service integration
tests to be easily started and stopped using nix.

https://linear.app/comm/issue/ENG-1697

Test Plan

Unfortunately, cannot do a test workflow as we hardcode services
using docker-compose domains (e.g. https://github.com/CommE2E/comm/blob/master/services/blob/src/constants.rs#L5)

To test that the script is running:

nix develop

comm-dev services stop # ensure rabbitmq and localstack are stopped

pgrep beam.smp # should be empty
docker ps | localstack # should be empty

comm-dev services start # should emit some rabbitmq info
comm-dev services start # should be no-op

pgrep beam.smp # should show a PID
docker ps | localstack # should show a running container

comm-dev services stop # cleanup rabbitmq and localstack

pgrep beam.smp # should be empty
docker ps | localstack # should be empty

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Wow, I wasn't even aware of the comm-dev services command, nice! I used to run nix run .#localstack-up directly

Idea:
I still prefer to use cd services && yarn init-local-cloud or yarn reset-local-cloud instead of the Nix one because these yarn commands also run Terraform to set up the infra. But of course, this is unrelated to this particular diff

scripts/comm-dev.sh
29–30

These would also need to be updated

This revision is now accepted and ready to land.Jan 23 2023, 11:17 PM
jon added inline comments.
scripts/comm-dev.sh
29–30

Knew it was too easy

This revision was automatically updated to reflect the committed changes.
jon marked an inline comment as done.