Spinnaker is an open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence.
Перейти к файлу
Eric Wiseblatt a24001f693 Migration of runtime and development scripts.
This is a single large PR adding all the current build/install/run scripting
support.  There are a few noteworthy caveats:

1) The primary build script (build_release.py) is an interim python script.
   The intent is to replace this with a gradle build.

2) The main installation script (install_spinnaker.py) pulls the artifacts
   from a directory or storage bucket (e.g. S3 or GCS). The expectation is
   to run apt-get install spinnaker instead where the spinnaker debian package
   does similar things but with more standard packaging.

3) There are a pair of scripts to install a development environment on a
   machine (install_development.py) and set one up for a user
   (bootstrap_dev.sh). This too is interim and should become
   an apt-get install spinnaker-dev debian package.

4) There is a script to build a Google Image. It uses packer so should be
   easy to add AMIs and other platform image support. In the end, it uses
   the install script, which is independent of platform anyway.

5) There are runtime scripts for managing an instance (start/stop).
   The validate script is minimal at the moment. I'll add rules back
   in future PRs. For now it is representative. The reconfigure script
   is intended to add customizations into the settings.js that have to be
   static.

6) The pylib/yaml directory is a copy of the standard python YAML library
   that is not included by default. It is here to avoid complexity managing
   python libraries (since pip is not installed by default either) when
   there is no other need for python here.

The dev/ directory is only intended for developers (stuff available in the
spinnaker-dev packaging). The others are intended for operational runtime
environments.

The scripts support running a standard installation (in the runtime directory)
or as a developer (straight out of gradle). The developer scripts are
generally separate so they can inject a different configuration for where
to locate components.

Minimal usage as a developer[*] would be:
  mkdir build
  cd build
  ../spinnaker/dev/refresh_source.sh --github_user=<user> --pull_origin
  ../spinnaker/dev/run_dev.sh  (will build and run as a developer)

[*] Assuming you already have a machine setup.
If you dont then you could run
  spinnaker/dev/install_development.py  (to set up a machine)
  spinnaker/dev/bootstrap_dev.sh  (to setup user environments)

The bootstrap_dev.sh will create the build directory and refresh the sources
leaving you in ./build.

To use this in a production environment, you'd need to build a release.
  RELEASE_PATH=<path or storage bucket>
  ../spinnaker/dev/refresh_source.sh --pull_origin
  ../spinnaker/dev/build_release --release_path=$RELEASE_PATH

That will create and write to the RELEASE_PATH and also a
install_spinnaker.py.zip file. You can then copy that .py.zip onto
the machine you want ot install spinnaker on, then
   python install_spinnaker.py.zip \
       --package_manager \
       --release_path=$RELEASE_PATH

To complete the installation create a /root/.spinnaker/spinnaker-local.yml
file (from /opt/spinnaker/config/default-spinnaker-local.yml) and fine tune
it with your credentials and so forth. Be sure to enable a provider and
set credentials.

Then start spinnaker
   sudo /opt/spinnaker/scripts/start_spinnaker.sh
2015-10-28 20:09:00 +00:00
cassandra
config
dev
google
gradle/wrapper
install
micronolith
pylib
runtime
.gitignore
Dockerfile
README.adoc
bootstrapping-spinnaker-deployment-services.adoc
build.gradle
gradlew
gradlew.bat
settings.gradle
spinnaker-arch.png

README.adoc

= Spinnaker + Docker

This document shows how to run a local version of Spinnaker inside a docker container.

== Docker

Got Docker? Docker is easiest to run if you have a Linux server sitting around. There are multiple virtual machines available.

NOTE: It's possible to run Docker from Mac OSX, but there are a lot of wrinkles involved. This document assumes you are simply using some virtual server, like VirtualBox or VMWare.

Assuming you are running a Linux server, install docker.

=== In Ubuntu

```
$ sudo apt-get install docker.io
```

== Building a docker image of this project

With Docker installed, you are ready to build a Docker image that you can.

```
$ sudo docker build -t ubuntu:spinnaker .
```

* `sudo` - Docker commands are run as root. On a Debian derivative, you use sudo to accomplish this
* `docker build` - build a Docker container using the Dockerfile
* `-t ubuntu:spinnaker` - tag repository:name, doesn't really matter. Just pick a distinct name
* `.` - look in the this local path for the `Dockerfile`

== Launching the container

Assuming you built the image, time to launch.

```
$ sudo docker run -i -p 80 -t ubuntu:spinnaker /bin/bash
```

* `-i` - launch in interactive mode (we need this so we can fire up the application)
* `-p 80` - expose the container's port 80 to the outside world (for the external port, see below)
* `-t ubuntu:spinnaker` - tagged image to run
* `/bin/bash` - The command it launches is your shell. You'll be *root* at `/`

WARNING: No server processes will have started.

== Running Spinnaker

Time to fire it up the actual application. (HINT: You are now inside the container.)

```
#/> /opt/run.sh
```

This will launch all the components needed for Spinnaker.

== Viewing Spinnaker from the outside world

If you type `exit` from that shell, you'll not only exit the container, but you'll shut it down as well. As an alternative, open a new shell tab in the host system. Then do this:

```
$ sudo docker ps
```

You should see something like this:

```
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                   NAMES
99abb500ff0f        ubuntu:spinnaker    /bin/bash           5 seconds ago       Up 4 seconds        0.0.0.0:49153->80/tcp   jovial_heisenberg   
```

The *CONTAINER ID*, times, and *NAMES* will certainly be different. But notice the *PORTS* column. It says that if visit *localhost:49153*, it will forward that web request to the container's port *80*.

== Viewing Spinnaker from the original guest

Remember setting up Docker inside a virtual machine? If you have things configured properly, you can back up to your actual guest machine and see Spinnaker.

```
$ ifconfig -a
```

This should show the IP address of docker as well as the Linux server. Capture the Linux server's IP address.

Now go to actual guest operating system, and open a browser at *<ip address>:49153*. Ta dah!