Skip to content

Commit

Permalink
Update all documentation to use YAML for the config file.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryszard committed Mar 6, 2016
1 parent 8143617 commit 77ef752
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 20 deletions.
4 changes: 2 additions & 2 deletions doc/loadtest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ doorman-server-le54r 1/1 Running 0 15s
This is running the Doorman server with a command line like this:

```console
doorman -logtostderr -port=3667 -debug_port=3668 -config=./config.prototext
doorman -logtostderr -port=3667 -debug_port=3668 -config=./config.yml
```

Let's take a look at its logs to verify everything is fine:
Expand Down Expand Up @@ -362,7 +362,7 @@ What happens with the number of requests the server is doing? How about the QPS

### Different Algorithms

Experiment with different capacity distribution algorithms. Edit [`config.protext`](docker/server/config.prototext) to use the [FAIR_SHARE](../algorithms.md#fair_share) algorithm. Does it have any effect on the metrics?
Experiment with different capacity distribution algorithms. Edit [`config.yml`](docker/server/config.yml) to use the [FAIR_SHARE](../algorithms.md#fair_share) algorithm. Does it have any effect on the metrics?

### High Availability

Expand Down
2 changes: 1 addition & 1 deletion doc/loadtest/docker/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM golang:1.5
ADD config.prototext .
ADD config.yml .
RUN go get github.com/youtube/doorman/go/cmd/doorman
3 changes: 0 additions & 3 deletions doc/loadtest/docker/server/config.prototext

This file was deleted.

25 changes: 25 additions & 0 deletions doc/loadtest/docker/server/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
resources:
- identifier_glob: "proportional"
capacity: 5000
safe_capacity: 10
description: "proportional example"
algorithm:
kind: PROPORTIONAL_SHARE
lease_length: 60
refresh_interval: 15
- identifier_glob: "fair"
capacity: 5000
safe_capacity: 10
description: "fair share example"
algorithm:
kind: FAIR_SHARE
lease_length: 60
refresh_interval: 15
- identifier_glob: "*"
capacity: 1000
safe_capacity: 10
description: "test"
algorithm:
kind: FAIR_SHARE
lease_length: 60
refresh_interval: 15
2 changes: 1 addition & 1 deletion doc/loadtest/k8s/doorman-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
containers:
- name: doorman-server
image: gcr.io/google.com/doorman/doorman-server:v0.1.7
command: ["doorman", "-logtostderr", "-port=3667", "-debug_port=3668", "-config=./config.prototext"]
command: ["doorman", "-logtostderr", "-port=3667", "-debug_port=3668", "-config=./config.yml"]
resources:
limits:
cpu: 0.8
Expand Down
2 changes: 1 addition & 1 deletion doc/simplecluster/Procfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
etcd: etcd --data-dir /tmp/etcd.data$PORT
doorman: $GOPATH/bin/doorman -logtostderr -config=./config.prototext -port=$PORT -debug_port=$(expr $PORT + 50) -etcd_endpoints=http://localhost:2379 -master_election_lock=/doorman.master -hostname=localhost
doorman: $GOPATH/bin/doorman -logtostderr -config=./config.yml -port=$PORT -debug_port=$(expr $PORT + 50) -etcd_endpoints=http://localhost:2379 -master_election_lock=/doorman.master -hostname=localhost

2 changes: 1 addition & 1 deletion doc/simplecluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ go get github.com/youtube/doorman/go/cmd/doorman

## Preparing the configuration

Doorman's configuration file uses the protobuf text format. [config.prototext](config.prototext) sets up 2 resources:
Doorman's configuration file uses the YAML format. [config.yml](config.yml) sets up 2 resources:

+ `proportional`, which uses the [PROPORTIONAL_SHARE](../algorithms.md#proportional_share) algorithm, with capacity 100.
+ `fair`, which uses the [FAIR_SHARE](../algorithms.md#fair_share) algorithm, with capacity 400.
Expand Down
3 changes: 0 additions & 3 deletions doc/simplecluster/config.prototext

This file was deleted.

25 changes: 25 additions & 0 deletions doc/simplecluster/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
resources:
- identifier_glob: proportional
capacity: 100
safe_capacity: 10
description: proportional example
algorithm:
kind: PROPORTIONAL_SHARE
lease_length: 15
refresh_interval: 5
- identifier_glob: fair
capacity: 1000
safe_capacity: 10
description: fair share example
algorithm:
kind: FAIR_SHARE
lease_length: 15
refresh_interval: 5
- identifier_glob: "*"
capacity: 1000
safe_capacity: 10
description: default
algorithm:
kind: FAIR_SHARE
lease_length: 60
refresh_interval: 15
16 changes: 8 additions & 8 deletions go/configuration/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ func TestParseSource(t *testing.T) {
text, path, kind string
}{
{
text: "config.prototext",
text: "config.yml",
kind: "file",
path: "config.prototext",
path: "config.yml",
},
{
text: "file:config.prototext",
text: "file:config.yml",
kind: "file",
path: "config.prototext",
path: "config.yml",
},
{
text: "colons:in:name:good:idea:config.prototext",
text: "colons:in:name:good:idea:config.yml",
kind: "file",
path: "colons:in:name:good:idea:config.prototext",
path: "colons:in:name:good:idea:config.yml",
},
{
text: "etcd:/config.prototext",
text: "etcd:/config.yml",
kind: "etcd",
path: "/config.prototext",
path: "/config.yml",
},
} {
kind, path := ParseSource(c.text)
Expand Down

0 comments on commit 77ef752

Please sign in to comment.