copilot-cli
copilot-cli copied to clipboard
Running Copilot locally
As a developer, it would be great for me if I can test my application locally using Copilot. Maybe we could do it via local docker? I'm imagining something like an RDS Postgres being automatically turned into a docker Postgres image (perhaps with some metadata needed to translate RDS version to docker image tag).
+1 Copilot adds a lot of "magic" but still requires some manual work to integrate, which causes issues using it. I hope any resource managed by copilot (especially DynamoDB, SNS, etc) can be run/emulated locally without extra configuration.
The kind of use-case I have is that I want to run one of the services in my application locally and want it to be able to talk to another service (maybe a private backend service) running on ECS fargate. This would make it very easy to test out a single service without having to set everything up locally. In kubernetes world, this would work with a simple port forward. Would be nice to have something like that for copilot unless there's a better solution.
It seems that without some sort of local emulation, it's difficult to test the actual behavior of the application as a whole.
For example, a complex application with SNS/SQS publishing between various services seems like it would be difficult to test locally and would require deployment to actually test. At best, it would be possible to unit test the individual consumers, but integration testing of an end-to-end flow would only be possible by deploying.
Is this correct?
Hey @CharlieDigital! You're correct - it is difficult to fully test an application that depends on other services without deploying the whole set of services.
In addition to mocking dependencies, I usually set up a beta or test environment to test an application. That way, if I'm working on changes to one service in an application, I don't have to deploy everything to test my changes and can just deploy the service I'm working on. It's definitely not a perfect though - iteration time is kinda slow and it's hard to have multiple people testing different changes at the same time.
This project could potentially help with your SNS/SQS example: https://github.com/softwaremill/elasticmq. (I haven't tried it though 😊)
@dannyrandall iteration time is really key, IMO.
I am already using LocalStack for emulation of SQS/SNS; but that's really only just one part of the picture; bigger part is integration with Copilot CLI. On some level, I get it that the CLI and the whole Copilot project is really focused on deployment and AWS infrastructure abstraction, but having a strategy for testing locally as part of that toolset would be a big boon.
Would be nice if it were possible to bring up a functional local replica of the workflow in one command like copilot app local that would use local docker and other emulation to bring up a local runtime.
Hey everyone! We've made a first step towards some of the workflows mentioned in this issue with copilot run local, just released in v1.30.0!
We have a roadmap of planned enhancements for the command here: https://github.com/aws/copilot-cli/discussions/5263! Give copilot run local a try and share your feedback & ideas with us there!