Files
fn-serverless/docs/options.md
C Cirello 9d06b6e687 functions: common concurrency stream for sync and async (#314)
* functions: add bounded concurrency

* functions: plug runners to sync and async interfaces

* functions: update documentation about the new env var

* functions: fix test flakiness

* functions: the runner is self-regulated, no need to set a number of runners

* functions: push the execution to the background on incoming requests

* functions: ensure async tasks are always on

* functions: add prioritization to tasks consumption

Ensure that Sync tasks are consumed before Async tasks. Also, fixes
termination races problems for free.

* functions: remove stale comments

* functions: improve mem availability calculation

* functions: parallel run for async tasks

* functions: check for memory availability before pulling async task

* functions: comment about rnr.hasAvailableMemory and sync.Cond

* functions: implement memory check for async runners using Cond vars

* functions: code grooming

- remove unnecessary goroutines
- fix stale docs
- reorganize import group

* Revert "functions: implement memory check for async runners using Cond vars"

This reverts commit 922e64032201a177c03ce6a46240925e3d35430d.

* Revert "functions: comment about rnr.hasAvailableMemory and sync.Cond"

This reverts commit 49ad7d52d341f12da9603b1a1df9d145871f0e0a.

* functions: set a minimum memory availability for sync

* functions: simplify the implementation by removing the priority queue

* functions: code grooming

- code deduplication
- review waitgroups Waits
2016-11-18 18:23:26 +01:00

2.2 KiB

IronFunctions Runtime Options

Configuration

When starting IronFunctions, you can pass in the following configuration variables as environment variables. Use -e VAR_NAME=VALUE in docker run. For example:

docker run -e VAR_NAME=VALUE ...
Env Variables Description
DB_URL The database URL to use in URL format. See [Databases](databases/README.md) for more information. Default: BoltDB in current working directory `bolt.db`.
MQ_URL The message queue to use in URL format. See [Message Queues](mqs/README.md) for more information. Default: BoltDB in current working directory `queue.db`.
API_URL The primary IronFunctions API URL to that this instance will talk to. In a production environment, this would be your load balancer URL.
PORT Sets the port to run on. Default: `8080`.
LOG_LEVEL Set to `DEBUG` to enable debugging. Default: INFO.

Starting without Docker in Docker

The default way to run IronFunctions, as it is in the Quickstart guide, is to use docker-in-docker (dind). There are a couple reasons why we did it this way:

  • It's clean. Once the container exits, there is nothing left behind including all the function images.
  • You can set resource restrictions for the entire IronFunctions instance. For instance, you can set --memory on the docker run command to set the max memory for the IronFunctions instance AND all of the functions it's running.

There are some reasons you may not want to use dind, such as using the image cache during testing or you're running Windows.

Mount the Host Docker

One way is to mount the host Docker. Everything is essentially the same except you add a -v flag:

docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/data:/app/data -p 8080:8080 iron/functions

Run outside Docker

You can of course just run the binary directly, you'll just have to change how you set the environment variables above.

See contributing doc for information on how to build and run.