Feature: Run `sls dynamodb start` in detached mode
See original GitHub issueIssue Description
For CI testing, one would need to run sls dynamodb start
asynchronously, because the command blocks the current shell.
Workaround 1: sls dynamodb start &
This runs it in the background, but does not wait until the db is set up properly.
Workaround 2: sls dynamodb start & sleep 5
This works, but might introduce race conditions.
Suggestion:
How about: sls dynamodb start --detached
which runs synchronously until all work is done, exits the process (the shell command is finished), but continues serving the database in the background.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:30
- Comments:6
Top Results From Across the Web
Feature: Run sls dynamodb start in detached mode #106
For CI testing, one would need to run sls dynamodb start asynchronously, because the command blocks the current shell.
Read more >Serverless Dynamodb Local Plugin
Start : sls dynamodb start. This starts the DynamoDB Local instance, either as a local Java program or, if the --docker flag is...
Read more >Serverless Dynamodb Local Unit Testing - Engineering at 99x
Now let's install the dynamodb local and run it on port 3000 in detached mode. - sls dynamodb install. - sls dynamodb start...
Read more >How to run DynamoDB Local and Offline - Complete Guide
Run docker-compose up -d . You can skip -d flag if you don't want to run in in the "detached" mode. Using Java....
Read more >Containerizing Serverless APIs. Use Docker, LocalStack and ...
Run the docker-compose.yml file with, docker-compose up -d , which should create two containers and start them detached in the background.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/doapp-ryanp/dynamodb-local/pull/19 I managed to find the very base NPM package of this build, and got it to run in detached mode (albeit with async wrapping).
As such, this should be possible for the serverless plugin to work in this way.
Ideally I want to run in my DevOps pipeline:
sls dynamodb start --seed=test --detached
which would just start the whole database (potentially writing the child object, or child pid) to a temp file. And kill the whole thing with
sls dynamodb stop
. Even if this requires under the hood asyncing.This is heavily blocking proper CI/CD & DevOps usage of the whole tool tbh.
Nobody in their right mind can go into a pipeline and say: “run all this, then do your test, oh and then press ctrl+c when you’re done”. It is an underlying issue with
dynamodb-localhost
anddynamodb-local
which this plugin straight up uses, copies, and adds bit of functionality to.Ideally I wish to be able to dive into my npm script, start the database detached, run my tests, kill the database.