]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | #!/bin/bash |
2 | ||
3 | set -x | |
4 | set -e | |
5 | SCRIPT=$(readlink -f "$0") | |
6 | SCRIPTPATH=$(dirname "$SCRIPT") | |
7 | ||
8 | # Run me from your build dir! I look for binaries in bin/, lib/ etc. | |
9 | BUILDPATH=$(pwd) | |
10 | ||
11fdf7f2 TL |
11 | |
12 | # PREREQUISITE: a repo that you can push to. You are probably running | |
13 | # a local docker registry that your kubelet nodes also have access to. | |
9f95a23c TL |
14 | REPO=${REPO:-"$1"} |
15 | ||
11fdf7f2 TL |
16 | if [ -z "$REPO" ] |
17 | then | |
18 | echo "ERROR: no \$REPO set!" | |
19 | echo "Run a docker repository and set REPO to <hostname>:<port>" | |
20 | exit -1 | |
21 | fi | |
22 | ||
23 | # The output image name: this should match whatever is configured as | |
24 | # the image name in your Rook cluster CRD object. | |
9f95a23c TL |
25 | IMAGE=ceph/ceph |
26 | TAG=latest | |
11fdf7f2 TL |
27 | |
28 | # The namespace where ceph containers are running in your | |
29 | # test cluster: used for bouncing the containers. | |
30 | NAMESPACE=rook-ceph | |
31 | ||
32 | mkdir -p kubejacker | |
33 | cp $SCRIPTPATH/Dockerfile kubejacker | |
11fdf7f2 TL |
34 | |
35 | # TODO: let user specify which daemon they're interested | |
36 | # in -- doing all bins all the time is too slow and bloaty | |
9f95a23c TL |
37 | #BINS="ceph-mgr ceph-mon ceph-mds ceph-osd rados radosgw-admin radosgw" |
38 | #pushd bin | |
39 | #strip $BINS #TODO: make stripping optional | |
40 | #tar czf $BUILDPATH/kubejacker/bin.tar.gz $BINS | |
41 | #popd | |
11fdf7f2 TL |
42 | |
43 | # We need ceph-common to support the binaries | |
44 | # We need librados/rbd to support mgr modules | |
45 | # that import the python bindings | |
9f95a23c TL |
46 | #LIBS="libceph-common.so.0 libceph-common.so librados.so.2 librados.so librados.so.2.0.0 librbd.so librbd.so.1 librbd.so.1.12.0" |
47 | #pushd lib | |
48 | #strip $LIBS #TODO: make stripping optional | |
49 | #tar czf $BUILDPATH/kubejacker/lib.tar.gz $LIBS | |
50 | #popd | |
11fdf7f2 TL |
51 | |
52 | pushd ../src/pybind/mgr | |
53 | find ./ -name "*.pyc" -exec rm -f {} \; | |
54 | # Exclude node_modules because it's the huge sources in dashboard/frontend | |
55 | tar --exclude=node_modules --exclude=tests --exclude-backups -czf $BUILDPATH/kubejacker/mgr_plugins.tar.gz * | |
56 | popd | |
57 | ||
9f95a23c TL |
58 | #ECLIBS="libec_*.so*" |
59 | #pushd lib | |
60 | #strip $ECLIBS #TODO: make stripping optional | |
61 | #tar czf $BUILDPATH/kubejacker/eclib.tar.gz $ECLIBS | |
62 | #popd | |
11fdf7f2 | 63 | |
9f95a23c TL |
64 | #CLSLIBS="libcls_*.so*" |
65 | #pushd lib | |
66 | #strip $CLSLIBS #TODO: make stripping optional | |
67 | #tar czf $BUILDPATH/kubejacker/clslib.tar.gz $CLSLIBS | |
68 | #popd | |
11fdf7f2 TL |
69 | |
70 | pushd kubejacker | |
9f95a23c | 71 | docker build -t $REPO/ceph/ceph:latest . |
11fdf7f2 TL |
72 | popd |
73 | ||
74 | # Push the image to the repository | |
9f95a23c TL |
75 | #docker tag $REPO/$IMAGE:$TAG $REPO/$IMAGE:latest |
76 | docker push $REPO/ceph/ceph:latest | |
77 | #docker push $REPO/$IMAGE:$TAG | |
11fdf7f2 TL |
78 | |
79 | # Finally, bounce the containers to pick up the new image | |
80 | kubectl -n $NAMESPACE delete pod -l app=rook-ceph-mds | |
81 | kubectl -n $NAMESPACE delete pod -l app=rook-ceph-mgr | |
82 | kubectl -n $NAMESPACE delete pod -l app=rook-ceph-mon |