Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit def9d15

Browse files
author
David Chung
authored
Move example code in pkg/example to examples/ (#365)
Signed-off-by: David Chung <[email protected]>
1 parent 89b031a commit def9d15

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+87
-27
lines changed

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ endif
115115
$(call build_binary,infrakit,github.com/docker/infrakit/cmd/cli)
116116
$(call build_binary,infrakit-manager,github.com/docker/infrakit/cmd/manager)
117117
$(call build_binary,infrakit-group-default,github.com/docker/infrakit/cmd/group)
118-
$(call build_binary,infrakit-flavor-combo,github.com/docker/infrakit/pkg/example/flavor/combo)
119-
$(call build_binary,infrakit-flavor-swarm,github.com/docker/infrakit/pkg/example/flavor/swarm)
120-
$(call build_binary,infrakit-flavor-vanilla,github.com/docker/infrakit/pkg/example/flavor/vanilla)
121-
$(call build_binary,infrakit-flavor-zookeeper,github.com/docker/infrakit/pkg/example/flavor/zookeeper)
122-
$(call build_binary,infrakit-instance-file,github.com/docker/infrakit/pkg/example/instance/file)
123-
$(call build_binary,infrakit-instance-terraform,github.com/docker/infrakit/pkg/example/instance/terraform)
124-
$(call build_binary,infrakit-instance-vagrant,github.com/docker/infrakit/pkg/example/instance/vagrant)
118+
$(call build_binary,infrakit-flavor-combo,github.com/docker/infrakit/examples/flavor/combo)
119+
$(call build_binary,infrakit-flavor-swarm,github.com/docker/infrakit/examples/flavor/swarm)
120+
$(call build_binary,infrakit-flavor-vanilla,github.com/docker/infrakit/examples/flavor/vanilla)
121+
$(call build_binary,infrakit-flavor-zookeeper,github.com/docker/infrakit/examples/flavor/zookeeper)
122+
$(call build_binary,infrakit-instance-file,github.com/docker/infrakit/examples/instance/file)
123+
$(call build_binary,infrakit-instance-terraform,github.com/docker/infrakit/examples/instance/terraform)
124+
$(call build_binary,infrakit-instance-vagrant,github.com/docker/infrakit/examples/instance/vagrant)
125125

126126
install:
127127
@echo "+ $@"

README.md

Lines changed: 6 additions & 6 deletions

pkg/example/flavor/combo/README.md renamed to examples/flavor/combo/README.md

Lines changed: 1 addition & 2 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

pkg/example/flavor/swarm/README.md renamed to examples/flavor/swarm/README.md

Lines changed: 2 additions & 2 deletions
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[
2+
{
3+
"Plugin" : "group-default",
4+
"Launch" : {
5+
"Exec" : "os",
6+
"Properties": {
7+
"Cmd" : "infrakit-group-default --poll-interval 500ms --name group-stateless --log 5 > {{env "LOG_DIR"}}/group-default-{{unixtime}}.log 2>&1 &",
8+
"SamePgID" : true
9+
}
10+
}
11+
}
12+
,
13+
{
14+
"Plugin" : "instance-file",
15+
"Launch" : {
16+
"Exec" : "os",
17+
"Properties" : {
18+
"Cmd" : "infrakit-instance-file --dir {{env "TUTORIAL_DIR"}} --log 5 > {{env "LOG_DIR"}}/instance-file-{{unixtime}}.log 2>&1",
19+
"SamePgID" : true
20+
}
21+
}
22+
}
23+
,
24+
{
25+
"Plugin" : "instance-vagrant",
26+
"Launch" : {
27+
"Exec" : "os",
28+
"Properties" : {
29+
"Cmd" : "infrakit-instance-vagrant --log 5 > {{env "LOG_DIR"}}/instance-vagrant-{{unixtime}}.log 2>&1",
30+
"SamePgID" : true
31+
}
32+
}
33+
}
34+
,
35+
{
36+
"Plugin" : "flavor-vanilla",
37+
"Launch" : {
38+
"Exec" : "os",
39+
"Properties" : {
40+
"Cmd" : "infrakit-flavor-vanilla --log 5 > {{env "LOG_DIR"}}/flavor-vanilla-{{unixtime}}.log 2>&1",
41+
"SamePgID" : true
42+
}
43+
}
44+
}
45+
,
46+
{
47+
"Plugin" : "flavor-swarm",
48+
"Launch" : {
49+
"Exec" : "os",
50+
"Properties" : {
51+
"Cmd" : "infrakit-flavor-swarm --host {{env "SWARM_MANAGER"}} --log 5 > {{env "LOG_DIR"}}/flavor-swarm-{{unixtime}}.log 2>&1",
52+
"SamePgID" : true
53+
}
54+
}
55+
}
56+
]

scripts/e2e-swarm.sh renamed to examples/flavor/swarm/e2e.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -o errexit
44
set -o nounset
55

66
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
7-
cd "$HERE/.."
7+
cd "$HERE/../../.."
88

99
export PATH=$PWD/build:$PATH
1010

@@ -59,7 +59,7 @@ export E2E_SWARM_DIR=$E2E_SWARM_DIR
5959
export SWARM_MANAGER="tcp://192.168.2.200:4243"
6060

6161
# note -- on exit, this won't clean up the plugins started by the cli since they will be in a separate process group
62-
infrakit plugin start --wait --config-url file:///$PWD/scripts/e2e-test-plugins.json --os group-default instance-vagrant flavor-swarm flavor-vanilla &
62+
infrakit plugin start --wait --config-url file:///$PWD/examples/flavor/swarm/e2e-plugins.json --os group-default instance-vagrant flavor-swarm flavor-vanilla &
6363

6464
starterpid=$!
6565
echo "plugin start pid=$starterpid"
@@ -106,7 +106,7 @@ expect_output_lines "7 plugins should be discoverable" "infrakit plugin ls -q" "
106106
expect_output_lines "0 instances should exist" "infrakit instance describe -q --name instance-vagrant" "0"
107107

108108
echo "Commiting manager"
109-
infrakit group commit pkg/example/flavor/swarm/swarm-vagrant-manager.json
109+
infrakit group commit examples/flavor/swarm/swarm-vagrant-manager.json
110110

111111
echo 'Waiting for group to be provisioned'
112112
sleep 60
@@ -116,7 +116,7 @@ expect_output_lines "1 instances should exist in group" "infrakit group describe
116116
expect_output_lines "1 instances should exist" "infrakit instance describe -q --name instance-vagrant" "1"
117117

118118
echo "Commiting workers"
119-
infrakit group commit pkg/example/flavor/swarm/swarm-vagrant-workers.json
119+
infrakit group commit examples/flavor/swarm/swarm-vagrant-workers.json
120120

121121
echo 'Waiting for group to be provisioned'
122122
sleep 120
@@ -125,6 +125,11 @@ expect_output_lines "Should be watching two groups" "infrakit group ls -q" "2"
125125
expect_output_lines "2 instances should exist in group" "infrakit group describe swarm-workers -q" "2"
126126
expect_output_lines "3 instances should exist" "infrakit instance describe -q --name instance-vagrant" "3"
127127

128+
echo "Checking Docker Swarm"
129+
130+
docker -H $SWARM_MANAGER node ls
131+
132+
128133
echo "Destroying workers"
129134
infrakit group destroy swarm-workers
130135
expect_output_lines "1 instances should exist" "infrakit instance describe -q --name instance-vagrant" "1"

0 commit comments

Comments
 (0)