Граф коммитов

163 Коммитов

Автор SHA1 Сообщение Дата
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
Eric Wiseblatt 0d6898782a Merge pull request #430 from ewiseblatt/0_config
Standard configuration files for a Spinnaker deployment.
2015-10-28 13:25:00 -04:00
Eric Wiseblatt ae904e8d60 Standard configuration files for a Spinnaker deployment.
These files are intended to be installed at the base of a spring config path.
The default-spinnaker-local.yml is intended to be copied into a
spinnaker-local.yml and modified for a custom deployment. The other files can
be modified as <subsystem>-local.yml as well if needed.

This PR is more about the structure and policy than the details though I
would like to get the basic namespace right. I'm primarily using "services"
but maybe this should be "spinnaker".

The spinnaker.yml file contains the system wide policy and values shared among
multiple systems. The individual system files contain the particular
configuration for a given subsystem. The namespace in the spinnaker.yml is
intentionally disjoint from those in the individual system files requiring
the systems to explicitly document their configuration -- both how it is
standard (by referencing spinnaker.yml values) and how it is non-standard
(by not referencing spinnaker.yml values).

There are future CLs that add more scripting and support of this but
fundamentally using this assumes setting the spring.config.location system
property to something like

$INSTALL/config/spinnaker.yml,\
$INSTALL/config/,\
$HOME/.spinnaker/spinnaker-local.yml,\
$HOME/.spinnaker/

Recently the module spring loader was changed to look for 'spinnaker.yml'
so the config location would be $INSTALL/config,$HOME/.spinnaker/
If the subsystems config yaml files in this PR were moved into the subsystems
themselves, then the spring location could remain the default $HOME/.spinnaker/

With this approach, users typically ovewrite a single spinnaker-local.yml file
for most needs. The spring expression language cannot handle "subtrees", only
values. Therefore configuration of repeated nodes requires overriding the
<subsystem>-local.yml in order to add the lists in. Otherwise, the
spinnaker.yml defines "primary" values and the <subsystem_local.yml provide
a list containing the "primary" value so that the spinnaker-local.yml can
still serve as a central configuration.

Deck is a different story.

I'm including a "settings.js" here as a placeholder. This is what I actively
use, but it is out of date from chris' current work. The only "interesting"
thing here is the use of variable declarations that reference the
spinnaker.yml namespace. There is a script (in a future CL) that can
substitute that block with current config values. For purposes of this CL,
the details of settings.js can be changed later without worry. It's the
policy of calling out key configuration variables that may be needed and
resolving them with a script (I'll provide later) that is of interest for
this PR.

CAVEAT:

I've been having trouble getting AWS to work.

I can get it to work using root credentials when I run out of debian packages
(on GCE) and use environment variables (with a launch script that sets them
based on the YAML file) but the same strategy does not work for gradlew runs.
The gradle runs complain that it does not know about the "default profile".
I can run out of gradle if I have an .aws/config [sic] file (e.g. from an
awscli). I can run the debian packages with an .aws/credentials file.
It seems user credentials need more attributes in clouddriver. For example a
role. However roles are not valid with root credentials and a null role is
not valid either, so it seems clouddriver-local.yml may have to exist for
maintaining aws credentials.
2015-10-28 17:17:39 +00:00
Matt Duftler 97561116da Merge pull request #431 from ewiseblatt/fix_build
Update spring config loader for changes to subsystem spring config.
2015-10-28 09:17:27 -04:00
Eric Wiseblatt ee6789891a Update spring config loader for changes to subsystem spring config.
spinnaker.yml is now built into the components to look for which
caused a conflict with injecting this resulting in files loaded
out of order.

Also modified refresh sources to monitor output rather than batching
them to avoid potential deadlock on large changes.
2015-10-28 13:10:41 +00:00
Matt Duftler fe4dde1cfd Merge pull request #428 from skim1420/unattended-upgrades
Run unattended upgrades at instance startup
2015-10-27 09:58:45 -04:00
Eric Wiseblatt 927a02f468 Merge pull request #427 from ewiseblatt/set_aws_keys
Integrated AWS configuration
2015-10-27 09:21:35 -04:00
Eric Wiseblatt 31952f367d Integrated AWS configuration
If credentials are provided in spinnaker-local.yml then set environment variables
Support transferring of an .aws/credentials file elsewhere.
Net effect is that you can use an .aws/credentials file for standard AWS
usage, but if you want to set environment variables, you can use the YML file
for that.

Also, when copying files [in create_dev] always chmod their permissions.
2015-10-27 13:20:05 +00:00
Matt Duftler 83a0780f14 Fix typo. 2015-10-26 17:03:50 -04:00
Steven Kim e02fef1104 Run unattended upgrades at instance startup 2015-10-26 20:20:28 +00:00
Eric Wiseblatt 5bd751ac81 Merge pull request #426 from ewiseblatt/typos
Various cleanups.
2015-10-24 11:36:31 -04:00
Eric Wiseblatt 395daf1f76 Various cleanups.
Propagate aws access/secret key to clouddriver

Added services.default.primaryAccountName to spinnaker.yml as a single place
to update the default account to use. This avoids spreading the choice between
aws and google throughout and localizing it to one easy-to-find place.

Added docker and dockerRegistry to spinnaker-local.

Use baseUrl for docker and jenkins to simplify local yaml

Moved "server.jenkins" fields into "server.jenkins.defaultMaster"
to clarify that it's just a single instance. Added comments throughout
where multiple values are possible but require editing the -local.yml directly.
This is a spring config limitation.

Propagate echo.enabled

Fixed settings.js syntax.
Set vpcMigrator: false

When generating deck's start_dev, put a guard around installing npm
every time. This speeds startup significantly.

Dont stop_deck when restarting all.
2015-10-24 15:34:40 +00:00
Eric Wiseblatt 78926630ea Merge pull request #425 from skim1420/dist-upgrade
Adds security updates to install and first boot
2015-10-23 16:24:54 -04:00
Steven Kim 4ec7ac74df Adds security updates to install and first boot 2015-10-23 19:58:13 +00:00
Eric Wiseblatt 26f8d1f21d Merge pull request #424 from spinnaker/typos
Typos
2015-10-23 14:59:13 -04:00
duftler 17d5474689 Typos 2015-10-23 14:58:31 -04:00
Matt Duftler dcd0570f7c Merge pull request #423 from spinnaker/fix-typo
Fix typo.
2015-10-23 14:51:03 -04:00
duftler 3d33ca0e51 Fix typo. 2015-10-23 14:50:10 -04:00
Matt Duftler 9ee355c816 Merge pull request #421 from ewiseblatt/config_address
Add default address so it's easy to bind to public IP across the board.
2015-10-23 14:46:44 -04:00
Matt Duftler 3cd71a4351 Merge pull request #422 from ewiseblatt/default_spinnaker_local
Added default-spinnaker-local.yml
2015-10-23 14:45:40 -04:00
Eric Wiseblatt 2afb036947 make default aws account 'default'. 2015-10-23 18:12:58 +00:00
Eric Wiseblatt e1eb63e490 Added default-spinnaker-local.yml
This is intended to work out of the box.
Except that the providers are disabled by default.
So there needs to be platform-level installation to turn on the appropriate
platform (where credentials are implicit).
2015-10-23 18:07:10 +00:00
Eric Wiseblatt 654fbe6c7b Add default address so it's easy to bind to public IP across the board.
Also moved serviceProtocol into services.default.protocol for encapsulation.
2015-10-23 16:44:19 +00:00
Eric Wiseblatt f7bbb32048 Merge pull request #418 from ewiseblatt/rush_yml
Fix cassandra cluster declaration in rush.
2015-10-23 12:35:07 -04:00
Eric Wiseblatt 6815da76d6 Fix cassandra cluster declaration in rush. 2015-10-23 16:28:52 +00:00
Matt Duftler 92084867f3 Merge pull request #420 from ewiseblatt/fix_tests
Fixed unit tests.
2015-10-22 09:21:38 -04:00
Matt Duftler 948a2765d5 Merge pull request #419 from ewiseblatt/fix_rundev
Pass spring location as a system parameter.
2015-10-22 09:14:46 -04:00
Matt Duftler ed7776861b Merge pull request #417 from ewiseblatt/packer_account
Fixed passthrough arguments.
2015-10-21 15:29:27 -04:00
Eric Wiseblatt d493494dd9 Fixed passthrough arguments. 2015-10-21 19:24:08 +00:00
Eric Wiseblatt c4feb443f6 Merge pull request #416 from duftler/deprecate-gcekms
Remove extraneous gcs-kms references.
2015-10-21 09:59:59 -04:00
duftler a1618fb227 Remove extraneous gcs-kms references. 2015-10-21 09:23:34 -04:00
Eric Wiseblatt f9cd70860a Fixed unit tests. 2015-10-20 22:08:38 +00:00
Eric Wiseblatt 55178fa0dc Pass spring location as a system parameter. 2015-10-20 21:34:16 +00:00
Matt Duftler db51150770 Merge pull request #414 from ewiseblatt/remove_kms
Removed gce-kms.
2015-10-20 14:19:43 -04:00
Eric Wiseblatt 7957b63ba8 Removed gce-kms. 2015-10-20 18:11:49 +00:00
Matt Duftler 24acae3d38 Merge pull request #409 from ewiseblatt/3_deck
3 deck
2015-10-20 13:54:50 -04:00
Eric Wiseblatt d935ee02d8 Convert deck settings.js to new config.
This requires reconfigure to inject the yaml settings into the javascript file.
To make this more manageable and clearer, there is a variable block at the
top of the file that is used to inject the bindings. The downside is that
this requires the variables be explicitly called out. The upside is that
the file maintains its integrity and can be regenerated.

Removed the hack from the gradle scripts, but clouddriver does not yet
start using the new configuration on gradle (but everything does work
on the production install).
2015-10-20 17:50:35 +00:00
Matt Duftler c07c5c0ed8 Merge pull request #413 from ewiseblatt/refactor_pylib
Moved pylib/*.py to pylib/spinnaker/*.py and added pylib/yaml
2015-10-20 11:38:11 -04:00
Eric Wiseblatt 30c8555d08 Moved pylib/*.py to pylib/spinnaker/*.py and added pylib/yaml
The yaml library isnt included in standard python distributions, at
least not on OS-X. pip isnt necessarily available either (it isnt on OS-X)
Rather than introducing complexity in having to install pip (and needing root
to do that) we're going to include the yaml library in here, at least for now
to keep consumption of the scripts friction-free.
2015-10-20 15:34:40 +00:00
Matt Duftler 7c92f19677 Merge pull request #412 from spinnaker/revert-411-create_dev_2
Revert "Added --master_yml"
2015-10-19 13:26:05 -04:00
Matt Duftler 4e815dd30e Revert "Added --master_yml" 2015-10-19 13:25:57 -04:00
Matt Duftler 0891b49db8 Merge pull request #411 from ewiseblatt/create_dev_2
Added --master_yml
2015-10-19 12:47:46 -04:00
Eric Wiseblatt d97ab3dd7b Added --master_yml 2015-10-19 16:46:20 +00:00
Eric Wiseblatt 4aee88ecb1 Merge pull request #410 from ewiseblatt/disk_type
Add create disk option
2015-10-19 09:38:27 -04:00
Eric Wiseblatt 06c059afef Add create disk option 2015-10-19 13:37:48 +00:00
Eric Wiseblatt 91c9fb79cd Merge pull request #406 from ewiseblatt/2_deploy_yaml
Adds in migration to new configuration.
2015-10-17 20:45:04 -04:00
Eric Wiseblatt 76b38ca947 Adds in migration to new configuration.
Add support to install/start/run with new config.

Brings up spinnaker in prod, assuming the /opt files have added
the spring.config.location

Add config/ to spring path in production and gradle

For this to work in dev, you need to say
   ../spinnaker/google/dev/refresh_sources.sh --nobuild --hack_gradle
from the build directory to change the spring path in the gradle files.
This is temporary until the files themselves are modified to accomodate
the new strategy.

The --hack_gradle is not required for production enablement.
Either old or new style is available for any release.
Except this CL requires deck be manually configured to use the new style.
2015-10-18 00:25:41 +00:00
Eric Wiseblatt 215fc72e25 Merge pull request #407 from ewiseblatt/fix_settings
Fixed settings.js
2015-10-17 19:02:22 -04:00
Matt Duftler f2b2935a3b Merge pull request #408 from ewiseblatt/fix_zip
Fixed construction of test zip files.
2015-10-17 11:18:10 -04:00
Eric Wiseblatt 2c9bfce112 Fixed construction of test zip files. 2015-10-17 15:08:07 +00:00