question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature: Run `sls dynamodb start` in detached mode

See original GitHub issue

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:open
  • Created 6 years ago
  • Reactions:30
  • Comments:6

github_iconTop GitHub Comments

5reactions
mathieudevoscommented, Apr 4, 2018

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.

3reactions
mathieudevoscommented, Apr 4, 2018

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 and dynamodb-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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found