From f30d7ff03306b4e9afa6d790d104eca47919ff7e Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Fri, 21 Aug 2015 05:43:50 -0400 Subject: [PATCH 01/15] Update Travis configuration to test all node types. For each node type in top.sls, check that highstate is successfully reached (no errors). This includes Linux and Mac OS X machines. --- .travis.yml | 42 ++++++++++++++++++++++++------------------ .travis/install_salt | 20 ++++++++++++++++++++ top.sls | 2 ++ 3 files changed, 46 insertions(+), 18 deletions(-) create mode 100755 .travis/install_salt diff --git a/.travis.yml b/.travis.yml index 3731eee9..d5bf9cab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,32 +1,38 @@ -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: 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 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: # 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 state.show_highstate # Full on installation test - - sudo salt-call state.highstate --local + - sudo salt-call --id="${SALT_NODE_ID}" --retcode-passthrough state.highstate notifications: webhooks: http://build.servo.org:54856/travis diff --git a/.travis/install_salt b/.travis/install_salt new file mode 100755 index 00000000..76709f5f --- /dev/null +++ b/.travis/install_salt @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then + printf "$0: installing salt for Linux\n" + # Travis uses Ubuntu 12.04 + sudo add-apt-repository -y ppa:saltstack/salt + sudo apt-get -y update + sudo apt-get -y install salt-minion +elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then + printf "$0: installing salt for Mac OS X\n" + brew update + brew install saltstack +else + if [[ -v TRAVIS_OS_NAME ]]; then + printf >&2 "$0: unknown os type ${TRAVIS_OS_NAME}\n" + else + printf >&2 "$0: environment variable TRAVIS_OS_NAME not set\n" + fi + exit 1 +fi diff --git a/top.sls b/top.sls index 8c135be3..be6414e6 100644 --- a/top.sls +++ b/top.sls @@ -1,3 +1,5 @@ +# NOTE: Ensure all node types are covered in .travis.yml + base: '*': - common From 493e0e17193186ff3b687ff13d878100bd98144e Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Fri, 21 Aug 2015 06:03:19 -0400 Subject: [PATCH 02/15] Add workarounds for missing pillar data and ancient bash. Highstate will fail because no [fake] pillar data is supplied. The bash Apple ships is too old to have the -v feature, so take it out to prevent a syntax error. --- .travis.yml | 2 +- .travis/install_salt | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index d5bf9cab..d2f2ea10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ script: # Minimally validate YAML and Jinja at a basic level - sudo salt-call --id="${SALT_NODE_ID}" --retcode-passthrough state.show_highstate # Full on installation test - - sudo salt-call --id="${SALT_NODE_ID}" --retcode-passthrough state.highstate + - sudo salt-call --id="${SALT_NODE_ID}" state.highstate notifications: webhooks: http://build.servo.org:54856/travis diff --git a/.travis/install_salt b/.travis/install_salt index 76709f5f..059db688 100755 --- a/.travis/install_salt +++ b/.travis/install_salt @@ -11,10 +11,6 @@ elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then brew update brew install saltstack else - if [[ -v TRAVIS_OS_NAME ]]; then - printf >&2 "$0: unknown os type ${TRAVIS_OS_NAME}\n" - else - printf >&2 "$0: environment variable TRAVIS_OS_NAME not set\n" - fi + printf >&2 "$0: environment variable TRAVIS_OS_NAME not set or set to unknown value\n" exit 1 fi From fdcf929976bf0db075f1d3678282ae0ed8b108e2 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Fri, 21 Aug 2015 06:25:46 -0400 Subject: [PATCH 03/15] Ensure that the /etc/salt directory exists. I believe this is needed for OS X as Homebrew appears not to make this directory. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d2f2ea10..c791887b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ before_install: - .travis/install_salt install: + - sudo mkdir -p /etc/salt - sudo cp .travis/minion /etc/salt/minion - sudo mkdir -p /srv/salt/states From 5bf03376d0ff62e7acb8c4941a63eccb5a8a4cfd Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Fri, 21 Aug 2015 10:45:41 -0400 Subject: [PATCH 04/15] Update README.md to remove outdated information. The Travis configuration has diverged significantly from the original. Also, fix a typo. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e606d283..2cd7ae5c 100644 --- a/README.md +++ b/README.md @@ -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. From 4a8eabe24801ac610707bbbc15f5b22ed1549b02 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Thu, 27 Aug 2015 17:21:33 -0400 Subject: [PATCH 05/15] Update .travis.yml for new node types in top.sls. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index c791887b..3edfd701 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,10 +11,14 @@ matrix: 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=servo-linux-android1 - os: linux env: SALT_NODE_ID=servo-head + - os: linux + env: SALT_NODE_ID=linux1 before_install: - .travis/install_salt From bd1e6958bd80134571f9fe2fe1346fbf873038cc Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Thu, 27 Aug 2015 17:58:23 -0400 Subject: [PATCH 06/15] Avoid hitting Travis CI log limits when installing NDK. The Android NDK installer has an excessive amount of log output; filter it to keep it short. --- android-dependencies.sls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android-dependencies.sls b/android-dependencies.sls index ab907e4f..1fa7c521 100644 --- a/android-dependencies.sls +++ b/android-dependencies.sls @@ -66,7 +66,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 From c4b1be5762c63efd88cdc68246890f8ec4d30d82 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Fri, 28 Aug 2015 12:04:47 -0400 Subject: [PATCH 07/15] Tell Salt to communicate with Travis properly. Pass through the return code from the actual state.highstate so Travis can report the actual build status. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3edfd701..17c3f7d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ script: # Minimally validate YAML and Jinja at a basic level - sudo salt-call --id="${SALT_NODE_ID}" --retcode-passthrough state.show_highstate # Full on installation test - - sudo salt-call --id="${SALT_NODE_ID}" state.highstate + - sudo salt-call --id="${SALT_NODE_ID}" --retcode-passthrough state.highstate notifications: webhooks: http://build.servo.org:54856/travis From 800b705a49aee50eb059d7713af7eac310720e4f Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 22 Sep 2015 16:51:00 -0400 Subject: [PATCH 08/15] Add fake pillars to resolve buildbot/homu Travis failures. --- .travis.yml | 5 +++-- .travis/test_pillars/buildbot/common.sls | 3 +++ .travis/test_pillars/buildbot/master.sls | 13 +++++++++++++ .travis/test_pillars/buildbot/slave.sls | 2 ++ .travis/test_pillars/homu.sls | 9 +++++++++ .travis/test_pillars/top.sls | 22 ++++++++++++++++++++++ top.sls | 1 - 7 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 .travis/test_pillars/buildbot/common.sls create mode 100644 .travis/test_pillars/buildbot/master.sls create mode 100644 .travis/test_pillars/buildbot/slave.sls create mode 100644 .travis/test_pillars/homu.sls create mode 100644 .travis/test_pillars/top.sls diff --git a/.travis.yml b/.travis.yml index 17c3f7d4..190c14a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,10 +34,11 @@ install: - 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 --id="${SALT_NODE_ID}" --retcode-passthrough state.show_highstate + - sudo salt-call --id="${SALT_NODE_ID}" --retcode-passthrough --pillar-root=.travis/test_pillars state.show_highstate # Full on installation test - - sudo salt-call --id="${SALT_NODE_ID}" --retcode-passthrough state.highstate + - sudo salt-call --id="${SALT_NODE_ID}" --retcode-passthrough --pillar-root=.travis/test_pillars state.highstate notifications: webhooks: http://build.servo.org:54856/travis diff --git a/.travis/test_pillars/buildbot/common.sls b/.travis/test_pillars/buildbot/common.sls new file mode 100644 index 00000000..6a044dc6 --- /dev/null +++ b/.travis/test_pillars/buildbot/common.sls @@ -0,0 +1,3 @@ +buildbot: + credentials: + 'slave-pass': 'TEST_BUILDBOT_SLAVE_PASS' diff --git a/.travis/test_pillars/buildbot/master.sls b/.travis/test_pillars/buildbot/master.sls new file mode 100644 index 00000000..4d88b689 --- /dev/null +++ b/.travis/test_pillars/buildbot/master.sls @@ -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' diff --git a/.travis/test_pillars/buildbot/slave.sls b/.travis/test_pillars/buildbot/slave.sls new file mode 100644 index 00000000..446eb141 --- /dev/null +++ b/.travis/test_pillars/buildbot/slave.sls @@ -0,0 +1,2 @@ +buildbot: + master: 'TEST_BUILDBOT_MASTER' diff --git a/.travis/test_pillars/homu.sls b/.travis/test_pillars/homu.sls new file mode 100644 index 00000000..04aa53f5 --- /dev/null +++ b/.travis/test_pillars/homu.sls @@ -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' diff --git a/.travis/test_pillars/top.sls b/.travis/test_pillars/top.sls new file mode 100644 index 00000000..e228d8d6 --- /dev/null +++ b/.travis/test_pillars/top.sls @@ -0,0 +1,22 @@ +base: + '*': + - 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 diff --git a/top.sls b/top.sls index be6414e6..c173fdc9 100644 --- a/top.sls +++ b/top.sls @@ -30,6 +30,5 @@ base: - gonk-dependencies 'servo-head': - - match: pcre - buildbot.slave - android-dependencies From fc588f0114c1c7f4604d4eeed248b347f916c9b2 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 22 Sep 2015 17:01:17 -0400 Subject: [PATCH 09/15] Fix installation of s3cmd in android-dependencies.sls --- android-dependencies.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-dependencies.sls b/android-dependencies.sls index 1fa7c521..aacfcf92 100644 --- a/android-dependencies.sls +++ b/android-dependencies.sls @@ -17,7 +17,7 @@ android-dependencies: - libstdc++6 - libgl1-mesa-dev pip.installed: - - s3cmd + - name: s3cmd android-sdk-download: file.managed: From c2ae361d98efcb2812c9f89ba36dc1d7d375eb34 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 22 Sep 2015 22:32:48 -0400 Subject: [PATCH 10/15] Fix ssh key installation on Mac OS X The username for the root account is still root, even though it is named System Administrator. --- common/init.sls | 2 +- common/map.jinja | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/common/init.sls b/common/init.sls index 1447ca14..7aa3d317 100644 --- a/common/init.sls +++ b/common/init.sls @@ -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 %} diff --git a/common/map.jinja b/common/map.jinja index 6413f834..025e472a 100644 --- a/common/map.jinja +++ b/common/map.jinja @@ -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', From 515e9af43c6fcea5c9f18faf9fb8492829f59e3f Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Wed, 23 Sep 2015 10:07:18 -0400 Subject: [PATCH 11/15] Skip Android tests because they're flaky on Travis --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 190c14a2..bd109b24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,11 @@ matrix: env: SALT_NODE_ID=servo-mac1 - os: osx env: SALT_NODE_ID=servo-macpro1 - - os: linux - env: SALT_NODE_ID=servo-linux-android1 - - os: linux - env: SALT_NODE_ID=servo-head + # Android is flaky on Travis CI, so skip android-related nodes + #- os: linux + # env: SALT_NODE_ID=servo-linux-android1 + #- os: linux + # env: SALT_NODE_ID=servo-head - os: linux env: SALT_NODE_ID=linux1 From e48294e491381a3977dc963cdb92e5ce4b846b36 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Wed, 23 Sep 2015 11:24:29 -0400 Subject: [PATCH 12/15] Skip only Android states, not nodes, on Travis Instead of skipping all node types that include Android, use the pillar to skip Android states on Travis. Providing 'travis: True' in the pillar for a node will enable skipping Android states; the key can simply be omitted if not on Travis, and Salt will fall back to running Android states by default. --- .travis.yml | 9 ++++----- .travis/test_pillars/top.sls | 1 + .travis/test_pillars/travis.sls | 1 + android-dependencies.sls | 5 +++++ 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 .travis/test_pillars/travis.sls diff --git a/.travis.yml b/.travis.yml index bd109b24..1828eb4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,13 +13,12 @@ matrix: env: SALT_NODE_ID=servo-mac1 - os: osx env: SALT_NODE_ID=servo-macpro1 - # Android is flaky on Travis CI, so skip android-related nodes - #- os: linux - # env: SALT_NODE_ID=servo-linux-android1 - #- os: linux - # env: SALT_NODE_ID=servo-head - 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: - .travis/install_salt diff --git a/.travis/test_pillars/top.sls b/.travis/test_pillars/top.sls index e228d8d6..eb0299d8 100644 --- a/.travis/test_pillars/top.sls +++ b/.travis/test_pillars/top.sls @@ -1,5 +1,6 @@ base: '*': + - travis - buildbot.common 'servo-master': diff --git a/.travis/test_pillars/travis.sls b/.travis/test_pillars/travis.sls new file mode 100644 index 00000000..baff72f9 --- /dev/null +++ b/.travis/test_pillars/travis.sls @@ -0,0 +1 @@ +travis: True diff --git a/android-dependencies.sls b/android-dependencies.sls index aacfcf92..bf7035d6 100644 --- a/android-dependencies.sls +++ b/android-dependencies.sls @@ -1,3 +1,6 @@ +# Android is flaky on Travis +{% if not salt['pillar.get']('travis', False) %} + android-dependencies: pkg.installed: - pkgs: @@ -85,3 +88,5 @@ android-ndk-toolset-configuration: - user: servo - group: servo - mode: 0644 + +{% endif %} From 81d9e63688df36777879e69d4f2b3cc30c5dcfc4 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 27 Oct 2015 16:38:04 -0400 Subject: [PATCH 13/15] Pin salt-minion version to 2015.5. 2015.8.0 causes breakage on OS x and 2015.8.1, which fixes it, is not yet available in homebrew. Use 2015.5.6 for Ubuntu 12.04 and 2015.5.5 for OS X. --- .travis/install_salt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis/install_salt b/.travis/install_salt index 059db688..9f5bcda6 100755 --- a/.travis/install_salt +++ b/.travis/install_salt @@ -1,15 +1,18 @@ #!/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 - sudo add-apt-repository -y ppa:saltstack/salt + # 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 + 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 saltstack + 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 From f61b4d8b84a8c2d0c4f490f0a2439126d33a593f Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 27 Oct 2015 18:03:50 -0400 Subject: [PATCH 14/15] Fix usage of homebrew taps When installing autoconf213 from the homebrew/versions tap, salt correct installs the package but fails to verify its installation because it compares 'homebrew/versions/autoconf213', which is the specified package name, with 'autoconf213', which is the installed package name. Use the brew.install module function as a workaround until this functionality is added to pkg.installed or pkgrepo. See: https://github.com/saltstack/salt/issues/26414 --- servo-dependencies.sls | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/servo-dependencies.sls b/servo-dependencies.sls index dd5e6344..f296edd3 100644 --- a/servo-dependencies.sls +++ b/servo-dependencies.sls @@ -18,6 +18,19 @@ 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: @@ -25,7 +38,6 @@ servo-dependencies: - git {% if grains['kernel'] == 'Darwin' %} - pkg-config - - homebrew/versions/autoconf213 {% else %} - libglib2.0-dev - libgl1-mesa-dri From 032a7cba350c002ca8fcb865010e3b74010bdcdd Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 27 Oct 2015 19:15:20 -0400 Subject: [PATCH 15/15] Fix buildbot master pip installation PR #132 added service_identity to a pip.installed state which was using name instead of pkgs because it only had one package to install (buildbot). Use pkgs instead everywhere and create a style guide. --- STYLE_GUIDE.md | 34 ++++++++++++++++++++++++++++++++++ buildbot/master.sls | 7 +++++-- buildbot/slave.sls | 3 ++- 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 STYLE_GUIDE.md diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md new file mode 100644 index 00000000..b1009d2d --- /dev/null +++ b/STYLE_GUIDE.md @@ -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 +``` diff --git a/buildbot/master.sls b/buildbot/master.sls index d4fc1c5c..481bc37c 100644 --- a/buildbot/master.sls +++ b/buildbot/master.sls @@ -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: diff --git a/buildbot/slave.sls b/buildbot/slave.sls index 05b52220..83a6e9f2 100644 --- a/buildbot/slave.sls +++ b/buildbot/slave.sls @@ -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: