2015-11-17 00:00:02 +03:00
:doctype: book
2015-11-13 10:08:12 +03:00
2015-11-17 00:11:19 +03:00
image:http://join.spinnaker.io/badge.svg[Slack Status,link=http://join.spinnaker.io]
2015-10-30 01:28:08 +03:00
2015-11-17 21:53:03 +03:00
= Using Spinnaker
If you are only interested in using Spinnaker, please refer to the main
2016-03-29 19:09:19 +03:00
Spinnaker site and http://www.spinnaker.io/docs/target-deployment-setup[Installation] guide.
2015-11-17 21:53:03 +03:00
2016-09-25 22:13:13 +03:00
If you want more information on how Spinnaker is designed, see the http://www.spinnaker.io/docs/overview[Documentation Overview].
2016-02-13 20:46:56 +03:00
2015-11-17 02:04:48 +03:00
= Setting Up Spinnaker For Development
2015-11-17 00:00:02 +03:00
2015-11-17 02:02:53 +03:00
These instructions cover pulling Spinnaker from source and setting up to run locally against Amazon Web Services and/or Google Cloud Platform accounts.
2015-10-30 01:28:08 +03:00
2016-03-29 19:09:19 +03:00
Please ensure you have set up your target environment correctly by following step 1 of the http://www.spinnaker.io/docs/target-deployment-setup[Getting Started Documentation].
2015-10-30 01:28:08 +03:00
2016-03-29 19:09:19 +03:00
If you do not wish to build from source, please follow the http://www.spinnaker.io/docs/creating-a-spinnaker-instance#section-localhost[Localhost] section of the Creating a Spinnaker Instance guide.
2015-11-17 02:02:53 +03:00
2015-11-27 22:24:18 +03:00
If you would prefer to try a container based solution, see https://github.com/spinnaker/spinnaker/tree/master/experimental/docker-compose[docker-compose installation].
2015-10-30 05:24:35 +03:00
2015-11-11 00:43:29 +03:00
These scripts are tested on:
2015-11-17 02:02:53 +03:00
2015-11-11 00:43:29 +03:00
* Ubuntu 14.04 LTS
* Mac OS X 10.11
2015-11-17 00:00:02 +03:00
== Get the bootstrap / configuration repo
2015-10-30 05:24:35 +03:00
2015-11-17 00:00:02 +03:00
[source,bash]
----
2015-10-30 01:28:08 +03:00
#export SPINNAKER_HOME=/path/to/your/Spinnaker/workspace
mkdir -p $SPINNAKER_HOME
cd $SPINNAKER_HOME
git clone git@github.com:spinnaker/spinnaker.git
2015-11-17 00:00:02 +03:00
----
2015-10-30 01:28:08 +03:00
2015-11-17 00:00:02 +03:00
== Configure your environment
2015-11-10 01:24:51 +03:00
The Spinnaker platform has a few prerequisites, which are installed as a part of this configuration process. They are:
2015-11-17 00:00:02 +03:00
* https://www.oracle.com/java/index.html[JDK8]
* http://redis.io/[Redis]
* http://cassandra.apache.org/[Cassandra]
* https://www.packer.io/[Packer]
2015-10-30 01:28:08 +03:00
2015-11-27 22:24:18 +03:00
=== Mac OS X
2015-10-30 01:28:08 +03:00
2016-03-02 21:00:25 +03:00
You need to have http://brew.sh/[homebrew] installed and ensure your version of git is above 2.0. Cassandra must be 2.1.x where x >= 11 or you must enable thrift.
2015-11-04 19:51:43 +03:00
2015-11-17 00:00:02 +03:00
[source,bash]
----
2016-05-05 18:25:01 +03:00
brew tap caskroom/cask
brew install brew-cask
2016-03-02 20:55:36 +03:00
brew install redis homebrew/versions/cassandra21 packer
2015-10-30 01:28:08 +03:00
brew cask install java
cd $SPINNAKER_HOME
2015-11-12 22:47:23 +03:00
mkdir build
cd build
../spinnaker/dev/refresh_source.sh --pull_origin --use_ssh --github_user default
2015-11-17 00:00:02 +03:00
----
2015-10-30 01:28:08 +03:00
2015-11-27 22:24:18 +03:00
=== Ubuntu Linux
2015-10-30 01:28:08 +03:00
2015-11-17 00:00:02 +03:00
[source,bash]
----
2015-10-30 01:28:08 +03:00
cd $SPINNAKER_HOME
2015-11-18 23:00:47 +03:00
spinnaker/dev/install_development.sh
2015-11-04 04:17:18 +03:00
spinnaker/dev/bootstrap_dev.sh
2015-11-17 00:00:02 +03:00
----
2015-10-30 01:28:08 +03:00
2015-11-18 06:43:57 +03:00
The `bootstrap_dev.sh` script will ask to install additional components. `gcloud`
2015-11-05 01:43:52 +03:00
is only needed to write releases to Google Cloud Storage, but is convenient
to have if you plan on using or accessing Google Cloud Platform resources
from your development environment. These could be installed at a system level
rather than user level, but the default install requires updating your path
so is performed here.
2015-11-17 00:00:02 +03:00
== Configure Spinnaker
2015-10-30 01:28:08 +03:00
2016-10-26 23:38:05 +03:00
We will create a directory for Spinnaker configuration overrides and
create an override to select the appropriate cloud provider(s).
2015-10-30 01:28:08 +03:00
2015-11-17 00:00:02 +03:00
[source,bash]
----
2015-10-30 01:28:08 +03:00
cd $SPINNAKER_HOME
mkdir -p $HOME/.spinnaker
2016-10-26 23:38:05 +03:00
touch $HOME/.spinnaker/spinnaker-local.yml
2015-10-30 05:24:35 +03:00
chmod 600 $HOME/.spinnaker/spinnaker-local.yml
2016-10-26 23:38:05 +03:00
# Ideally you only need to add the properties you want to override.
# However if you are not comfortable editing yml, you can copy the
# entire file. The difference is that you may be overriding future
# changes to default values that you otherwise would not care about.
cp spinnaker/config/spinnaker.yml $HOME/spinnaker/spinnaker-local.yml
$EDITOR $HOME/.emacs/spinnaker-local.yml
2015-11-17 00:00:02 +03:00
----
2015-10-30 01:28:08 +03:00
2015-11-27 22:24:18 +03:00
If you are deployed onto a supported cloud provider (e.g., AWS or Google) and
you only wish to deploy on that platform then you do not need to perform
additional configuration. Otherwise, edit `$HOME/.spinnaker/spinnaker-local.yml`
and set the enabled option for the cloud provider(s) of your choice and
configure the attributes for that provider.
2015-11-18 23:00:47 +03:00
2015-11-17 00:00:02 +03:00
== Start Spinnaker Services
2015-10-30 01:28:08 +03:00
2015-11-27 22:24:18 +03:00
If you're running on Mac OS X, please make sure that your Redis and Cassandra
servers are up and running. Make sure that `cqlsh` is accessible in your path
and you can connect to Cassandra by calling `cqlsh` in your terminal.
2015-11-12 21:30:02 +03:00
2015-11-17 00:00:02 +03:00
[source,bash]
----
2015-11-04 04:21:54 +03:00
cd $SPINNAKER_HOME/build
../spinnaker/dev/run_dev.sh [service]
2015-11-17 00:00:02 +03:00
----
2015-10-30 01:28:08 +03:00
2015-10-30 05:24:35 +03:00
If a service is provided, then just that one service will be started.
If no service is provided, then all the services will be started
2015-11-27 22:24:18 +03:00
(including Redis and Cassandra unless they are specified with a remote host).
2015-10-30 05:24:35 +03:00
If a service is already running (even if not yet available) then it will
not be restarted.
2015-11-27 22:24:18 +03:00
*Note* `run_dev.sh` might get stuck waiting on a service to start. Hitting
CTRL-C just stops the waiting on service, it doesn't terminate the services. If
it seems stuck, stop and restart `run_dev.sh`.
2015-10-30 01:28:08 +03:00
2015-11-17 00:00:02 +03:00
== Stop Spinnaker Services
[source,bash]
----
2015-11-04 04:21:54 +03:00
cd $SPINNAKER_HOME/build
../spinnaker/dev/stop_dev.sh [service]
2015-11-17 00:00:02 +03:00
----
2015-10-30 01:28:08 +03:00
2015-10-30 05:24:35 +03:00
If a service is provided, then just that one service will be stopped.
If no service is provided then all the spinnaker services will be stopped.
2015-11-27 22:24:18 +03:00
Cassandra and Redis are not affected by `stop_dev.sh`.