Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
docs: add env vars explain
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Sep 26, 2019
1 parent 086a73c commit 9ad7448
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
40 changes: 40 additions & 0 deletions docs/chapter/enviromentvars.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Environment Variables

There are couple of environment variables that GNES respect during runtime.

## `GNES_PROFILING`

Set to any non-empty string to turn on service-level time profiling for GNES.

Default is disabled.

## `GNES_PROFILING_MEM`

Set to any non-empty string to turn on service-level memory profiling for GNES. Warning, memory profiling could hurt the efficiency significantly.

Default is disabled.

## `GNES_WARN_UNNAMED_COMPONENT`

Set to `0` to turn off the warning like `this object is not named ("name" is not found under "gnes_config" in YAML config), i will call it "BaseRouter-51ce94cc". naming the object is important as it provides an unique identifier when serializing/deserializing this object.`

Set to `1` to enable it.

Default is enabled.

## `GNES_VCS_VERSION`

Git version of GNES. This is used when `--check_version` is turned on. For GNES official docker image, `GNES_VCS_VERSION` is automatically set to the git version during the building procedure.

Default is the git head version when building docker image. Otherwise it is not set.

## `GNES_CONTROL_PORT`

Control port of the microservice. Useful when doing health check via `gnes healthcheck`.

Default is not set. A random port will be used.

## `GNES_CONTRIB_MODULE`

(*depreciated*) Paths of the third party components. See examples in GNES hub for latest usage.

1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Highlights

chapter/troubleshooting.md
chapter/protobuf-dev.md
chapter/enviromentvars.md

.. toctree::
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion tests/test_healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_health_check(self):
self.assertEqual(cm.exception.code, 1)

def test_hc_os_env(self):
os.environ.setdefault('GNES_CONTROL_PORT', str(56789))
os.environ['GNES_CONTROL_PORT'] = str(56789)
a = set_router_parser().parse_args([
'--yaml_path', 'BaseRouter',
])
Expand Down

0 comments on commit 9ad7448

Please sign in to comment.