Skip to content

Commit 696a568

Browse files
committed
ami.json
1 parent a6d2252 commit 696a568

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ out/
1919

2020
# Runtime
2121
*.json
22+
!ami.json
2223
*.log

ami.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"variables": {
3+
"region": "us-west-2",
4+
"aws_profile": "{{env `AWS_PROFILE`}}",
5+
"iam_instance_profile": "java-json-benchmark"
6+
},
7+
"builders": [
8+
{
9+
"type": "amazon-ebs",
10+
"profile": "{{user `aws_profile`}}",
11+
"region": "{{user `region`}}",
12+
"source_ami_filter": {
13+
"filters": {
14+
"name": "amzn-ami-hvm-*-gp2",
15+
"architecture": "x86_64",
16+
"owner-alias": "amazon",
17+
"root-device-type": "ebs",
18+
"block-device-mapping.volume-type": "gp2",
19+
"ena-support": "true",
20+
"sriov-net-support": "simple",
21+
"virtualization-type": "hvm"
22+
},
23+
"most_recent": true
24+
},
25+
"instance_type": "c5.xlarge",
26+
"iam_instance_profile": "{{user `iam_instance_profile`}}",
27+
"ssh_username": "ec2-user",
28+
"ami_name": "java-json-benchmark-build-{{timestamp}}"
29+
}
30+
],
31+
"provisioners": [
32+
{
33+
"type": "file",
34+
"source": "app.tar.gz",
35+
"destination": "/tmp/app.tar.gz"
36+
},
37+
{
38+
"type": "shell",
39+
"inline": [
40+
"sudo yum -y clean all",
41+
"sudo yum -y upgrade",
42+
"sudo yum install -y java-1.8.0-openjdk-devel",
43+
"sudo yum remove -y java-1.7.0-openjdk",
44+
"sudo /usr/sbin/alternatives --config java && sudo /usr/sbin/alternatives --config javac",
45+
"mkdir ~/app",
46+
"tar xzf /tmp/app.tar.gz -C ~/app",
47+
"pushd ~/app",
48+
"mkdir output",
49+
"./run-everything",
50+
"archiveName=results-$(date +%Y-%m-%dT%H:%M:%S).tar.gz",
51+
"tar czf ./${archiveName} output",
52+
"aws s3 cp ./${archiveName} s3://java-json-benchmark/"
53+
]
54+
}
55+
]
56+
}

0 commit comments

Comments
 (0)