groovy devops in the cloud for openslava 2014
TRANSCRIPT
![Page 1: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/1.jpg)
01
![Page 2: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/2.jpg)
About me02
![Page 3: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/3.jpg)
Andrey AdamovichBio: Developer, coach, speaker, author
Company: Aestas/IT (http://aestasit.com)
E-mail: [email protected]
Linkedin: http://www.linkedin.com/in/andreyadamovich
Twitter: @aestasit
•••••
03
![Page 4: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/4.jpg)
What's this presentation about?Our take on:
DevOps
Intrastructure Provisioning
Continuous Integration
Continuous Delivery
••••
04
![Page 5: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/5.jpg)
TechnologiesGroovy - http://groovy.codehaus.org
Gradle - http://gradle.org
Jenkins - http://jenkins-ci.org
Puppet - http://puppetlabs.com
AWS - http://aws.amazon.com
•••••
05
![Page 6: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/6.jpg)
Developers +Operations =
?06
![Page 7: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/7.jpg)
Silos
07
![Page 8: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/8.jpg)
Conflicts08
![Page 9: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/9.jpg)
Risk
09
![Page 10: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/10.jpg)
Agile
10
![Page 11: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/11.jpg)
What is DevOps?
11
![Page 12: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/12.jpg)
C.A.M.S.Culture : People over processes and tools. Software is made by and
for people.
Automation : Automation is essential for DevOps to gain quick
feedback.
Measurement : DevOps finds a specific path to measurement. Quality
and shared (or at least aligned) incentives are critical.
Sharing : Creates a culture where people share ideas, processes, and
tools.
•
•
•
•
12
![Page 13: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/13.jpg)
It's not abouttools!
13
![Page 14: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/14.jpg)
It's aboutculture!
14
![Page 15: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/15.jpg)
We startedwith the tools!
15
![Page 16: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/16.jpg)
Infrastructure as codeAutomate the provisioning and maintenance of servers:
Build from source control
Utilize existing tools
Ensure testability
•••
16
![Page 17: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/17.jpg)
Configuration propagation
17
![Page 18: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/18.jpg)
Configuration propagation
18
![Page 19: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/19.jpg)
ChangesImagine manually uploading *.class files and repackaging JAR
directly on production servers when you have an urgent code change.
19
![Page 20: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/20.jpg)
Deploymentis automatic!
20
![Page 21: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/21.jpg)
And, so,should be...
21
![Page 22: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/22.jpg)
infrastructureconfiguration
changes!22
![Page 23: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/23.jpg)
No manualchanges!
23
![Page 24: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/24.jpg)
Building an automation toolkitAutomation is key
We are JVM hackers
Fragmented ecosystem
•••
24
![Page 25: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/25.jpg)
Initial toolsetGradle
Groovy
Ant
Python/WLST
Shell scripts
•••••
25
![Page 26: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/26.jpg)
Required toolingInfrastructure connectivity
Infrastructure provisioning
Infrastructure virtualization
Infrastructure testing
••••
26
![Page 27: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/27.jpg)
First Blood27
![Page 28: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/28.jpg)
Ant + Gradleant.taskdef(
name: 'scp',
classname: 'o.a.t.a.t.o.ssh.Scp',
classpath: configurations.secureShell.asPath)
ant.taskdef(
name: 'sshexec',
classname: 'o.a.t.a.t.o.ssh.SSHExec',
classpath: configurations.secureShell.asPath)
01.
02.
03.
04.
05.06.
07.
08.
09.
28
![Page 29: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/29.jpg)
Simple callant.sshexec(
host: host,
username: user,
password: password,
command: command,
trust: 'true',
failonerror: failOnError)
01.
02.
03.
04.
05.
06.
07.
29
![Page 30: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/30.jpg)
Next step: wrapper functiondef ssh(String command,
Properties props,
boolean failOnError = false,
String suCommandQuoteChar = "'",
String outputProperty = null) {
...
}
01.
02.
03.
04.
05.
06.
07.
30
![Page 31: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/31.jpg)
Next step: wrapper functiondef scp(String file,
String remoteDir,
Properties props) {
...
}
01.
02.
03.
04.
05.
31
![Page 32: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/32.jpg)
Task example Itask installFonts << {
forAllServers { props ->
ssh('yes | yum install *font*', props)
}
}
01.
02.
03.
04.
05.
32
![Page 33: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/33.jpg)
Task example IItask uninstallNginx << {
forAllServers { props ->
ssh('/etc/init.d/nginx stop', props)
ssh('yes | yum remove nginx', props, true)
ssh('rm -rf /etc/yum.repos.d/nginx.repo', props)
ssh('rm -rf /var/log/nginx', props)
ssh('rm -rf /etc/nginx /var/nginx', props)
}
}
01.
02.
03.
04.
05.
06.
07.
08.
09. 33
![Page 34: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/34.jpg)
DrawbacksNew connection each time
Excplicit repeating parameters
Complex scripts are hard to maintain
Tasks are not idempotent
••••
34
![Page 35: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/35.jpg)
Sshoogr
35
![Page 36: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/36.jpg)
Sshoogr featuresGroovy-based SSH DSL for:
Remote command execution
File uploading/downloading
Tunneling
•••
36
![Page 37: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/37.jpg)
Why Groovy?Groovy is perfect choice for scripting
Gradle build scripts are Groovy
Very mature, concise syntax
Extremely easy to produce DSL
We wrote a book about it!
•••••
37
![Page 38: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/38.jpg)
Shameless plug
38
![Page 39: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/39.jpg)
Sshoogr usage (import)@Grab(
group='com.aestasit.infrastructure.sshoogr',
module='sshoogr',
version='0.9.16')
import static com.aestasit.ssh.DefaultSsh.*
01.
02.
03.
04.
05.
39
![Page 40: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/40.jpg)
Sshoogr usage (defaults)defaultUser = 'root'
defaultKeyFile = new File('secret.pem')
execOptions {
verbose = true
showCommand = true
}
01.
02.
03.
04.
05.
06.
40
![Page 41: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/41.jpg)
Sshoogr usage (connection)remoteSession {
url = 'user2:654321@localhost:2222'
exec 'rm -rf /tmp/*'
exec 'touch /var/lock/my.pid'
remoteFile('/var/my.conf').text = "enabled=true"
}
01.
02.
03.
04.
05.
06.
41
![Page 42: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/42.jpg)
Sshoogr usage (multi-line content)remoteFile('/etc/yum.repos.d/puppet.repo').text = '''
[puppet]
name=Puppet Labs Packages
baseurl=http://yum.puppetlabs.com/el/
enabled=0
gpgcheck=0
'''
01.
02.
03.
04.
05.
06.
07.
42
![Page 43: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/43.jpg)
Sshoogr usage (file copying)remoteSession {
scp {
from { localDir "$buildDir/application" }
into { remoteDir '/var/bea/domain/application' }
}
}
01.
02.
03.
04.
05.
06.
43
![Page 44: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/44.jpg)
Sshoogr usage (command result)def result = exec(command: '/usr/bin/mycmd',
failOnError: false, showOutput: false)
if (result.exitStatus == 1) {
result.output.eachLine { line ->
if (line.contains('WARNING')) {
throw new RuntimeException("Warning!!!")
}
}
}
01.
02.
03.
04.
05.
06.
07.
08.
09. 44
![Page 45: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/45.jpg)
Sshoogr usage (shortcuts)if (ok('/usr/bin/mycmd')) {
...
}
if (fail('/usr/bin/othercmd')) {
...
}
01.
02.
03.
04.
05.
06.
45
![Page 46: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/46.jpg)
Sshoogr usage (tunnels)tunnel('1.2.3.4', 8080) { int localPort ->
def url = "http://localhost:${localPort}/flushCache"
def result = new URL(url).text
if (result == 'OK') {
println "Cache is flushed!"
} else {
throw new RuntimeException(result)
}
}
01.
02.
03.
04.
05.
06.
07.
08.
09. 46
![Page 47: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/47.jpg)
Sshoogr usage (prefix/suffix)prefix('sudo ') {
exec 'rm -rf /var/log/abc.log'
exec 'service abc restart'
}
suffix(' >> output.log') {
exec 'yum -y install nginx'
exec 'yum -y install mc'
exec 'yum -y install links'
}
01.
02.
03.
04.
05.
06.
07.
08.
09. 47
![Page 48: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/48.jpg)
Still problemsComplex scripts are still not easy to maintain
Scripts are usually not idempotent••
48
![Page 49: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/49.jpg)
Puppet49
![Page 50: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/50.jpg)
Why Puppet?More mature than competition
Large community
Readable DSL
Good acceptance from DEVs and OPs
No need to learn Ruby ;)
•••••
50
![Page 51: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/51.jpg)
Puppet example
51
![Page 52: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/52.jpg)
Puppet provisioning
52
![Page 53: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/53.jpg)
Puppet provisioning
53
![Page 54: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/54.jpg)
Puppet provisioning
54
![Page 55: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/55.jpg)
Puppet provisioning
55
![Page 56: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/56.jpg)
Puppet state management
56
![Page 57: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/57.jpg)
Puppet state management
57
![Page 58: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/58.jpg)
Puppet state management
58
![Page 59: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/59.jpg)
Puppet modules
59
![Page 60: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/60.jpg)
Puppet modules
60
![Page 61: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/61.jpg)
Puppet modules
61
![Page 62: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/62.jpg)
Sshoogr +Gradle +Puppet62
![Page 63: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/63.jpg)
Upload modulestask uploadModules << {
remoteSession {
exec 'rm -rf /tmp/repo.zip'
scp {
from { localFile "${buildDir}/repo.zip" }
into { remoteDir "/root" }
}
...
01.
02.
03.
04.
05.
06.
07.
08.
63
![Page 64: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/64.jpg)
Upload modules ...
exec 'rm -rf /etc/puppet/modules'
exec 'unzip /tmp/repo.zip -d /etc/puppet/modules'
}
}
01.
02.
03.
04.
05.
64
![Page 65: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/65.jpg)
Apply manifeststask puppetApply(dependsOn: uploadModules) << {
remoteSession {
scp {
from { localFile "${buildDir}/setup.pp" }
into { remoteDir "/tmp" }
}
exec 'puppet apply /tmp/setup.pp'
}
}
01.
02.
03.
04.
05.
06.
07.
08.
09. 65
![Page 66: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/66.jpg)
What we solved?Separated infrastructure state description and operations tasks
Scripts became more maintainable and idempotent••
66
![Page 67: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/67.jpg)
In the meanwhile...We started developing complex/generic Puppet modules
Modules need proper testing
...on different platforms
•••
67
![Page 68: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/68.jpg)
Do you test, right?How to test this stuff?
How to reuse a JUnit approach to testing?
We wanted things to be SIMPLE!
•••
68
![Page 69: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/69.jpg)
PUnit
69
![Page 70: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/70.jpg)
PUnitSimple testing tool for verifying remote server state
Uses Sshoogr and JUnit
Reuse reporting features of JUnit
As simple as ...
••••
70
![Page 71: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/71.jpg)
PUnit example (derby)class DerbyInstallTest
extends BasePuppetIntegrationTest {
@Before
void installDerby() {
apply("include derby")
}
...
}
01.
02.
03.
04.
05.
06.
07.
08.
71
![Page 72: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/72.jpg)
PUnit example (derby)@Test
void ensureDerbyRunning() {
command('service derby status > derbystatus.log')
assertTrue fileText("/root/derbystatus.log")
.contains('Derby')
assertTrue fileText("/root/derbystatus.log")
.contains('is running.')
}
01.
02.
03.
04.
05.
06.
07.
08.
72
![Page 73: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/73.jpg)
PUnit example (derby)@Test
void ensureCanConnect() {
Thread.sleep(10000)
uploadScript()
command('/opt/derby/db-derby-10.9.1.0-bin/bin/ij ' +
'testDataScript.sql > derbytest.log')
...
01.
02.
03.
04.
05.
06.
07.
73
![Page 74: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/74.jpg)
Continuous integration
74
![Page 75: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/75.jpg)
JenkinsDe-facto standard
Stable
There is a plugin for that!
•••
75
![Page 76: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/76.jpg)
Jenkins build
76
![Page 77: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/77.jpg)
Nextproblem?
77
![Page 78: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/78.jpg)
ScalabilityHow do we test on different OS?
How do we run parallel tests on multiple architectures?
How do we avoid selling our houses?
•••
78
![Page 79: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/79.jpg)
Amazon WebServices
79
![Page 80: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/80.jpg)
Elastic Compute CloudMature
Great API
Virtual hardware variety
OS variety
••••
80
![Page 81: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/81.jpg)
Gramazon
81
![Page 82: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/82.jpg)
GramazonGroovy-based API for interacting with EC2
Integration with Gradle••
82
![Page 83: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/83.jpg)
Gramazon example Itask startInstance(type: StartInstance) {
keyName 'cloud-do'
securityGroup 'cloud-do'
instanceName 'gramazon/cloud-do'
stateFileName 'cloud-do.json'
ami 'ami-6f07e418'
instanceType 't1.micro'
waitForStart true
}
01.
02.
03.
04.
05.
06.
07.
08.
09. 83
![Page 84: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/84.jpg)
Gramazon example IItask terminateInstance(type: TerminateInstance) {
stateFileName 'cloud-do.json'
}
01.
02.
03.
84
![Page 85: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/85.jpg)
The flowStart instance(s)
Upload manifests
Run tests
Generate report
Terminate instance(s)
1.
2.
3.
4.
5.
85
![Page 86: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/86.jpg)
Next issue?86
![Page 87: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/87.jpg)
Imgr
87
![Page 88: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/88.jpg)
ImgrA tool for building images
Inspired by Packer••
88
![Page 89: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/89.jpg)
SupportsShell
Puppet••
89
![Page 90: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/90.jpg)
Configuration example
90
![Page 91: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/91.jpg)
Summary91
![Page 92: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/92.jpg)
Images, manifests, tasks
92
![Page 93: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/93.jpg)
The big picture
93
![Page 94: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/94.jpg)
Aetomation
94
![Page 95: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/95.jpg)
ConclusionsReuse your existing Java knowledge
...to build a bridge between DEVs and OPs
Reuse development best practices for OPs
Don't be afraid to try new technologies
Infrastructure configuration is outsourcable now!
Automate!
••••••
95
![Page 96: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/96.jpg)
Next steps?Create more documentation and examples
Add more DSL convience methods
Extend integration with Gradle
Add Windows connectivity/scripting support (groowin)
Define richer model for EC2 and potentially other clouds
Extend support for other provisioning tools
••••••
96
![Page 97: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/97.jpg)
Readingmaterial
97
![Page 98: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/98.jpg)
The Phoenix Project
98
![Page 99: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/99.jpg)
Continuous Delivery
99
![Page 100: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/100.jpg)
Release It
100
![Page 101: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/101.jpg)
Programming Amazon EC2
101
![Page 102: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/102.jpg)
Gradle in Action
102
![Page 103: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/103.jpg)
Groovy 2 Cookbook
103
![Page 104: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/104.jpg)
Technologies to followVagrant - http://www.vagrantup.com/
Docker - https://www.docker.io/
Packer - http://www.packer.io/
Qemu - http://wiki.qemu.org/
jclouds - http://jclouds.apache.org/
Cloudbees - http://www.cloudbees.com/
••••••
104
![Page 105: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/105.jpg)
One morething...
105
![Page 106: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/106.jpg)
It's all OpenSource!
106
![Page 107: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/107.jpg)
Source codeSshoogr: https://github.com/aestasit/sshoogr
Sshoogr Gradle: https://github.com/aestasit/sshoogr-gradle
PUnit: https://github.com/aestasit/puppet-unit
Gramazon: https://github.com/aestasit/gramazon
Imgr: https://github.com/aestasit/imgr
•••••
107
![Page 108: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/108.jpg)
Seekingcontributors!
108
![Page 109: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/109.jpg)
Questions?109
![Page 110: Groovy DevOps in the Cloud for OpenSlava 2014](https://reader035.vdocuments.us/reader035/viewer/2022062514/558be23dd8b42a29608b470b/html5/thumbnails/110.jpg)
Thank you!
110