Skip to content

Commit 6236a06

Browse files
committed
Merge pull request #2405 from carmstrong/ceph_giant
chore(store): bump Ceph to "giant" release
2 parents 58c2d97 + 9fc6637 commit 6236a06

9 files changed

Lines changed: 104 additions & 25 deletions

File tree

database/tests/database_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ func TestDatabase(t *testing.T) {
2424
// run mock ceph containers
2525
cephName := "deis-ceph-" + tag
2626
mock.RunMockCeph(t, cephName, cli, etcdPort)
27-
defer cli.CmdRm("-f", cephName+"-monitor")
27+
defer cli.CmdRm("-f", "-v", cephName+"-monitor")
2828
defer cli.CmdRm("-f", "-v", cephName+"-daemon")
29+
defer cli.CmdRm("-f", cephName+"-metadata")
2930
defer cli.CmdRm("-f", cephName+"-gateway")
3031

3132
// run database container

docs/managing_deis/add_remove_host.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ Reminder: make sure you're logged into the machine you're removing from the clus
265265
deis-store-metadata
266266
267267
This is actually all that's necessary. Ceph provides a ``ceph mds rm`` command, but has no
268-
documentation for it. See: http://docs.ceph.com/docs/firefly/rados/operations/control/#mds-subsystem
268+
documentation for it. See: http://docs.ceph.com/docs/giant/rados/operations/control/#mds-subsystem
269269

270270
Removing the host from etcd
271271
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -274,5 +274,5 @@ The etcd cluster still has an entry for the host we've removed, so we'll need to
274274
This can be achieved by making a request to the etcd API. See `remove machines`_ for details.
275275

276276
.. _`remove machines`: https://coreos.com/docs/distributed-configuration/etcd-api/#remove-machines
277-
.. _`removing monitors`: http://ceph.com/docs/firefly/rados/operations/add-or-rm-mons/#removing-monitors
278-
.. _`removing OSDs`: http://docs.ceph.com/docs/firefly/rados/operations/add-or-rm-osds/#removing-osds-manual
277+
.. _`removing monitors`: http://ceph.com/docs/giant/rados/operations/add-or-rm-mons/#removing-monitors
278+
.. _`removing OSDs`: http://docs.ceph.com/docs/giant/rados/operations/add-or-rm-osds/#removing-osds-manual

docs/managing_deis/store_metadata_settings.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ Considerations: none
1717

1818
Settings set by store-metadata
1919
------------------------------
20-
The store-metadata component sets no keys in etcd.
20+
The following etcd keys are set by the store-metadata component, typically in its /bin/boot script.
21+
22+
=================================== ==============================================
23+
setting description
24+
=================================== ==============================================
25+
/deis/store/filesystemSetupComplete Set when the Ceph filesystem setup is complete
26+
=================================== ==============================================
2127

2228
Settings used by store-metadata
2329
-------------------------------

docs/troubleshooting_deis/index.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ A deis-store component fails to start
1414
The store component is the most complex component of Deis. As such, there are many ways for it to fail.
1515
Recall that the store components represent Ceph services as follows:
1616

17-
* ``store-monitor``: http://ceph.com/docs/firefly/man/8/ceph-mon/
18-
* ``store-daemon``: http://ceph.com/docs/firefly/man/8/ceph-osd/
19-
* ``store-gateway``: http://ceph.com/docs/firefly/radosgw/
20-
* ``store-metadata``: http://ceph.com/docs/firefly/man/8/ceph-mds/
17+
* ``store-monitor``: http://ceph.com/docs/giant/man/8/ceph-mon/
18+
* ``store-daemon``: http://ceph.com/docs/giant/man/8/ceph-osd/
19+
* ``store-gateway``: http://ceph.com/docs/giant/radosgw/
20+
* ``store-metadata``: http://ceph.com/docs/giant/man/8/ceph-mds/
2121
* ``store-volume``: a system service which mounts a `Ceph FS`_ volume to be used by the controller and logger components
2222

2323
Log output for store components can be viewed with ``deisctl status store-<component>`` (such as
@@ -135,7 +135,7 @@ Other issues
135135

136136
Running into something not detailed here? Please `open an issue`_ or hop into #deis on Freenode IRC and we'll help!
137137

138-
.. _`Ceph FS`: https://ceph.com/docs/firefly/cephfs/
138+
.. _`Ceph FS`: https://ceph.com/docs/giant/cephfs/
139139
.. _`open an issue`: https://github.com/deis/deis/issues/new
140-
.. _`troubleshooting`: http://docs.ceph.com/docs/firefly/rados/troubleshooting/
140+
.. _`troubleshooting`: http://docs.ceph.com/docs/giant/rados/troubleshooting/
141141

registry/tests/registry_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ func TestRegistry(t *testing.T) {
3636
// run mock ceph containers
3737
cephName := "deis-ceph-" + tag
3838
mock.RunMockCeph(t, cephName, cli, etcdPort)
39-
defer cli.CmdRm("-f", cephName+"-monitor")
39+
defer cli.CmdRm("-f", "-v", cephName+"-monitor")
4040
defer cli.CmdRm("-f", "-v", cephName+"-daemon")
41+
defer cli.CmdRm("-f", cephName+"-metadata")
4142
defer cli.CmdRm("-f", cephName+"-gateway")
4243

4344
host, port := utils.HostAddress(), utils.RandomPort()

store/base/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ curl -sSL https://s3-us-west-2.amazonaws.com/opdemand/confd-git-0e563e5 -o /usr/
2424
chmod +x /usr/local/bin/confd
2525

2626
curl -sSL 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc' | apt-key add -
27-
echo "deb http://ceph.com/debian-firefly trusty main" > /etc/apt/sources.list.d/ceph.list
27+
echo "deb http://ceph.com/debian-giant trusty main" > /etc/apt/sources.list.d/ceph.list
2828

2929
apt-get update && apt-get install -yq ceph
3030

store/gateway/bin/boot

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,28 @@ if ! etcdctl --no-sync -C $ETCD get /deis/store/defaultPoolsConfigured >/dev/nul
3535
echo "store-gateway: setting pg_num values for default pools..."
3636
function set_until_success {
3737
set +e
38-
ceph osd pool set $1 pg_num $2 2>/dev/null
39-
PG_SET=$?
40-
until [[ $PG_SET -eq 0 ]]; do
41-
sleep 5
38+
39+
echo "store-gateway: checking pool $1..."
40+
if ! ceph osd pool get $1 pg_num | grep "pg_num: $2" ; then
4241
ceph osd pool set $1 pg_num $2 2>/dev/null
4342
PG_SET=$?
44-
done
45-
46-
ceph osd pool set $1 pgp_num $2 2>/dev/null
47-
PGP_SET=$?
48-
until [[ $PGP_SET -eq 0 ]]; do
49-
sleep 5
43+
until [[ $PG_SET -eq 0 ]]; do
44+
sleep 5
45+
ceph osd pool set $1 pg_num $2 2>/dev/null
46+
PG_SET=$?
47+
done
48+
fi
49+
50+
if ! ceph osd pool get $1 pgp_num | grep "pgp_num: $2" ; then
5051
ceph osd pool set $1 pgp_num $2 2>/dev/null
5152
PGP_SET=$?
52-
done
53+
until [[ $PGP_SET -eq 0 ]]; do
54+
sleep 5
55+
ceph osd pool set $1 pgp_num $2 2>/dev/null
56+
PGP_SET=$?
57+
done
58+
fi
59+
5360
set -e
5461
}
5562

store/metadata/bin/boot

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,50 @@
33

44
ETCD_PORT=${ETCD_PORT:-4001}
55
ETCD="$HOST:$ETCD_PORT"
6+
ETCD_PATH=${ETCD_PATH:-/deis/store}
67

7-
MDS_NAME=`hostname`
8+
HOSTNAME=`hostname`
9+
MDS_NAME=$HOSTNAME
810

911
until confd -onetime -node $ETCD -config-file /app/confd.toml >/dev/null 2>&1 ; do
1012
echo "store-metadata: waiting for confd to write initial templates..."
1113
sleep 5
1214
done
1315

16+
if ! etcdctl --no-sync -C $ETCD get ${ETCD_PATH}/filesystemSetupComplete >/dev/null 2>&1 ; then
17+
echo "store-metadata: The Ceph filesystem hasn't been created. Trying to obtain the lock to set up..."
18+
# let's rock and roll. we need to obtain a lock so we can ensure only one machine is trying to deploy the cluster
19+
if etcdctl --no-sync -C $ETCD mk ${ETCD_PATH}/filesystemSetupLock $HOSTNAME >/dev/null 2>&1 \
20+
|| [[ `etcdctl --no-sync -C $ETCD get ${ETCD_PATH}/filesystemSetupLock` == "$HOSTNAME" ]] ; then
21+
echo "store-metadata: obtained the lock to proceed with setting up."
22+
23+
PG_NUM=`etcdctl --no-sync -C $ETCD get /deis/store/pgNum`
24+
25+
# even though we know setup hasn't completed, we could be upgrading an older cluster which
26+
# has the pools but not the filesystemSetupComplete key
27+
if ! ceph osd lspools | grep " data," ; then
28+
ceph osd pool create data ${PG_NUM}
29+
fi
30+
31+
if ! ceph osd lspools | grep metadata ; then
32+
ceph osd pool create metadata ${PG_NUM}
33+
fi
34+
35+
if ceph fs ls | grep "No filesystems enabled" ; then
36+
ceph fs new deis metadata data
37+
fi
38+
39+
# mark setup as complete
40+
echo "store-metadata: filesystem setup complete."
41+
etcdctl --no-sync -C $ETCD set ${ETCD_PATH}/filesystemSetupComplete youBetcha >/dev/null
42+
else
43+
until etcdctl --no-sync -C $ETCD get ${ETCD_PATH}/filesystemSetupComplete >/dev/null 2>&1 ; do
44+
echo "store-metadata: waiting for another metadata to complete setup..."
45+
sleep 5
46+
done
47+
fi
48+
fi
49+
1450
# Check to see if we are a new MDS
1551
if [ ! -e /var/lib/ceph/mds/ceph-$MDS_NAME/keyring ]; then
1652
mkdir -p /var/lib/ceph/mds/ceph-${MDS_NAME}

tests/mock/mock.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ func RunMockCeph(t *testing.T, name string, cli *client.DockerCli, etcdPort stri
6767
daemonName := name + "-daemon"
6868
RunMockCephDaemon(t, daemonName, etcdPort)
6969

70+
metadataName := name + "-metadata"
71+
RunMockCephMetadata(t, metadataName, etcdPort)
72+
7073
gatewayName := name + "-gateway"
7174
RunMockCephGateway(t, gatewayName, utils.RandomPort(), etcdPort)
7275
}
@@ -122,6 +125,31 @@ func RunMockCephDaemon(t *testing.T, name string, etcdPort string) {
122125
}
123126
}
124127

128+
// RunMockCephMetadata starts a mock Ceph MDS
129+
func RunMockCephMetadata(t *testing.T, name string, etcdPort string) {
130+
var err error
131+
cli, stdout, stdoutPipe := dockercli.NewClient()
132+
cephImage := "deis/store-metadata:" + utils.BuildTag()
133+
ipaddr := utils.HostAddress()
134+
fmt.Printf("--- Running deis/mock-ceph-metadata at %s\n", ipaddr)
135+
done2 := make(chan bool, 1)
136+
go func() {
137+
done2 <- true
138+
_ = cli.CmdRm("-f", name)
139+
err = dockercli.RunContainer(cli,
140+
"--name", name,
141+
"--rm",
142+
"-e", "ETCD_PORT="+etcdPort,
143+
"-e", "HOST="+ipaddr,
144+
"--net=host",
145+
cephImage)
146+
}()
147+
dockercli.PrintToStdout(t, stdout, stdoutPipe, "mds.0.1 active_start")
148+
if err != nil {
149+
t.Fatal(err)
150+
}
151+
}
152+
125153
// RunMockCephGateway starts a mock S3 endpoint used for component testing
126154
func RunMockCephGateway(t *testing.T, name string, port string, etcdPort string) {
127155
var err error

0 commit comments

Comments
 (0)