Have the devstack-gate script rsync the workspace.

Prepare the workspace on the image to keep the rsync small.
Return error on launch if the nodes don't become ready in time.

Change-Id: Id84eb8d52ebfc2e0269b4e28d69603653b685a3b
This commit is contained in:
James E. Blair
2012-01-30 20:28:27 +00:00
parent 3567f7af52
commit fc31407932
3 changed files with 22 additions and 8 deletions

View File

@@ -77,7 +77,7 @@ if [ $RETVAL != 0 ]; then
exit $RETVAL
fi
scp -C -q -r $WORKSPACE/ $NODE_IP_ADDR:workspace
rsync -az $WORKSPACE/ $NODE_IP_ADDR:workspace/
RETVAL=$?
if [ $RETVAL != 0 ]; then
echo "Deleting host"

View File

@@ -98,11 +98,13 @@ if CLOUD_SERVERS_DRIVER == 'rackspace':
start = time.time()
timeout = 600
to_ignore = []
finished = False
while (time.time()-start) < timeout:
building_machines = [x for x in db.getMachines()
if x['state'] == vmdatabase.BUILDING]
if not building_machines:
print "Finished"
finished = True
break
provider_nodes = conn.list_nodes()
print "Waiting on %s machines" % len(building_machines)
@@ -130,3 +132,5 @@ if CLOUD_SERVERS_DRIVER == 'rackspace':
if count >= 5:
db.setMachineState(my_node['uuid'], vmdatabase.ERROR)
time.sleep(3)
if not finished:
sys.exit(1)

View File

@@ -18,13 +18,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from libcloud.base import NodeImage, NodeSize, NodeLocation
from libcloud.types import Provider
from libcloud.providers import get_driver
from libcloud.deployment import MultiStepDeployment, ScriptDeployment, SSHKeyDeployment
from libcloud.dns.types import Provider as DnsProvider
from libcloud.dns.types import RecordType
from libcloud.dns.providers import get_driver as dns_get_driver
from libcloud.compute.base import NodeImage, NodeSize, NodeLocation
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from libcloud.compute.deployment import MultiStepDeployment, ScriptDeployment, SSHKeyDeployment
import libcloud
import sys
import os
@@ -42,6 +39,12 @@ SERVER_NAME = os.environ.get('SERVER_NAME',
'devstack-oneiric.template.openstack.org')
IMAGE_NAME = os.environ.get('IMAGE_NAME', 'devstack-oneiric')
DISTRIBUTION = 'oneiric'
PROJECTS = ['openstack/nova',
'openstack/glance',
'openstack/keystone',
'openstack/python-novaclient',
'openstack-dev/devstack',
'openstack/openstack-ci']
def run_local(cmd, status=False, cwd='.', env={}):
print "Running:", cmd
@@ -165,6 +168,13 @@ for branch_data in BRANCHES:
ssh('download image %s'%fname,
'wget -c %s -O ~/cache/files/%s' % (url, fname))
ssh('clear workspace', 'rm -rf ~/workspace')
ssh('make workspace', 'mkdir -p ~/workspace')
for project in PROJECTS:
sp = project.split('/')[0]
ssh('clone %s'%project,
'cd ~/workspace && git clone https://review.openstack.org/p/%s'%project)
# TODO: remove after mysql/rabbitmq are removed from image
try:
ssh('stop mysql', 'sudo /etc/init.d/mysql stop')