Skip to content

Commit 76b2481

Browse files
authored
Merge pull request #210 from arangodb-helper/feature/license-key
Add a passthrough for the license key in an env variable.
2 parents b12e369 + eee32eb commit 76b2481

20 files changed

+121
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# ArangoDB Starter Changelog
22

3-
## Changes from version 0.13.9 to master
3+
## Changes from 0.13.10 to master
44

55

6+
## Changes from version 0.13.9 to 0.13.10
7+
8+
- Implement that in Docker mode the ArangoDB license key is passed on
9+
to sub-containers.
10+
611
## Changes from version 0.13.8 to 0.13.9
712

813
- Fix finding the storage engine if the master does not run a dbserver.

docs/Manual/Deployment/ActiveFailover/UsingTheStarter.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,20 @@ The _Starter_ will decide on which 2 machines to run a single server instance.
6767
To override this decision (only valid while bootstrapping), add a
6868
`--cluster.start-single=false` to the machine where the single server
6969
instance should _not_ be started.
70+
71+
If you use an ArangoDB version of 3.4 or above and use the Enterprise
72+
Edition Docker image, you have to set the license key in an environment
73+
variable by adding this option to the above `docker` command:
74+
75+
```
76+
-e ARANGO_LICENSE_KEY=<thekey>
77+
```
78+
79+
You can get a free evaluation license key by visiting
80+
81+
https://www.arangodb.com/download-arangodb-enterprise/
82+
83+
Then replace `<thekey>` above with the actual license key. The start
84+
will then hand on the license key to the Docker containers it launches
85+
for ArangoDB.
86+

docs/Manual/Deployment/Cluster/UsingTheStarter.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,22 @@ docker run -it --name=adb --rm -p 8528:8528 \
5353

5454
Run the above command on machine A, B & C.
5555

56+
If you use an ArangoDB version of 3.4 or above and use the Enterprise
57+
Edition Docker image, you have to set the license key in an environment
58+
variable by adding this option to the above `docker` command:
59+
60+
```
61+
-e ARANGO_LICENSE_KEY=<thekey>
62+
```
63+
64+
You can get a free evaluation license key by visiting
65+
66+
https://www.arangodb.com/download-arangodb-enterprise/
67+
68+
Then replace `<thekey>` above with the actual license key. The start
69+
will then hand on the license key to the Docker containers it launches
70+
for ArangoDB.
71+
5672
Under the Hood
5773
--------------
5874
The first `arangodb` you ran will become the _master_ of your _Starter_

docs/Manual/Deployment/SingleInstance/UsingTheStarter.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,19 @@ docker run -it --name=adb --rm -p 8528:8528 \
3030
--starter.address=$IP \
3131
--starter.mode=single
3232
```
33+
34+
If you use an ArangoDB version of 3.4 or above and use the Enterprise
35+
Edition Docker image, you have to set the license key in an environment
36+
variable by adding this option to the above `docker` command:
37+
38+
```
39+
-e ARANGO_LICENSE_KEY=<thekey>
40+
```
41+
42+
You can get a free evaluation license key by visiting
43+
44+
https://www.arangodb.com/download-arangodb-enterprise/
45+
46+
Then replace `<thekey>` above with the actual license key. The start
47+
will then hand on the license key to the Docker container it launches
48+
for ArangoDB.

service/runner_docker.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,18 @@ func (r *dockerRunner) startGC() {
209209

210210
// Try to start a command with given arguments
211211
func (r *dockerRunner) start(image string, command string, args []string, volumes []Volume, ports []int, containerName, serverDir string, output io.Writer) (Process, error) {
212+
env := make([]string, 0, 1)
213+
licenseKey := os.Getenv("ARANGO_LICENSE_KEY")
214+
if licenseKey != "" {
215+
env = append(env, "ARANGO_LICENSE_KEY="+licenseKey)
216+
}
212217
opts := docker.CreateContainerOptions{
213218
Name: containerName,
214219
Config: &docker.Config{
215220
Image: image,
216221
Entrypoint: []string{command},
217222
Cmd: args,
223+
Env: env,
218224
Tty: r.tty,
219225
AttachStdout: output != nil,
220226
AttachStderr: output != nil,

test/docker_activefailover_default_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func TestDockerActiveFailoverDefault(t *testing.T) {
7272
"--label starter-test=true",
7373
"--name=" + cID1,
7474
"--rm",
75+
createLicenseKeyOption(),
7576
fmt.Sprintf("-p %d:%d", basePort, basePort),
7677
fmt.Sprintf("-v %s:/data", volID1),
7778
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -90,6 +91,7 @@ func TestDockerActiveFailoverDefault(t *testing.T) {
9091
"--label starter-test=true",
9192
"--name=" + cID2,
9293
"--rm",
94+
createLicenseKeyOption(),
9395
fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort),
9496
fmt.Sprintf("-v %s:/data", volID2),
9597
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -109,6 +111,7 @@ func TestDockerActiveFailoverDefault(t *testing.T) {
109111
"--label starter-test=true",
110112
"--name=" + cID3,
111113
"--rm",
114+
createLicenseKeyOption(),
112115
fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort),
113116
fmt.Sprintf("-v %s:/data", volID3),
114117
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -179,6 +182,7 @@ func TestDockerActiveFailover2Instance(t *testing.T) {
179182
"--label starter-test=true",
180183
"--name=" + cID1,
181184
"--rm",
185+
createLicenseKeyOption(),
182186
fmt.Sprintf("-p %d:%d", basePort, basePort),
183187
fmt.Sprintf("-v %s:/data", volID1),
184188
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -197,6 +201,7 @@ func TestDockerActiveFailover2Instance(t *testing.T) {
197201
"--label starter-test=true",
198202
"--name=" + cID2,
199203
"--rm",
204+
createLicenseKeyOption(),
200205
fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort),
201206
fmt.Sprintf("-v %s:/data", volID2),
202207
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -216,6 +221,7 @@ func TestDockerActiveFailover2Instance(t *testing.T) {
216221
"--label starter-test=true",
217222
"--name=" + cID3,
218223
"--rm",
224+
createLicenseKeyOption(),
219225
fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort),
220226
fmt.Sprintf("-v %s:/data", volID3),
221227
"-v /var/run/docker.sock:/var/run/docker.sock",

test/docker_activefailover_local_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func TestDockerActiveFailoverLocal(t *testing.T) {
6464
"--label starter-test=true",
6565
"--name=" + cID,
6666
"--rm",
67+
createLicenseKeyOption(),
6768
fmt.Sprintf("-p %d:%d", basePort, basePort),
6869
fmt.Sprintf("-v %s:/data", volID),
6970
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -123,6 +124,7 @@ func TestDockerResilientActiveFailoverSecure(t *testing.T) {
123124
"--label starter-test=true",
124125
"--name=" + cID,
125126
"--rm",
127+
createLicenseKeyOption(),
126128
fmt.Sprintf("-p %d:%d", basePort, basePort),
127129
fmt.Sprintf("-v %s:/data", volID),
128130
"-v /var/run/docker.sock:/var/run/docker.sock",

test/docker_cluster_default_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func TestDockerClusterDefault(t *testing.T) {
7070
"--label starter-test=true",
7171
"--name=" + cID1,
7272
"--rm",
73+
createLicenseKeyOption(),
7374
fmt.Sprintf("-p %d:%d", basePort, basePort),
7475
fmt.Sprintf("-v %s:/data", volID1),
7576
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -87,6 +88,7 @@ func TestDockerClusterDefault(t *testing.T) {
8788
"--label starter-test=true",
8889
"--name=" + cID2,
8990
"--rm",
91+
createLicenseKeyOption(),
9092
fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort),
9193
fmt.Sprintf("-v %s:/data", volID2),
9294
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -105,6 +107,7 @@ func TestDockerClusterDefault(t *testing.T) {
105107
"--label starter-test=true",
106108
"--name=" + cID3,
107109
"--rm",
110+
createLicenseKeyOption(),
108111
fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort),
109112
fmt.Sprintf("-v %s:/data", volID3),
110113
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -172,6 +175,7 @@ func TestOldDockerClusterDefault(t *testing.T) {
172175
"--label starter-test=true",
173176
"--name=" + cID1,
174177
"--rm",
178+
createLicenseKeyOption(),
175179
fmt.Sprintf("-p %d:%d", basePort, basePort),
176180
fmt.Sprintf("-v %s:/data", volID1),
177181
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -189,6 +193,7 @@ func TestOldDockerClusterDefault(t *testing.T) {
189193
"--label starter-test=true",
190194
"--name=" + cID2,
191195
"--rm",
196+
createLicenseKeyOption(),
192197
fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort),
193198
fmt.Sprintf("-v %s:/data", volID2),
194199
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -207,6 +212,7 @@ func TestOldDockerClusterDefault(t *testing.T) {
207212
"--label starter-test=true",
208213
"--name=" + cID3,
209214
"--rm",
215+
createLicenseKeyOption(),
210216
fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort),
211217
fmt.Sprintf("-v %s:/data", volID3),
212218
"-v /var/run/docker.sock:/var/run/docker.sock",

test/docker_cluster_diff_logdir_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ func TestDockerClusterDifferentLogDir(t *testing.T) {
8080
"--label starter-test=true",
8181
"--name=" + cID1,
8282
"--rm",
83+
createLicenseKeyOption(),
8384
fmt.Sprintf("-p %d:%d", basePort, basePort),
8485
fmt.Sprintf("-v %s:/data", volID1),
8586
fmt.Sprintf("-v %s:%s", masterLogDir, masterLogDir),
@@ -100,6 +101,7 @@ func TestDockerClusterDifferentLogDir(t *testing.T) {
100101
"--label starter-test=true",
101102
"--name=" + cID2,
102103
"--rm",
104+
createLicenseKeyOption(),
103105
fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort),
104106
fmt.Sprintf("-v %s:/data", volID2),
105107
fmt.Sprintf("-v %s:%s", slave1LogDir, slave1LogDir),
@@ -121,6 +123,7 @@ func TestDockerClusterDifferentLogDir(t *testing.T) {
121123
"--label starter-test=true",
122124
"--name=" + cID3,
123125
"--rm",
126+
createLicenseKeyOption(),
124127
fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort),
125128
fmt.Sprintf("-v %s:/data", volID3),
126129
fmt.Sprintf("-v %s:%s", slave2LogDir, slave2LogDir),
@@ -211,6 +214,7 @@ func TestDockerClusterDifferentLogDirNoLog2File(t *testing.T) {
211214
"--label starter-test=true",
212215
"--name=" + cID1,
213216
"--rm",
217+
createLicenseKeyOption(),
214218
fmt.Sprintf("-p %d:%d", basePort, basePort),
215219
fmt.Sprintf("-v %s:/data", volID1),
216220
fmt.Sprintf("-v %s:%s", masterLogDir, masterLogDir),
@@ -232,6 +236,7 @@ func TestDockerClusterDifferentLogDirNoLog2File(t *testing.T) {
232236
"--label starter-test=true",
233237
"--name=" + cID2,
234238
"--rm",
239+
createLicenseKeyOption(),
235240
fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort),
236241
fmt.Sprintf("-v %s:/data", volID2),
237242
fmt.Sprintf("-v %s:%s", slave1LogDir, slave1LogDir),
@@ -254,6 +259,7 @@ func TestDockerClusterDifferentLogDirNoLog2File(t *testing.T) {
254259
"--label starter-test=true",
255260
"--name=" + cID3,
256261
"--rm",
262+
createLicenseKeyOption(),
257263
fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort),
258264
fmt.Sprintf("-v %s:/data", volID3),
259265
fmt.Sprintf("-v %s:%s", slave2LogDir, slave2LogDir),

test/docker_cluster_diff_ports_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ func TestDockerClusterDifferentPorts(t *testing.T) {
7171
"--label starter-test=true",
7272
"--name=" + cID1,
7373
"--rm",
74+
createLicenseKeyOption(),
7475
"-p 6000:6000",
7576
fmt.Sprintf("-v %s:/data", volID1),
7677
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -89,6 +90,7 @@ func TestDockerClusterDifferentPorts(t *testing.T) {
8990
"--label starter-test=true",
9091
"--name=" + cID2,
9192
"--rm",
93+
createLicenseKeyOption(),
9294
"-p 7000:7000",
9395
fmt.Sprintf("-v %s:/data", volID2),
9496
"-v /var/run/docker.sock:/var/run/docker.sock",
@@ -108,6 +110,7 @@ func TestDockerClusterDifferentPorts(t *testing.T) {
108110
"--label starter-test=true",
109111
"--name=" + cID3,
110112
"--rm",
113+
createLicenseKeyOption(),
111114
"-p 8000:8000",
112115
fmt.Sprintf("-v %s:/data", volID3),
113116
"-v /var/run/docker.sock:/var/run/docker.sock",

0 commit comments

Comments
 (0)