Skip to content

Commit cd5a93a

Browse files
committed
Merge pull request #5 from Clever/INFRA-1563-update-documentation
Updated README.
2 parents 45c66c3 + bbf241a commit cd5a93a

1 file changed

Lines changed: 20 additions & 17 deletions

File tree

README.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# discovery-python
22

3-
Programmatically find service endpoints.
3+
This library programmatically finds endpoints for dependencies. Similar to [discovery-go](https://github.com/Clever/discovery-go) and [disocvery-node](https://github.com/Clever/discovery-node).
44

5-
This library currently is just an abstraction around reading environment variables used for dependent services.
5+
See [Service Discovery](https://github.com/Clever/infra-docs/blob/master/deploy/service_discovery.md) for more details.
66

77
## Installation
88

@@ -55,21 +55,6 @@ except discovery.MissingEnvironmentVariableError as e:
5555

5656
```
5757

58-
## Environment Variables
59-
60-
This library currently requires environment variables to be defined in the following format:
61-
62-
```
63-
SERVICE_{SERVICE_NAME}_{EXPOSE}_{PROTO|HOST|PORT}
64-
```
65-
66-
### Example:
67-
```bash
68-
SERVICE_STOKED_THRIFT_PROTO = "tcp"
69-
SERVICE_STOKED_THRIFT_HOST = "localhost"
70-
SERVICE_STOKED_THRIFT_PORT = "90"
71-
```
72-
7358
## Development
7459

7560
### Publishing a new version
@@ -82,3 +67,21 @@ SERVICE_STOKED_THRIFT_PORT = "90"
8267
```sh
8368
./publish.sh
8469
```
70+
71+
### Implementation Details
72+
73+
Currently, `discovery-{go,node,python}` looks for environment variables with the following format:
74+
75+
```
76+
SERVICE_{SERVICE_NAME}_{EXPOSE_NAME}_{PROTO,HOST,PORT}
77+
```
78+
79+
These environment variables are autogenerated by [fab](http://github.com/Clever/fabulaws) and [catapult](http://github.com/Clever/catapult) during app deployment. Three env-vars are created for each app listed in the `dependencies` section of caller's launch yaml.
80+
81+
For example, if an app lists `district-authorizations` as a dependency, fab and catapult will generate this env-vars triplet:
82+
83+
```bash
84+
SERVICE_DISTRICT_AUTHORIZATIONS_HTTP_PROTO = "http"
85+
SERVICE_DISTRICT_AUTHORIZATIONS_HTTP_HOST = "district-authorizations.ops.clever.com"
86+
SERVICE_DISTRICT_AUTHORIZATIONS_HTTP_PORT = "80"
87+
```

0 commit comments

Comments
 (0)