Skip to content
This repository was archived by the owner on Feb 27, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ DEB_MAJOR_VERSION := 1.0${DEB_VERSION_QUALIFIER}
DEB_NAMES := crest
DEB_NAMES += homer homer-node
DEB_NAMES += homestead-prov
DEB_NAMES += homer-cassandra homestead-prov-cassandra

MAX_LINE_LENGTH ?= 99

Expand Down
2 changes: 2 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
/homer-node/
/homestead/
/homestead-prov/
/homer-cassandra/
/homestead-prov-cassandra/
16 changes: 13 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,25 @@ Description: crest, a Cassandra powered generic RESTful HTTP server platform

Package: homer-node
Architecture: any
Depends: homer, clearwater-cassandra
Description: homer-node, the Cassandra powered XDMS node
Depends: homer, homer-cassandra
Description: Homer, the Cassandra powered XDMS node

Package: homer
Architecture: any
Depends: crest
Description: homer, the Cassandra powered XDMS
Description: Homer, the Cassandra powered XDMS

Package: homestead-prov
Architecture: any
Depends: crest
Description: Provisioning backend for Homestead, the Cassandra powered HSS gateway

Package: homer-cassandra
Architecture: any
Depends: clearwater-cassandra, clearwater-infrastructure
Description: Commissions a Cassandra node so that it can be used as a backend for the homer package

Package: homestead-prov-cassandra
Architecture: any
Depends: clearwater-cassandra, clearwater-infrastructure, homestead-cassandra
Description: Commissions a Cassandra node so that it can be used as a backend for the homestead-prov package
4 changes: 1 addition & 3 deletions debian/crest.install
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
.crest-eggs/* usr/share/clearwater/crest/.eggs/
src/metaswitch/crest/tools usr/share/clearwater/crest/src/metaswitch/crest/
src/metaswitch/crest/tools/sstable_provisioning/* /usr/share/clearwater/crest/tools/sstable_provisioning
.crest-eggs/* /usr/share/clearwater/crest/.eggs/
3 changes: 3 additions & 0 deletions debian/homer-cassandra.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
homer-cassandra.root/* /
src/metaswitch/crest/tools /usr/share/clearwater/crest/src/metaswitch/crest/
src/metaswitch/crest/tools/sstable_provisioning/* /usr/share/clearwater/crest/tools/sstable_provisioning
75 changes: 75 additions & 0 deletions debian/homer-cassandra.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#/bin/sh

# @file homer-cassandra.postinst
#
# Project Clearwater - IMS in the Cloud
# Copyright (C) 2016 Metaswitch Networks Ltd
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version, along with the "Special Exception" for use of
# the program along with SSL, set forth below. This program is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more
# details. You should have received a copy of the GNU General Public
# License along with this program. If not, see
# <http://www.gnu.org/licenses/>.
#
# The author can be reached by email at clearwater@metaswitch.com or by
# post at Metaswitch Networks Ltd, 100 Church St, Enfield EN2 6BQ, UK
#
# Special Exception
# Metaswitch Networks Ltd grants you permission to copy, modify,
# propagate, and distribute a work formed by combining OpenSSL with The
# Software, or a work derivative of such a combination, even if such
# copying, modification, propagation, or distribution would otherwise
# violate the terms of the GPL. You must comply with the GPL in all
# respects for all of the code used other than OpenSSL.
# "OpenSSL" means OpenSSL toolkit software distributed by the OpenSSL
# Project and licensed under the OpenSSL Licenses, or a work based on such
# software and licensed under the OpenSSL Licenses.
# "OpenSSL Licenses" means the OpenSSL License and Original SSLeay License
# under which the OpenSSL Project distributes the OpenSSL toolkit software,
# as those licenses appear in the file LICENSE-OPENSSL.

#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

case "$1" in
configure)
# Restart clearwater-infrastructure in order to trigger the
# homer-cassandra script.
service clearwater-infrastructure restart
;;

abort-upgrade|abort-remove|abort-deconfigure)
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

exit 0
3 changes: 3 additions & 0 deletions debian/homestead-prov-cassandra.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
homestead-prov-cassandra.root/* /
src/metaswitch/crest/tools /usr/share/clearwater/crest/src/metaswitch/crest/
src/metaswitch/crest/tools/sstable_provisioning/* /usr/share/clearwater/crest/tools/sstable_provisioning
75 changes: 75 additions & 0 deletions debian/homestead-prov-cassandra.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#/bin/sh

# @file homestead-prov-cassandra.postinst
#
# Project Clearwater - IMS in the Cloud
# Copyright (C) 2016 Metaswitch Networks Ltd
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version, along with the "Special Exception" for use of
# the program along with SSL, set forth below. This program is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more
# details. You should have received a copy of the GNU General Public
# License along with this program. If not, see
# <http://www.gnu.org/licenses/>.
#
# The author can be reached by email at clearwater@metaswitch.com or by
# post at Metaswitch Networks Ltd, 100 Church St, Enfield EN2 6BQ, UK
#
# Special Exception
# Metaswitch Networks Ltd grants you permission to copy, modify,
# propagate, and distribute a work formed by combining OpenSSL with The
# Software, or a work derivative of such a combination, even if such
# copying, modification, propagation, or distribution would otherwise
# violate the terms of the GPL. You must comply with the GPL in all
# respects for all of the code used other than OpenSSL.
# "OpenSSL" means OpenSSL toolkit software distributed by the OpenSSL
# Project and licensed under the OpenSSL Licenses, or a work based on such
# software and licensed under the OpenSSL Licenses.
# "OpenSSL Licenses" means the OpenSSL License and Original SSLeay License
# under which the OpenSSL Project distributes the OpenSSL toolkit software,
# as those licenses appear in the file LICENSE-OPENSSL.

#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

case "$1" in
configure)
# Restart clearwater-infrastructure in order to trigger the
# homestead-prov-cassandra script.
service clearwater-infrastructure restart
;;

abort-upgrade|abort-remove|abort-deconfigure)
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

exit 0
11 changes: 4 additions & 7 deletions docs/Bulk-Provisioning Numbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ Bulk-Provisioning Numbers

To bulk-provision numbers, follow the following process. (There is an alternative bulk provisioning process documented [here] (https://github.com/Metaswitch/crest/blob/dev/src/metaswitch/crest/tools/sstable_provisioning/README.md) - while this is more complex to set up, it may be more suitable if you are provisioning very large sets of numbers.)

1. Log into any homestead node in your deployment.
1. Log into any Homestead Cassandra node in your deployment.
2. Create a CSV file with one row per number, and the following
columns. (If you want to quickly create a contiguous range, you can
use something like `. /etc/clearwater/config; for DN in {2010000000..2010099999} ; do echo sip:$DN@$home_domain ; done > users.csv`.)
1. Public SIP ID (mandatory)
2. Private SIP ID (optional, defaults to public SIP ID, stripping
any sip: prefix)
2. Private SIP ID (optional, defaults to public SIP ID, stripping any sip: prefix)
3. Realm (optional, defaults to domain of public SIP ID)
4. Password (optional, defaults to auto-generated random password)

Expand All @@ -29,9 +28,7 @@ done > users.csv

4. Run
`/usr/share/clearwater/crest/src/metaswitch/crest/tools/bulk_create.py users.csv` (or `users.auto.csv` if you used bulk\_autocomplete.py). If you need example call list data add the `--memento` option. If you want to store the passwords (in plaintext) of the subscribers add the `--plaintext_password` option. This will create a number of files in the current directory.
5. Run the resulting \*.create\_homestead.sh script on the homestead
node.
6. Copy the \*.create\_xdm.\* files to a homer node and run the
\*.create\_xdm.sh script there, as instructed.
5. Run the resulting \*.create\_homestead.sh script on the Homestead Cassandra node.
6. Copy the \*.create\_xdm.\* files to a Homer Cassandra node and run the \*.create\_xdm.sh script there, as instructed.
7. If you need call list data, copy the \*.create\_memento.\* files to a memento node and run the \*create\_memento.sh script there, as instructed.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# @file homer-cassandra
#
# Project Clearwater - IMS in the Cloud
# Copyright (C) 2016 Metaswitch Networks Ltd
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version, along with the "Special Exception" for use of
# the program along with SSL, set forth below. This program is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more
# details. You should have received a copy of the GNU General Public
# License along with this program. If not, see
# <http://www.gnu.org/licenses/>.
#
# The author can be reached by email at clearwater@metaswitch.com or by
# post at Metaswitch Networks Ltd, 100 Church St, Enfield EN2 6BQ, UK
#
# Special Exception
# Metaswitch Networks Ltd grants you permission to copy, modify,
# propagate, and distribute a work formed by combining OpenSSL with The
# Software, or a work derivative of such a combination, even if such
# copying, modification, propagation, or distribution would otherwise
# violate the terms of the GPL. You must comply with the GPL in all
# respects for all of the code used other than OpenSSL.
# "OpenSSL" means OpenSSL toolkit software distributed by the OpenSSL
# Project and licensed under the OpenSSL Licenses, or a work based on such
# software and licensed under the OpenSSL Licenses.
# "OpenSSL Licenses" means the OpenSSL License and Original SSLeay License
# under which the OpenSSL Project distributes the OpenSSL toolkit software,
# as those licenses appear in the file LICENSE-OPENSSL.

# Create Cassandra schema
/usr/share/clearwater/cassandra-schemas/homer.sh || /bin/true
3 changes: 0 additions & 3 deletions homer.root/usr/share/clearwater/infrastructure/scripts/homer
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,3 @@ then
s/^CASS_HOST = .*$/CASS_HOST = "'$(escape $cassandra_hostname)'"/g' < /usr/share/clearwater/homer/templates/local_settings.py >/tmp/local_settings.py.$$
mv /tmp/local_settings.py.$$ /usr/share/clearwater/homer/local_settings.py
fi

# Create Cassandra schema
/usr/share/clearwater/cassandra-schemas/homer.sh || /bin/true
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# @file homer-cassandra
#
# Project Clearwater - IMS in the Cloud
# Copyright (C) 2016 Metaswitch Networks Ltd
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version, along with the "Special Exception" for use of
# the program along with SSL, set forth below. This program is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more
# details. You should have received a copy of the GNU General Public
# License along with this program. If not, see
# <http://www.gnu.org/licenses/>.
#
# The author can be reached by email at clearwater@metaswitch.com or by
# post at Metaswitch Networks Ltd, 100 Church St, Enfield EN2 6BQ, UK
#
# Special Exception
# Metaswitch Networks Ltd grants you permission to copy, modify,
# propagate, and distribute a work formed by combining OpenSSL with The
# Software, or a work derivative of such a combination, even if such
# copying, modification, propagation, or distribution would otherwise
# violate the terms of the GPL. You must comply with the GPL in all
# respects for all of the code used other than OpenSSL.
# "OpenSSL" means OpenSSL toolkit software distributed by the OpenSSL
# Project and licensed under the OpenSSL Licenses, or a work based on such
# software and licensed under the OpenSSL Licenses.
# "OpenSSL Licenses" means the OpenSSL License and Original SSLeay License
# under which the OpenSSL Project distributes the OpenSSL toolkit software,
# as those licenses appear in the file LICENSE-OPENSSL.

# Create Cassandra schema
/usr/share/clearwater/cassandra-schemas/homestead_provisioning.sh || /bin/true
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,3 @@ then

mv /tmp/local_settings.py.$$ /usr/share/clearwater/homestead/local_settings.py
fi

# Create Cassandra schema
/usr/share/clearwater/cassandra-schemas/homestead_provisioning.sh || /bin/true
8 changes: 4 additions & 4 deletions src/metaswitch/crest/tools/sstable_provisioning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

These scripts will enable you to create a collection of sstables (Cassandra raw data) and then inject those tables directly into your Cassandra cluster.

All the scripts assume they are being run on a Homer or Homestead node with a correctly configured and balanced Cassandra cluster.
All the scripts assume they are being run on a node running the Homer or Homestead database and that the Cassandra database clusters are correctly configured and balanced.

## Pre-requisites

* The bulk provisioning binaries - automatically installed alongside Homer/Homestead to `/usr/share/clearwater/crest/tools/sstable_provisioning`
* The bulk provisioning binaries - automatically installed on Homer/Homestead database nodes to `/usr/share/clearwater/crest/tools/sstable_provisioning`
* A users CSV file - In the format output by [`bulk_autocomplete.py`](https://github.com/Metaswitch/crest/blob/dev/docs/Bulk-Provisioning%20Numbers.md)

## Disk space
Expand All @@ -17,7 +17,7 @@ _For example, on AWS, instances have ony ~4Gb free so we can only provision appr

## RAM

The [Preparing the sstables](#preparing-the-sstables) step also uses quite a lot of RAM. If you're running on a homestead or homer node, Cassandra will already be using a lot of the node's RAM. For improved performance, you can stop Cassandra for the duration of that step and restart it again afterwards. This obviously causes a service outage, and so should only be used for bulk provisioning as part of initial turn-up! To stop Cassandra, run `sudo monit stop cassandra` and to restart it run `sudo monit start cassandra`.
The [Preparing the sstables](#preparing-the-sstables) step uses quite a lot of RAM, and Cassandra will likely already be using a lot of the node's RAM. For improved performance, you can stop Cassandra for the duration of that step and restart it again afterwards. This obviously causes a service outage, and so should only be used for bulk provisioning as part of initial turn-up! To stop Cassandra, run `sudo monit stop -g cassandra` and to restart it run `sudo monit start -g cassandra`.

## Preparing the sstables

Expand All @@ -29,7 +29,7 @@ The sstables can be created either from CSV files describing each subscriber or

In the below, `<csvfilename>` refers to the filename of the users CSV file **without the suffix**, e.g. if the file were called `users.csv` then `<csvfilename>` would be `users`.

Use the python executable bundled with Homer/Homestead.
Use the python executable provided on the Homer/Homestead database node.

export PATH=/usr/share/clearwater/crest/env/bin:$PATH

Expand Down