From 8bc108140e898f851b4e74baebef413fd9596f9c Mon Sep 17 00:00:00 2001 From: Joshua Hesketh Date: Wed, 17 Dec 2014 14:55:53 +1100 Subject: [PATCH] Set up venv for zuul-swift-logs Set up a venv for zuul-swift-logs and install its dependencies (python-magic) there instead of as system packages. For DIB use 90 as uploading logs may be considered more important than installing zuul. Change-Id: Id0fc01729853e65c81cdd50e4ffa4d0d6de00ae9 --- .../install.d/90-venv-swift-logs | 21 +++++++++++++++++++ nodepool/scripts/prepare_node.sh | 8 +++++++ 2 files changed, 29 insertions(+) create mode 100644 nodepool/elements/nodepool-base/install.d/90-venv-swift-logs diff --git a/nodepool/elements/nodepool-base/install.d/90-venv-swift-logs b/nodepool/elements/nodepool-base/install.d/90-venv-swift-logs new file mode 100644 index 0000000000..822d4e1831 --- /dev/null +++ b/nodepool/elements/nodepool-base/install.d/90-venv-swift-logs @@ -0,0 +1,21 @@ +#!/bin/bash -xe +# Copyright (C) 2015 Rackspace Australia +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. + +# Create a virtualenv for zuul-swift-logs +# This is in /usr instead of /usr/local due to this bug on precise: +# https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588 +# Be explicit about the Python version since py3k-precise nodes default +# to using 3.3 with virtualenv. +sudo -H virtualenv -p python2 /usr/zuul-swift-logs-env +sudo -H /usr/zuul-swift-logs-env/bin/pip install python-magic diff --git a/nodepool/scripts/prepare_node.sh b/nodepool/scripts/prepare_node.sh index 7a170490a1..03b0ef492c 100755 --- a/nodepool/scripts/prepare_node.sh +++ b/nodepool/scripts/prepare_node.sh @@ -163,5 +163,13 @@ sudo virtualenv -p python2 /usr/zuul-env sudo -H /usr/zuul-env/bin/pip install /tmp/zuul sudo rm -fr /tmp/zuul +# Create a virtualenv for zuul-swift-logs +# This is in /usr instead of /usr/local due to this bug on precise: +# https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588 +# Be explicit about the Python version since py3k-precise nodes default +# to using 3.3 with virtualenv. +sudo -H virtualenv -p python2 /usr/zuul-swift-logs-env +sudo -H /usr/zuul-swift-logs-env/bin/pip install python-magic + sync sleep 5