Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Apache

...

CloudStack's

...

DevCloud

...

appliance

...

is

...

used

...

today

...

to

...

deploy

...

a

...

basic

...

zone

...

CloudStack

...

environment.

...

Within

...

this

...

DevCloud

...

appliance

...

we

...

run

...

basic

...

integration

...

tests

...

to

...

ensure

...

that

...

essential

...

functionality

...

isn't

...

broken

...

by

...

the

...

rapid

...

checkin

...

process.

...

This

...

page

...

lists

...

the

...

details

...

on

...

how

...

these

...

workers

...

are

...

setup

...

with

...

our

...

continuous

...

integration

...

system.

...

Table of Contents

DevCloud (XenServer

...

-

...

basic)

...

The

...

XCP-based

...

DevCloud

...

is

...

capable

...

of

...

deploying

...

a

...

basic

...

zone

...

CloudStack

...

environment.

...

We've

...

patched

...

this

...

appliance

...

with

...

a

...

clone

...

of

...

the

...

incubator-CloudStack

...

ASF

...

repo

...

and

...

our

...

test

...

utilities

...

(marvin,

...

cloudmonkey)

...

and

...

created

...

a

...

'

...

testcloud

...

'

...

appliance.

...

The

...

following

...

workflow

...

explains

...

the

...

way

...

tests

...

are

...

run

...

within

...

the

...

appliance:

...

Workflow

The testcloud appliance contains an init script at /etc/init.d/DevCloud

...

that

...

will

...

start

...

up

...

a

...

testrunner

...

process

...

when

...

the

...

appliance

...

boots.

...

Following

...

this

...

the

...

testrunner

...

will

...

perform

...

the

...

necessary

...

setup

...

to

...

prepare

...

a

...

basic

...

zone

...

CloudStack

...

management

...

server.

...

  1. The

...

  1. test

...

  1. runner

...

  1. fetches

...

  1. the

...

  1. latest

...

  1. HEAD

...

  1. (currently

...

  1. set

...

  1. to

...

  1. master)

...

  1. from

...

  1. the

...

  1. git

...

  1. repository

...

  1. and

...

  1. builds

...

  1. CloudStack.

...

  1. In

...

  1. other

...

  1. words

...

  1. -

...

  1. mvn

...

  1. install

...

  1. This

...

  1. is

...

  1. followed

...

  1. by

...

  1. an

...

  1. installation

...

  1. of

...

  1. marvin

...

  1. so

...

  1. we

...

  1. have

...

  1. the

...

  1. latest

...

  1. API's

...

  1. available

...

  1. via

...

  1. the

...

  1. test

...

  1. framework

...

  1. Further

...

  1. on

...

  1. the

...

  1. client

...

  1. inside

...

  1. a

...

  1. jetty:run

...

  1. will

...

  1. start

...

  1. up

...

  1. a

...

  1. management

...

  1. server

...

  1. process

...

  1. and

...

  1. have

...

  1. the

...

  1. API

...

  1. server

...

  1. listening

...

  1. for

...

  1. requests

...

  1. We

...

  1. then

...

  1. configure

...

  1. this

...

  1. management

...

  1. server

...

  1. with

...

  1. the

...

  1. basic

...

  1. zone

...

  1. DevCloud

...

  1. configuration

...

  1. with

...

  1. one

...

  1. XCP

...

  1. host

...

  1. and

...

  1. local

...

  1. storage.

...

  1. i.e.,

...

  1. the

...

  1. config

...

  1. at

...

  1. tools/DevCloud/DevCloud.cfg

...

  1. Once

...

  1. we

...

  1. have

...

  1. the

...

  1. basic

...

  1. zone

...

  1. running

...

  1. we

...

  1. will

...

  1. do

...

  1. a

...

  1. basic

...

  1. health

...

  1. check

...

  1. that

...

  1. verifies

...

  1. the

...

  1. following

...

    1. All

...

    1. system

...

    1. VM's

...

    1. have

...

    1. come

...

    1. up

...

    1. and

...

    1. are

...

    1. successfully

...

    1. 'Running'

...

    1. All

...

    1. the

...

    1. featured

...

    1. templates

...

    1. (built-in)

...

    1. are

...

    1. in

...

    1. Ready

...

    1. (downloaded)

...

    1. state

...

  1. If

...

  1. the

...

  1. health

...

  1. check

...

  1. succeeds

...

  1. the

...

  1. environment

...

  1. is

...

  1. ready

...

  1. to

...

  1. run

...

  1. tests
  2. nose's testrunner with the marvin plugin will collect all the tests marked with the attribute of 'DevCloud' @attr(tags='DevCloud')

...

  1. ,

...

  1. put

...

  1. them

...

  1. in

...

  1. a

...

  1. suite

...

  1. and

...

  1. run

...

  1. them

...

    1. The

...

    1. nose

...

    1. xUnit

...

    1. plugin

...

    1. gives

...

    1. us

...

    1. the

...

    1. XML

...

    1. output

...

    1. for

...

    1. consumption

...

    1. into

...

    1. jenkins

...

  1. Management

...

  1. Server

...

  1. log,

...

  1. logs

...

  1. from

...

  1. the

...

  1. test

...

  1. appliance's

...

  1. init

...

  1. script

...

  1. and

...

  1. the

...

  1. test

...

  1. results

...

  1. are

...

  1. posted

...

  1. to

...

  1. the

...

  1. machine

...

  1. hosting

...

  1. the

...

  1. 'testcloud'

...

  1. appliance

...

  1. and

...

  1. held

...

  1. as

...

  1. artifacts

...

  1. on

...

  1. the

...

  1. jenkins

...

  1. job

...

  1. for

...

  1. troubleshooting

...

  1. and

...

  1. held

...

  1. as

...

  1. artifacts

...

  1. on

...

  1. the

...

  1. jenkins

...

  1. job

...

  1. for

...

  1. troubleshooting

...

  1. A

...

  1. jenkins

...

  1. slave

...

  1. agent

...

  1. within

...

  1. the

...

  1. host

...

  1. will

...

  1. send

...

  1. through

...

  1. the

...

  1. results

...

  1. and

...

  1. logs

...

  1. to

...

  1. the

...

  1. jenkins

...

  1. master

...

  1. at

...

  1. jenkins.c.o

...

Test

...

Workers

...

The

...

host

...

machine

...

is

...

a

...

Ubuntu

...

server

...

with

...

VirtualBox

...

4.2

...

installed

...

with

...

guest

...

additions.

...

VirtualBox

...

performs

...

DHCP

...

for

...

the

...

'testcloud'

...

workers

...

that

...

it

...

spins

...

up.

...

The

...

testcloud

...

image

...

itself

...

is

...

cloned

...

into

...

multiple

...

test

...

workers

...

(currently

...

5).

...

A

...

simple

...

scheduler

...

will

...

pick

...

up

...

an

...

idle

...

worker

...

VM

...

on

...

trigger

...

from

...

jenkins

...

master

...

that

...

is

...

polling

...

for

...

commits

...

on

...

the

...

git:repo.

...

Once

...

picked

...

up

...

each

...

worker

...

will

...

perform

...

all

...

the

...

tests

...

and

...

post

...

the

...

results

...

back

...

to

...

the

...

gateway/DHCP

...

which

...

in

...

our

...

case

...

is

...

the

...

host

...

machine

...

running

...

VirtualBox.

...

A

...

jenkins

...

slave

...

runs

...

in

...

headless

...

mode

...

on

...

the

...

host

...

machine

...

and

...

posts

...

results

...

back

...

to

...

jenkins

...

master.

...

After

...

the

...

testworker

...

has

...

done

...

its

...

job

...

and

...

posted

...

its

...

results

...

back

...

to

...

jenkins

...

we

...

wait

...

for

...

a

...

timeout

...

(1800s)

...

to

...

release

...

it

...

back

...

to

...

the

...

pool

...

of

...

workers.

...

To

...

clean

...

up

...

the

...

image

...

of

...

any

...

remnants

...

from

...

the

...

previous

...

test

...

run

...

the

...

worker

...

is

...

restored

...

to

...

a

...

base

...

snapshot

...

keeping

...

the

...

environment

...

clean

...

for

...

the

...

subsequent

...

run.

...

Code

...


When

...

we

...

change

...

mvn

...

instructions

...

for

...

building

...

CloudStack

...

and/or

...

the

...

tests

...

that

...

need

...

to

...

run

...

the

...

testrunner

...

process

...

will

...

fetch

...

the

...

latest

...

version

...

of

...

itself

...

from

...

a

...

github

...

repo

...

running

...

DevCloud-ci.

...

This

...

is

...

useful

...

so

...

we

...

don't

...

change

...

the

...

image

...

of

...

the

...

testcloud

...

appliance

...

when

...

our

...

build

...

process

...

changes.

...

All

...

the

...

code

...

is

...

hosted

...

on

...

github

...

.

...

Feel

...

free

...

to

...

fork

...

it,

...

play

...

around

...

with

...

it

...

and

...

contribute

...

to

...

making

...

it

...

an

...

effective

...

tool

...

for

...

automating

...

our

...

tests.

...

Comments

...

and

...

Suggestions

...

welcome

...

on

...

the

...

CloudStack-dev@i.a.o

...

lists

...

Jenkins

...

Job

...

The

...

jenkins

...

job

...

is

...

a

...

vanilla

...

job

...

enabled

...

with

...

JUnit

...

reports.

...

E-mail

...

will

...

be

...

enabled

...

to

...

CloudStack-commits@i.a.o

...

Setup

The setup is a single machine with 4 core CPU, 8GB RAM and 500GB of hard disk space. Installed with Ubuntu 12.04 LTS - Server Edition.

Following additional packages are installed: VirtualBox 4.2.4,

...

VirtualBox

...

4.2.4

...

-

...

Extension

...

Pack,

...

VirtualBox

...

Guest

...

additions

...

1.

...

create

...

a

...

jenkins

...

user

...

on

...

this

...

machine

...

that

...

will

...

run

...

a

...

jenkins-slave

...

service

...

which

...

will

...

interact

...

with

...

jenkins

...

master

...

to

...

trigger

...

the

...

test

...

runs

...

and

...

send

...

test

...

reports.

...

you'll

...

need

...

access

...

to

...

add

...

nodes

...

and

...

create

...

jobs

...

on

...

the

...

jenkins

...

CI.

...

once

...

the

...

node

...

is

...

setup

...

and

...

the

...

slave

...

is

...

connected

...

you

...

are

...

ready

...

to

...

schedule

...

jobs.

...

2.

...

modify

...

the

...

default

...

network

...

in

...

VirtualBox

...

to

...

perform

...

DHCP

...

as

...

follows

...

and

...

enable

...

the

...

DHCP server

Code Block
 server

{newcode}vboxmanage dhcpserver modify --netname HostInterfaceNetworking-vboxnet0 --ip 192.168.56.1 --netmask 255.255.255.0 --lowerip 192.168.56.101 --upperip 192.168.56.254{newcode}

3.

...

wget

...

the

...

testcloud

...

appliance

...

to

...

your

...

server.

...

The

...

appliance

...

is

...

pre-seeded

...

with

...

the

...

init

...

script

...

that

...

will

...

launch

...

the

...

test

...

runner

...

and

...

configure

...

CloudStack.

...

import

...

the

...

appliance

...

into

...

VirtualBox

...

to

...

change

...

the

...

default

...

credentials

...

in

...

the

...

script

...

to

...

suit

...

those

...

of

...

your

...

jenkins

...

user.

Code Block


{newcode}vboxmanage import testcloud.ova --vsys 0 --eula accept --vsys 0 --vmname testcloud{newcode}

4.

...

start

...

the

...

VM

...

and

...

login

...

to DevCloud

Code Block
 DevCloud

{newcode}$ vboxmanage startvm testcloud --type headless{newcode}

and

...

change

...

the

...

password

...

in

...

the

...

/etc/init.d/DevCloud

...

init script

Code Block
 script

{newcode}28       python $SCRIPTDIR/setUpTestWorker.py --host 192.168.56.1 --user jenkins --pass yourpassword --out /var/lib/jenkins/reports{newcode}

and

...

then

...

reinitialize

...

the

...

system-V service

Code Block
 service

{newcode}$ update-rc.d DevCloud defaults{newcode}

5.

...

stop

...

the

...

VM

...

and

...

export

...

it

...

as

...

an

...

appliance

...

out

...

of

...

which

...

we

...

will

...

create

...

further

...

test

...

workers.

Code Block


{newcode}$ vboxmanage controlvm testcloud poweroff
$ vboxmanage export testcloud --output testcloudworker.ova{newcode}

6.

...

import

...

the

...

appliance

...

in

...

to

...

virtual

...

box

...

again

...

but

...

creating

...

as

...

many

...

workers

...

as

...

you

...

need.

Code Block


{newcode}$for i in {1..5}; do vboxmanage import testcloudworker.ova --vsys 0 --eula accept --vsys 0 --vmname testworker$i; done{newcode}

7.

...

create

...

a

...

base

...

snapshot

...

that

...

will

...

be

...

restored

...

to

...

after

...

the

...

testworker

...

VM

...

has

...

finished

...

running

...

a

...

test.

...

This

...

is

...

to

...

restore

...

the

...

appliance

...

to

...

its

...

clean

...

state

...

for

...

the

...

next

...

test run

Code Block
 run

{newcode}$for i in {1..5}; do vboxmanage snapshot testworker$i take testworkerbase$i; done{newcode}

8.

...

your

...

workers

...

are

...

now

...

ready

...

to

...

be

...

used

...

and

...

connected

...

to

...

the

...

jenkins

...

job.

...

The

...

jenkins

...

scheduler

...

script

...

is

...

available

...

on

...

the

...

github

...

repo

...

as

...

ci/scripts/schedulerun.sh

Code Block


{newcode}jenkins@apache-81-1:~$ vboxmanage list vms
"testworker1" {e6b5924b-efac-40cf-9621-3bb0b4683ab9}
"testworker2" {070da3d1-4e09-4171-9ec0-17c10d8ca425}
"testworker3" {dff3a63c-32ac-4631-aae1-66837a049fb0}
"testworker4" {931baa82-1b37-460e-a500-7764a3ee38dd}
"testworker5" {0bdd381d-bfc0-4b8e-8bbc-908fbe7b4710}{newcode}

h4. 

TODO's

...

and

...

FIXME's

...

1.

...

Speed

...

up

...

the

...

mvn

...

clean

...

install

...

step

...

with

...

a

...

local

...

nexus

...

proxy/maven

...

cache.

...

Currently

...

this

...

eats

...

up

...

around

...

5m

...

2.

...

The

...

logs

...

should

...

continuously

...

write

...

to

...

a

...

remote

...

syslog

...

appender

...

on

...

the

...

virtual

...

box

...

gateway.

...

We

...

shouldn't

...

depend

...

on

...

test

...

worker

...

process

...

to

...

complete

...

each

...

time.

...

3.

...

Draft

...

a

...

proposal

...

for

...

moving

...

this

...

to

...

builds.a.o

...

DevCloud (KVM

...

-

...

advanced)

...

WIP:

...

We

...

intend

...

to

...

do

...

the

...

same

...

for

...

a

...

KVM

...

based

...

DevCloud

...

environment

...

to

...

so

...

as

...

to

...

test

...

any

...

functionality

...

that

...

is

...

essential

...

for

...

advanced

...

zone

...

CloudStack

...

deployments.

...