Skip to content

Commit adedc89

Browse files
committed
Merge pull request #1019 from deis/coreos-317.0.0
chore(contrib/*): update CoreOS to 324.1.0
2 parents 0212030 + 20ecc29 commit adedc89

11 files changed

Lines changed: 95 additions & 51 deletions

File tree

Makefile

Lines changed: 61 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ define ssh_all
3434
endef
3535

3636
define check_for_errors
37-
@if $(FLEETCTL) list-units | egrep -q "(failed|dead)"; then \
37+
@if $(FLEETCTL) list-units -no-legend | awk '(($$2 == "launched") && ($$5 == "failed"))' | egrep -q "deis-.+service"; then \
3838
echo "\033[0;31mOne or more services failed! Check which services by running 'make status'\033[0m" ; \
3939
echo "\033[0;31mYou can get detailed output with 'fleetctl status deis-servicename.service'\033[0m" ; \
4040
echo "\033[0;31mThis usually indicates an error with Deis - please open an issue on GitHub or ask for help in IRC\033[0m" ; \
@@ -48,18 +48,23 @@ define deis_units
4848
sed -n 's/\(deis-.*\.service\).*/\1/p' | tr '\n' ' ')
4949
endef
5050

51+
define echo_cyan
52+
@echo "\033[0;36m$(subst ",,$(1))\033[0m"
53+
endef
54+
5155
define echo_yellow
5256
@echo "\033[0;33m$(subst ",,$(1))\033[0m"
5357
endef
5458

59+
# TODO: re-evaluate the start order now that we're on fleet 0.3.2.
5560
# due to scheduling problems with fleet 0.2.0, start order of components
5661
# is fragile. hopefully this can be changed soon...
5762
COMPONENTS=builder cache controller database logger registry
5863
ALL_COMPONENTS=$(COMPONENTS) router
5964
START_COMPONENTS=registry logger cache database
6065

61-
ALL_UNITS = $(foreach C, $(COMPONENTS), $(wildcard $(C)/systemd/*))
62-
START_UNITS = $(foreach C, $(START_COMPONENTS), $(wildcard $(C)/systemd/*))
66+
ALL_UNITS = $(foreach C,$(COMPONENTS),$(wildcard $(C)/systemd/*))
67+
START_UNITS = $(foreach C,$(START_COMPONENTS),$(wildcard $(C)/systemd/*))
6368
ROUTER_UNITS = $(shell seq -f "deis-router.%g.service" -s " " $(DEIS_FIRST_ROUTER) 1 $(DEIS_LAST_ROUTER))
6469

6570
all: build run
@@ -80,8 +85,17 @@ clean: uninstall
8085
full-clean: clean
8186
$(call ssh_all,'for c in $(ALL_COMPONENTS); do docker rmi deis-$$c; done')
8287

83-
install: check-fleet
84-
$(FLEETCTL) submit $(START_UNITS)
88+
install: check-fleet install-routers
89+
$(FLEETCTL) load $(START_UNITS)
90+
$(FLEETCTL) load controller/systemd/*
91+
$(FLEETCTL) load builder/systemd/*
92+
93+
install-routers: check-fleet
94+
@$(foreach R, $(ROUTER_UNITS), \
95+
cp router/systemd/deis-router.service ./$(R) ; \
96+
$(FLEETCTL) load ./$(R) ; \
97+
rm -f ./$(R) ; \
98+
)
8599

86100
pull:
87101
$(call ssh_all,'for c in $(ALL_COMPONENTS); do docker pull deis/$$c; done')
@@ -91,47 +105,66 @@ restart: stop start
91105

92106
run: install start
93107

94-
start: check-fleet start-routers
108+
start: check-fleet start-warning start-routers
95109
@# registry logger cache database
96-
$(call echo_yellow,"Starting Deis! Deis will be functional once all services are reported as running... ")
97-
$(FLEETCTL) start $(START_UNITS)
98-
$(call echo_yellow,"Waiting for deis-registry to start (this can take some time)... ")
99-
@until $(FLEETCTL) list-units | egrep -q "deis-registry.+(running|failed|dead)"; do printf "\033[0;33mStatus:\033[0m "; $(FLEETCTL) list-units | grep "registry" | awk '{printf $$3}'; printf "\r" ; sleep 10; done
110+
$(call echo_yellow,"Waiting for deis-registry to start...")
111+
$(FLEETCTL) start -no-block $(START_UNITS)
112+
@until $(FLEETCTL) list-units | egrep -q "deis-registry.+(running)"; \
113+
do sleep 2; \
114+
printf "\033[0;33mStatus:\033[0m "; $(FLEETCTL) list-units | \
115+
grep "deis-registry" | awk '{printf "%-10s (%s) \r", $$4, $$5}'; \
116+
sleep 8; \
117+
done
100118
$(call check_for_errors)
101119

102120
@# controller
103-
$(call echo_yellow,"Done! Waiting for deis-controller...")
104-
$(FLEETCTL) submit controller/systemd/*
105-
$(FLEETCTL) start controller/systemd/*
106-
@until $(FLEETCTL) list-units | egrep -q "deis-controller.+(running|failed|dead)"; do printf "\033[0;33mStatus:\033[0m "; $(FLEETCTL) list-units | grep "controller" | awk '{printf $$3}'; printf "\r" ; sleep 10; done
121+
$(call echo_yellow,"Waiting for deis-controller to start...")
122+
$(FLEETCTL) start -no-block controller/systemd/*
123+
@until $(FLEETCTL) list-units | egrep -q "deis-controller.+(running)"; \
124+
do sleep 2; \
125+
printf "\033[0;33mStatus:\033[0m "; $(FLEETCTL) list-units | \
126+
grep "deis-controller" | awk '{printf "%-10s (%s) \r", $$4, $$5}'; \
127+
sleep 8; \
128+
done
107129
$(call check_for_errors)
108130

109131
@# builder
110-
$(call echo_yellow,"Done! Waiting for deis-builder to start (this can also take some time)... ")
111-
$(FLEETCTL) submit builder/systemd/*
112-
$(FLEETCTL) start builder/systemd/*
113-
@until $(FLEETCTL) list-units | egrep -q "deis-builder.+(running|failed|dead)"; do printf "\033[0;33mStatus:\033[0m "; $(FLEETCTL) list-units | grep "builder" | awk '{printf $$3}'; printf "\r" ; sleep 10; done
132+
$(call echo_yellow,"Waiting for deis-builder to start...")
133+
$(FLEETCTL) start -no-block builder/systemd/*
134+
@until $(FLEETCTL) list-units | egrep -q "deis-builder.+(running)"; \
135+
do sleep 2; \
136+
printf "\033[0;33mStatus:\033[0m "; $(FLEETCTL) list-units | \
137+
grep "deis-builder" | awk '{printf "%-10s (%s) \r", $$4, $$5}'; \
138+
sleep 8; \
139+
done
114140
$(call check_for_errors)
115141

116142
$(call echo_yellow,"Your Deis cluster is ready to go! Continue following the README to login and use Deis.")
117143

118-
start-routers:
119-
$(call echo_yellow,"Starting $(DEIS_NUM_ROUTERS) router(s)...")
120-
@ $(foreach U, $(ROUTER_UNITS), \
121-
cp router/systemd/deis-router.service ./$(U) ; \
122-
$(FLEETCTL) submit ./$(U) ; \
123-
$(FLEETCTL) start ./$(U) ; \
124-
rm -f ./$(U) ; \
125-
)
144+
start-routers: check-fleet start-warning
145+
$(call echo_yellow,"Waiting for 1 of $(DEIS_NUM_ROUTERS) deis-routers to start...")
146+
$(foreach R,$(ROUTER_UNITS),$(FLEETCTL) start -no-block $(R);)
147+
@until $(FLEETCTL) list-units | egrep -q "deis-router.+(running)"; \
148+
do sleep 2; \
149+
printf "\033[0;33mStatus:\033[0m "; $(FLEETCTL) list-units | \
150+
grep "deis-router" | head -n 1 | \
151+
awk '{printf "%-10s (%s) \r", $$4, $$5}'; \
152+
sleep 8; \
153+
done
154+
$(call check_for_errors)
155+
156+
start-warning:
157+
$(call echo_cyan,"Deis components may take a long time to start the first time they are initialized.")
126158

127159
status: check-fleet
128160
$(FLEETCTL) list-units
129161

130162
stop: check-fleet
131-
$(FLEETCTL) stop $(call deis_units,loaded,.)
163+
$(FLEETCTL) stop -block-attempts=600 $(strip $(call deis_units,launched,active))
132164

133165
tests:
134166
cd test && bundle install && bundle exec rake
135167

136168
uninstall: check-fleet stop
137-
$(FLEETCTL) destroy $(call deis_units,loaded,.)
169+
$(FLEETCTL) unload $(call deis_units,launched,.)
170+
$(FLEETCTL) destroy $(strip $(call deis_units,.,.))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Trying out Deis? Continue following these instructions for a local cluster setup
2727
## Install prerequisites
2828
On your workstation:
2929
* Install [Vagrant](http://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
30-
* Install the fleetctl client: Install v0.2.0 from the [fleet GitHub page](https://github.com/coreos/fleet/releases).
30+
* Install the fleetctl client: Install v0.3.2 from the [fleet GitHub page](https://github.com/coreos/fleet/releases).
3131
* Install the Docker client if you want to run Docker commands locally (optional)
3232

3333
If you're on Ubuntu, you need to install the nfs-kernel-server package as it's required for sharing folders between your host and your CoreOS VM:

Vagrantfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ else
1212
end
1313

1414
Vagrant.configure("2") do |config|
15-
config.vm.box = "coreos-310.1.0"
16-
config.vm.box_url = "http://storage.core-os.net/coreos/amd64-usr/310.1.0/coreos_production_vagrant.box"
15+
config.vm.box = "coreos-324.1.0"
16+
config.vm.box_url = "http://storage.core-os.net/coreos/amd64-usr/324.1.0/coreos_production_vagrant.box"
1717

1818
config.vm.provider :vmware_fusion do |vb, override|
19-
override.vm.box_url = "http://storage.core-os.net/coreos/amd64-usr/310.1.0/coreos_production_vagrant_vmware_fusion.box"
19+
override.vm.box_url = "http://storage.core-os.net/coreos/amd64-usr/324.1.0/coreos_production_vagrant_vmware_fusion.box"
2020
end
2121

2222
config.vm.provider :virtualbox do |vb, override|

builder/systemd/deis-builder.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ EnvironmentFile=/etc/environment
88
TimeoutStartSec=20m
99
ExecStartPre=/bin/sh -c "docker history deis/builder >/dev/null || docker pull deis/builder"
1010
ExecStartPre=/bin/sh -c "docker inspect deis-builder >/dev/null && docker rm -f deis-builder || true"
11-
ExecStartPre=/bin/sh -c "docker start deis-builder-data || docker run --name deis-builder-data -v /var/lib/docker deis/base true"
11+
ExecStartPre=/bin/sh -c "docker inspect deis-builder-data >/dev/null 2>&1 || docker run --name deis-builder-data -v /var/lib/docker deis/base true"
1212
ExecStart=/usr/bin/docker run --name deis-builder -p 2222:22 -e PUBLISH=22 -e HOST=${COREOS_PRIVATE_IPV4} -e PORT=2222 --volumes-from deis-builder-data --privileged deis/builder
1313
ExecStartPost=/bin/sh -c "echo 'Waiting for builder on 2222/tcp...' && until cat </dev/null>/dev/tcp/$COREOS_PRIVATE_IPV4/2222; do sleep 1; done"
1414
ExecStop=/usr/bin/docker rm -f deis-builder

contrib/ec2/deis.template

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44
"Mappings" : {
55
"RegionMap" : {
66
"ap-northeast-1" : {
7-
"AMI" : "ami-f1eaadf0"
7+
"AMI" : "ami-836c2f82"
88
},
99
"sa-east-1" : {
10-
"AMI" : "ami-0d2b8610"
10+
"AMI" : "ami-43ab075e"
1111
},
1212
"ap-southeast-2" : {
13-
"AMI" : "ami-e952c9d3"
13+
"AMI" : "ami-4ba53f71"
1414
},
1515
"ap-southeast-1" : {
16-
"AMI" : "ami-4494c616"
16+
"AMI" : "ami-946d30c6"
1717
},
1818
"us-east-1" : {
19-
"AMI" : "ami-6e2ecd06"
19+
"AMI" : "ami-3221c95a"
2020
},
2121
"us-west-2" : {
22-
"AMI" : "ami-29374119"
22+
"AMI" : "ami-a1c6b791"
2323
},
2424
"us-west-1" : {
25-
"AMI" : "ami-3eb08b7b"
25+
"AMI" : "ami-3c080d79"
2626
},
2727
"eu-west-1" : {
28-
"AMI" : "ami-1b34f26c"
28+
"AMI" : "ami-3f7ab948"
2929
}
3030
}
3131
},

contrib/rackspace/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ For more information, see [optimal etcd cluster size](https://github.com/coreos/
5353

5454
Deis clusters of less than 3 nodes are unsupported.
5555

56+
### Update CoreOS
57+
Due to image publishing limitations on Rackspace, CoreOS images on Rackspace are frequently out of date.
58+
Each machine needs to be updated. On each one, run:
59+
60+
```console
61+
$ sudo systemctl unmask update-engine && sudo systemctl start update-engine && sudo update_engine_client -update && sudo reboot
62+
```
63+
64+
Once the machine is rebooted, it should have a recent CoreOS version.
65+
5666
### Initialize the cluster
5767
Once the cluster is up, get the hostname of any of the machines from Rackspace, set
5868
FLEETCTL_TUNNEL, and issue a `make run` from the project root:

contrib/rackspace/provision-rackspace-cluster.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ done
4545

4646
echo_green "Your Deis cluster has successfully deployed to Rackspace."
4747
echo_green "Please continue to follow the instructions in the README."
48+
echo_yellow "NOTE: For this release, you must also update CoreOS on these machines. See the README for details."

controller/scheduler/coreos.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,24 @@ def start(self, name):
9595

9696
def _start_log(self, name, env):
9797
subprocess.check_call(
98-
'fleetctl.sh start {name}-log.service'.format(**locals()),
98+
'fleetctl.sh start -no-block {name}-log.service'.format(**locals()),
9999
shell=True, env=env)
100100

101101
def _start_container(self, name, env):
102102
return subprocess.check_call(
103-
'fleetctl.sh start {name}.service'.format(**locals()),
103+
'fleetctl.sh start -no-block {name}.service'.format(**locals()),
104104
shell=True, env=env)
105105

106106
def _start_announcer(self, name, env):
107107
return subprocess.check_call(
108-
'fleetctl.sh start {name}-announce.service'.format(**locals()),
108+
'fleetctl.sh start -no-block {name}-announce.service'.format(**locals()),
109109
shell=True, env=env)
110110

111111
def _wait_for_announcer(self, name, env):
112112
status = None
113113
for _ in range(60):
114114
status = subprocess.check_output(
115-
"fleetctl.sh list-units | grep {name}-announce.service | awk '{{print $4}}'".format(**locals()),
115+
"fleetctl.sh list-units | grep {name}-announce.service | awk '{{print $5}}'".format(**locals()),
116116
shell=True, env=env).strip('\n')
117117
if status == 'running':
118118
break
@@ -132,17 +132,17 @@ def stop(self, name):
132132

133133
def _stop_container(self, name, env):
134134
return subprocess.check_call(
135-
'fleetctl.sh stop {name}.service'.format(**locals()),
135+
'fleetctl.sh stop -block-attempts=600 {name}.service'.format(**locals()),
136136
shell=True, env=env)
137137

138138
def _stop_announcer(self, name, env):
139139
return subprocess.check_call(
140-
'fleetctl.sh stop {name}-announce.service'.format(**locals()),
140+
'fleetctl.sh stop -block-attempts=600 {name}-announce.service'.format(**locals()),
141141
shell=True, env=env)
142142

143143
def _stop_log(self, name, env):
144144
return subprocess.check_call(
145-
'fleetctl.sh stop {name}-announce.service'.format(**locals()),
145+
'fleetctl.sh stop -block-attempts=600 {name}-log.service'.format(**locals()),
146146
shell=True, env=env)
147147

148148
def destroy(self, name):

database/systemd/deis-database.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ EnvironmentFile=/etc/environment
66
TimeoutStartSec=20m
77
ExecStartPre=/bin/sh -c "docker history deis/database >/dev/null || docker pull deis/database"
88
ExecStartPre=/bin/sh -c "docker inspect deis-database >/dev/null && docker rm -f deis-database || true"
9-
ExecStartPre=/bin/sh -c "docker start deis-database-data || docker run --name deis-database-data -v /var/lib/postgresql deis/base true"
9+
ExecStartPre=/bin/sh -c "docker inspect deis-database-data >/dev/null 2>&1 || docker run --name deis-database-data -v /var/lib/postgresql deis/base true"
1010
ExecStart=/usr/bin/docker run --name deis-database -p 5432:5432 -e PUBLISH=5432 -e HOST=${COREOS_PRIVATE_IPV4} --volumes-from deis-database-data deis/database
1111
ExecStop=/usr/bin/docker rm -f deis-database
1212

logger/systemd/deis-logger.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ EnvironmentFile=/etc/environment
66
TimeoutStartSec=20m
77
ExecStartPre=/bin/sh -c "docker history deis/logger >/dev/null || docker pull deis/logger"
88
ExecStartPre=/bin/sh -c "docker inspect deis-logger >/dev/null && docker rm -f deis-logger || true"
9-
ExecStartPre=/bin/sh -c "docker start deis-logger-data || docker run --name deis-logger-data -v /var/log/deis deis/base true"
9+
ExecStartPre=/bin/sh -c "docker inspect deis-logger-data >/dev/null 2>&1 || docker run --name deis-logger-data -v /var/log/deis deis/base true"
1010
ExecStart=/usr/bin/docker run --name deis-logger -p 514:514/udp -e PUBLISH=514 -e HOST=${COREOS_PRIVATE_IPV4} --volumes-from deis-logger-data deis/logger
1111
ExecStop=/usr/bin/docker rm -f deis-logger
1212

0 commit comments

Comments
 (0)