Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Travis configuration to test all node types. #97

Merged
merged 15 commits into from Oct 28, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -1,32 +1,44 @@
language: python
python:
- '2.7'
# Python is not supported on OS X yet
# But a system python is installed for all workers
language: cpp

# NOTE: Make sure the matrix covers all node types in top.sls
matrix:
include:
- os: linux
env: SALT_NODE_ID=servo-master
- os: linux
env: SALT_NODE_ID=servo-linux1
- os: osx
env: SALT_NODE_ID=servo-mac1
- os: osx
env: SALT_NODE_ID=servo-macpro1
- os: linux
env: SALT_NODE_ID=linux1
- os: linux
env: SALT_NODE_ID=servo-linux-android1
- os: linux
env: SALT_NODE_ID=servo-head

before_install:
- sudo add-apt-repository -y ppa:saltstack/salt
- sudo apt-get update
- sudo apt-get install salt-master salt-minion
- sudo mkdir -p /srv/salt/states
- sudo cp .travis/minion /etc/salt/minion
- .travis/install_salt

install:
# Copy the states
- sudo cp -r . /srv/salt/states
- sudo mkdir -p /etc/salt
- sudo cp .travis/minion /etc/salt/minion
- sudo service salt-minion restart

- sudo mkdir -p /srv/salt/states
- sudo cp -r . /srv/salt/states

# Additional debug help. May fail if run before Salt finishes restarting.
# - sudo cat /var/log/salt/*

# For additional debugging, see what's in grains on a travis box
- sudo salt-call grains.items --local
# For debugging, check the grains reported by the Travis builder
- sudo salt-call --id="${SALT_NODE_ID}" grains.items

script:
# Use test pillars on Travis
# Minimally validate YAML and Jinja at a basic level
- sudo salt-call state.show_highstate --local --retcode-passthrough
- sudo salt-call --id="${SALT_NODE_ID}" --retcode-passthrough --pillar-root=.travis/test_pillars state.show_highstate
# Full on installation test
- sudo salt-call state.highstate --local
- sudo salt-call --id="${SALT_NODE_ID}" --retcode-passthrough --pillar-root=.travis/test_pillars state.highstate

notifications:
webhooks: http://build.servo.org:54856/travis
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# Ensure that pinned versions match as closely as possible

if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
printf "$0: installing salt for Linux\n"
# Travis uses Ubuntu 12.04 (Precise Pangolin)
wget -O - https://repo.saltstack.com/apt/ubuntu/ubuntu12/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
printf 'deb http://repo.saltstack.com/apt/ubuntu/ubuntu12/2015.5 precise main\n' | sudo tee -a /etc/apt/sources.list >/dev/null
sudo apt-get -y update
sudo apt-get -y install salt-minion=2015.5.6+ds-1
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
printf "$0: installing salt for Mac OS X\n"
brew update
brew install https://raw.githubusercontent.com/Homebrew/homebrew/86efec6695b019762505be440798c46d50ebd738/Library/Formula/saltstack.rb
else
printf >&2 "$0: environment variable TRAVIS_OS_NAME not set or set to unknown value\n"
exit 1
fi
@@ -0,0 +1,3 @@
buildbot:
credentials:
'slave-pass': 'TEST_BUILDBOT_SLAVE_PASS'
@@ -0,0 +1,13 @@
buildbot:
credentials:
'http-user': 'TEST_BUILDBOT_HTTP_USER'
'http-pass': 'TEST_BUILDBOT_HTTP_PASS'
'change-pass': 'TEST_BUILDBOT_CHANGE_PASS'
'gh-doc-token': 'TEST_BUILDBOT_GH_DOC_TOKEN'
'gh-status-token': 'TEST_BUILDBOT_GH_STATUS_TOKEN'
'gh-hook-secret': 'TEST_BUILDBOT_GH_HOOK_SECRET'
'homu-secret': 'TEST_BUILDBOT_HOMU_SECRET'
'aws-access-key': 'TEST_BUILDBOT_AWS_ACCESS_KEY'
'aws-secret-key': 'TEST_BUILDBOT_AWS_SECRET_KEY'
'minion-public-key': 'TEST_BUILDBOT_MINION_PUBLIC_KEY'
'minion-private-key': 'TEST_BUILDBOT_MINION_PRIVATE_KEY'
@@ -0,0 +1,2 @@
buildbot:
master: 'TEST_BUILDBOT_MASTER'
@@ -0,0 +1,9 @@
homu:
'gh-access-token': 'TEST_HOMU_GH_ACCESS_TOKEN'
'gh-webhook-secret': 'TEST_HOMU_GH_WEBHOOK_SECRET'
'app-client-id': 'TEST_HOMU_APP_CLIENT_ID'
'app-client-secret': 'TEST_HOMU_APP_CLIENT_SECRET'
'buildbot-secret': 'TEST_HOMU_BUILDBOT_SECRET'
'buildbot-http-user': 'TEST_HOMU_BUILDBOT_HTTP_USER'
'buildbot-http-pass': 'TEST_HOMU_BUILDBOT_HTTP_PASS'
'travis-ci-token': 'TEST_HOMU_TRAVIS_CI_TOKEN'
@@ -0,0 +1,23 @@
base:
'*':
- travis
- buildbot.common

'servo-master':
- buildbot.master
- homu

'servo-(linux|mac|macpro)\d+':
- match: pcre
- buildbot.slave

'linux\d+':
- match: pcre
- buildbot.slave

'servo-linux-android\d+':
- match: pcre
- buildbot.slave

'servo-head':
- buildbot.slave
@@ -0,0 +1 @@
travis: True
@@ -13,10 +13,9 @@ started.

There are guides for some tasks available on [the
wiki](https://github.com/servo/saltfs/wiki). If you see a way that these
configurations could be improved, or try to set up your own intsance and run
configurations could be improved, or try to set up your own instance and run
into trouble, file [an issue](https://github.com/servo/saltfs/issues/new)!

## Travis

TravisCI is set up to test these configurations as described
[here](https://lambdaops.com/automation/travis/travis%20ci/configuration%20management/continuous%20integration/salt/chef/saltstack/salt%20stack/2014/01/29/travis-for-salt-states/).
TravisCI is set up to test all configurations.
@@ -0,0 +1,34 @@
# Style Guide

Style guide for Salt states (and other code) in this repo. Unfortunately,
no linter exists yet for Salt states, so there is no automated way to
check for compliance with this guide.

## Package Installation

### Use pkgs instead of name

pkg.installed, pip.installed, and any other states which install packages
should use the ```pkgs``` option instead of the ```name``` option to specify
which package(s) to install, even if there is only one package. This prevents
problems when adding another package, as in #132 (fixed in #97). Adding another
name option will cause the earlier option to be silently swallowed, which can
be hard to debug. Using pkgs from the beginning ensures correct behavior
regardless of the number of packages.

*Unsafe*:

```salt
buildbot-dependencies:
pip.installed:
- name: buildbot == 0.8.12
```

*Better*:

```salt
buildbot-dependencies:
pip.installed:
- pkgs:
- buildbot == 0.8.12
```
@@ -1,3 +1,6 @@
# Android is flaky on Travis
{% if not salt['pillar.get']('travis', False) %}

android-dependencies:
pkg.installed:
- pkgs:
@@ -17,7 +20,7 @@ android-dependencies:
- libstdc++6
- libgl1-mesa-dev
pip.installed:
- s3cmd
- name: s3cmd

android-sdk-download:
file.managed:
@@ -66,7 +69,8 @@ android-ndk-download:

android-ndk-install:
cmd.wait:
- name: /home/servo/android-ndk-r10c-linux-x86_64.bin
# Need to filter log output to avoid hitting log limits on Travis CI
- name: /home/servo/android-ndk-r10c-linux-x86_64.bin | grep -v Extracting
- user: servo
- watch:
- file: android-ndk-download
@@ -84,3 +88,5 @@ android-ndk-toolset-configuration:
- user: servo
- group: servo
- mode: 0644

{% endif %}
@@ -1,7 +1,8 @@
buildbot:
pip.installed:
- name: buildbot == 0.8.12
- name: service_identity == 14.0.0
- pkgs:
- buildbot == 0.8.12
- service_identity == 14.0.0

txgithub:
pip.installed
@@ -12,6 +13,8 @@ boto:
buildbot-master:
service.running:
- enable: True
- require:
- pip: buildbot

/home/servo/buildbot/master:
file.recurse:
@@ -2,7 +2,8 @@
buildbot-slave.pip:
pip.installed:
- name: buildbot-slave == 0.8.12
- pkgs:
- buildbot-slave == 0.8.12
{{ common.servo_home }}/buildbot/slave:
file.recurse:
@@ -24,6 +24,6 @@ host-{{ hostname }}:
{% for ssh_user in config.ssh_users %}
sshkey-{{ ssh_user }}:
ssh_auth.present:
- user: {{ config.root_user }}
- user: root
- source: salt://{{ tpldir }}/ssh/{{ ssh_user }}.pub
{% endfor %}
@@ -2,7 +2,6 @@
set config = salt['grains.filter_by']({
'defaults': {
'servo_home': '/home/servo',
'root_user': 'root',
'hosts': {
'servo-master': '96.126.125.232',
'servo-linux1': '66.228.48.56',
@@ -28,8 +27,7 @@
]
},
'Darwin': {
'servo_home': '/Users/servo',
'root_user': 'administrator'
'servo_home': '/Users/servo'
}
},
base='defaults',
@@ -18,14 +18,26 @@ ttf-mscorefonts-installer:
- debconf: ttf-mscorefonts-installer
{% endif %}

{% if grains['kernel'] == 'Darwin' %}
# Workaround for https://github.com/saltstack/salt/issues/26414
servo-darwin-homebrew-versions-dependencies:
module.run:
- name: pkg.install
- pkgs:
- autoconf213
- taps:
- homebrew/versions
- require_in:
- pkg: servo-dependencies
{% endif %}

servo-dependencies:
pkg.installed:
- pkgs:
- cmake
- git
{% if grains['kernel'] == 'Darwin' %}
- pkg-config
- homebrew/versions/autoconf213
{% else %}
- libglib2.0-dev
- libgl1-mesa-dri
@@ -1,3 +1,5 @@
# NOTE: Ensure all node types are covered in .travis.yml

base:
'*':
- common
@@ -28,6 +30,5 @@ base:
- gonk-dependencies

'servo-head':
- match: pcre
- buildbot.slave
- android-dependencies
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.