Skip to content

Support --extra_args parameter in dev/run#2183

Merged
iilyak merged 1 commit intoapache:masterfrom
cloudant:add-extra-arguments-to-beam
Sep 10, 2019
Merged

Support --extra_args parameter in dev/run#2183
iilyak merged 1 commit intoapache:masterfrom
cloudant:add-extra-arguments-to-beam

Conversation

@iilyak
Copy link
Contributor

@iilyak iilyak commented Sep 10, 2019

Overview

Sometimes there is a need to specify additional arguments for the beam process we start from dev/run.
In particular the feature is handy for:

  • changing emulator flags
  • simulate OOM via available RAM restrictions
  • enable module loading tracing
  • configure number of schedulers
  • modify applications configuration
  • run customization script to add extra development deps (such as automatic code reload)

Historically developers had to edit dev/run to do it.
This PR adds an ability to specify additional arguments via --extra_args argument.

In order to run customization script create customization.erl which exports start/0 and run it using:

dev/run --extra_args='-run customization'

Testing recommendations

  1. Create dev/customization.erl with the following content:
    -module(customization).
    
    -export([start/0]).
    
    start() ->
      error_logger:info_msg("CUSTOMIZATION!!!~n").
    
  2. run dev/run --extra_args='-run customization'
  3. check logs and verify there is a line similar to the following
    [info] 2019-09-10T12:17:00.828103Z node1@127.0.0.1 <0.5.0> -------- CUSTOMIZATION!!!
    

Related Issues or Pull Requests

Checklist

  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation

@iilyak iilyak force-pushed the add-extra-arguments-to-beam branch 2 times, most recently from 65c2b5e to 57ec2f5 Compare September 10, 2019 13:10
Sometimes there is a need to specify additional arguments for the beam process we start from dev/run.
In particular the feature is handy for:
- changing emulator flags
- simulate OOM via available RAM restrictions
- enable module loading tracing
- configure number of schedulers
- modify applications configuration
- run customization script to add extra development deps (such as automatic code reload)

Historically developers had to edit dev/run to do it.
This PR adds an ability to specify additional arguments via `--extra_args` argument.

In order to run customization script create `customization.erl` which exports `start/0` and run it using:
```
dev/run --extra_args='-run customization'
```
@iilyak iilyak force-pushed the add-extra-arguments-to-beam branch from 57ec2f5 to dd5ac13 Compare September 10, 2019 15:59
@iilyak iilyak merged commit e746d90 into apache:master Sep 10, 2019
@iilyak iilyak deleted the add-extra-arguments-to-beam branch September 10, 2019 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants