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
F3500567: D6352.id21220.diff
Fri, Dec 20, 1:59 AM
Unknown Object (File)
Sun, Dec 15, 1:57 AM
Unknown Object (File)
Sun, Dec 15, 1:57 AM
Unknown Object (File)
Sun, Dec 15, 1:57 AM
Unknown Object (File)
Sun, Dec 15, 1:54 AM
Unknown Object (File)
Sun, Dec 15, 1:29 AM
Unknown Object (File)
Nov 18 2024, 2:08 PM
Unknown Object (File)
Nov 18 2024, 10:43 AM
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.