boxgrinder-build 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/CHANGELOG +12 -0
  2. data/Manifest +6 -5
  3. data/README.md +1 -1
  4. data/Rakefile +13 -20
  5. data/boxgrinder-build.gemspec +7 -10
  6. data/lib/boxgrinder-build/helpers/aws-helper.rb +81 -0
  7. data/lib/boxgrinder-build/helpers/ec2-helper.rb +182 -0
  8. data/lib/boxgrinder-build/helpers/guestfs-helper.rb +5 -1
  9. data/lib/boxgrinder-build/helpers/s3-helper.rb +124 -0
  10. data/lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb +95 -299
  11. data/lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb +2 -1
  12. data/lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb +67 -133
  13. data/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb +15 -14
  14. data/rubygem-boxgrinder-build.spec +23 -28
  15. data/spec/appliance-spec.rb +1 -0
  16. data/spec/helpers/augeas-helper-spec.rb +1 -0
  17. data/spec/helpers/ec2-helper-spec.rb +260 -0
  18. data/spec/helpers/guestfs-helper-spec.rb +34 -7
  19. data/spec/helpers/image-helper-spec.rb +1 -0
  20. data/spec/helpers/linux-helper-spec.rb +1 -0
  21. data/spec/helpers/package-helper-spec.rb +1 -0
  22. data/spec/helpers/plugin-helper-spec.rb +1 -0
  23. data/spec/helpers/s3-helper-spec.rb +168 -0
  24. data/spec/managers/plugin-manager-spec.rb +1 -0
  25. data/spec/plugins/base-plugin-spec.rb +1 -1
  26. data/spec/plugins/delivery/ebs/ebs-plugin-spec.rb +115 -204
  27. data/spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb +5 -4
  28. data/spec/plugins/delivery/local/local-plugin-spec.rb +1 -0
  29. data/spec/plugins/delivery/s3/s3-plugin-spec.rb +143 -134
  30. data/spec/plugins/delivery/sftp/sftp-plugin-spec.rb +1 -0
  31. data/spec/plugins/os/centos/centos-plugin-spec.rb +1 -0
  32. data/spec/plugins/os/fedora/fedora-plugin-spec.rb +1 -0
  33. data/spec/plugins/os/rhel/rhel-plugin-spec.rb +1 -0
  34. data/spec/plugins/os/rpm-based/kickstart-spec.rb +5 -1
  35. data/spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb +9 -7
  36. data/spec/plugins/os/rpm-based/rpm-dependency-validator-spec.rb +1 -0
  37. data/spec/plugins/os/sl/sl-plugin-spec.rb +1 -0
  38. data/spec/plugins/platform/ec2/ec2-plugin-spec.rb +1 -0
  39. data/spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb +1 -0
  40. data/spec/plugins/platform/vmware/vmware-plugin-spec.rb +1 -0
  41. metadata +17 -23
data/CHANGELOG CHANGED
@@ -1,3 +1,15 @@
1
+ v0.9.4
2
+
3
+ * [BGBUILD-263] NoMethodError: undefined method `item' for nil:NilClass while creating EBS appliance
4
+ * [BGBUILD-246] Detect when insufficient system memory is available for standard libguestfs, and reduce allocation.
5
+ * [BGBUILD-269] RPM database is recreated after post section execution preventing installing RPM in post section
6
+ * [BGBUILD-273] Move to RSpec2
7
+ * [BGBUILD-272] Move from aws and amazon-ec2 to official aws-sdk gem
8
+ * [BGBUILD-238] Stop AWS gem warnings
9
+ * [BGBUILD-265] Resolve concurrency issues in S3 plugin for overwriting
10
+ * [BGBUILD-249] Warning from S3 AMI plugin that BG is attempting to create a bucket that already exists
11
+ * [BGBUILD-242] Additional EBS overwrite edge cases
12
+
1
13
  v0.9.3
2
14
 
3
15
  * [BGBUILD-232] boxgrinder doesn't validate config early enough
data/Manifest CHANGED
@@ -28,12 +28,15 @@ integ/spec/modular-spec.rb
28
28
  lib/boxgrinder-build.rb
29
29
  lib/boxgrinder-build/appliance.rb
30
30
  lib/boxgrinder-build/helpers/augeas-helper.rb
31
+ lib/boxgrinder-build/helpers/aws-helper.rb
32
+ lib/boxgrinder-build/helpers/ec2-helper.rb
31
33
  lib/boxgrinder-build/helpers/guestfs-helper.rb
32
34
  lib/boxgrinder-build/helpers/image-helper.rb
33
35
  lib/boxgrinder-build/helpers/linux-helper.rb
34
36
  lib/boxgrinder-build/helpers/package-helper.rb
35
37
  lib/boxgrinder-build/helpers/plugin-helper.rb
36
38
  lib/boxgrinder-build/helpers/qemu.wrapper
39
+ lib/boxgrinder-build/helpers/s3-helper.rb
37
40
  lib/boxgrinder-build/managers/plugin-manager.rb
38
41
  lib/boxgrinder-build/plugins/base-plugin.rb
39
42
  lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb
@@ -68,11 +71,13 @@ lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb
68
71
  rubygem-boxgrinder-build.spec
69
72
  spec/appliance-spec.rb
70
73
  spec/helpers/augeas-helper-spec.rb
74
+ spec/helpers/ec2-helper-spec.rb
71
75
  spec/helpers/guestfs-helper-spec.rb
72
76
  spec/helpers/image-helper-spec.rb
73
77
  spec/helpers/linux-helper-spec.rb
74
78
  spec/helpers/package-helper-spec.rb
75
79
  spec/helpers/plugin-helper-spec.rb
80
+ spec/helpers/s3-helper-spec.rb
76
81
  spec/managers/plugin-manager-spec.rb
77
82
  spec/plugins/base-plugin-spec.rb
78
83
  spec/plugins/delivery/ebs/ebs-plugin-spec.rb
@@ -85,8 +90,4 @@ spec/plugins/os/centos/centos-plugin-spec.rb
85
90
  spec/plugins/os/fedora/fedora-plugin-spec.rb
86
91
  spec/plugins/os/rhel/rhel-plugin-spec.rb
87
92
  spec/plugins/os/rpm-based/kickstart-spec.rb
88
- spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb
89
- spec/plugins/os/rpm-based/rpm-dependency-validator-spec.rb
90
- spec/plugins/os/rpm-based/src/jeos-f13-plain.ks
91
- spec/plugins/os/rpm-based/src/jeos-f13-without-version.ks
92
- spec/plugins/os/rpm-based
93
+ spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb
data/README.md CHANGED
@@ -129,6 +129,6 @@ Assuming that BoxGrinder had succeeded in building the prior image, the RAW file
129
129
 
130
130
  -----------------------
131
131
 
132
- setarch i386 boxgrinder build fedora-14.appl
132
+ setarch i386 boxgrinder-build fedora-14.appl
133
133
 
134
134
  Build an i386 appliance (on an x86_64 machine).
data/Rakefile CHANGED
@@ -17,12 +17,7 @@
17
17
  # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
18
18
 
19
19
  require 'rubygems'
20
-
21
- begin
22
- require 'rake/dsl'
23
- rescue LoadError
24
- end
25
-
20
+ require 'rspec/core/rake_task'
26
21
  require 'echoe'
27
22
 
28
23
  Echoe.new("boxgrinder-build") do |p|
@@ -33,36 +28,34 @@ Echoe.new("boxgrinder-build") do |p|
33
28
  p.email = "info@boxgrinder.org"
34
29
  p.runtime_dependencies = [
35
30
  "boxgrinder-core ~>0.3.0",
36
- 'aws', # S3
37
- 'amazon-ec2', # EBS and S3
31
+ 'aws-sdk', # EBS and S3
38
32
  'net-sftp', 'net-ssh', 'progressbar', # SFTP
39
33
  'rest-client' # ElasticHosts
40
34
  ]
41
35
  end
42
36
 
43
37
  desc "Run all integration tests"
44
- Spec::Rake::SpecTask.new('integ') do |t|
45
- t.libs.unshift "../boxgrinder-core/lib"
38
+ RSpec::Core::RakeTask.new('integ') do |t|
46
39
  t.rcov = false
47
- t.spec_files = FileList["integ/**/*-spec.rb"]
48
- t.spec_opts = ['--colour', '--format', 'specdoc', '-b']
40
+ t.pattern = "integ/**/*-spec.rb"
41
+ t.rspec_opts = ['--colour', '--format', 'doc', '-b']
49
42
  t.verbose = true
50
43
  end
51
44
 
52
45
  desc "Run all tests"
53
- Spec::Rake::SpecTask.new('spec') do |t|
54
- t.libs.unshift "../boxgrinder-core/lib"
46
+ RSpec::Core::RakeTask.new('spec') do |t|
47
+ t.ruby_opts = "-I ../boxgrinder-core/lib"
55
48
  t.rcov = false
56
- t.spec_files = FileList["spec/**/*-spec.rb"]
57
- t.spec_opts = ['--colour', '--format', 'specdoc', '-b']
49
+ t.pattern = "spec/**/*-spec.rb"
50
+ t.rspec_opts = ['--colour', '--format', 'doc', '-b']
58
51
  t.verbose = true
59
52
  end
60
53
 
61
54
  desc "Run all tests and generate code coverage report"
62
- Spec::Rake::SpecTask.new('spec:coverage') do |t|
63
- t.libs.unshift "../boxgrinder-core/lib"
64
- t.spec_files = FileList["spec/**/*-spec.rb"]
65
- t.spec_opts = ['--colour', '--format', 'html:pkg/rspec_report.html', '-b']
55
+ RSpec::Core::RakeTask.new('spec:coverage') do |t|
56
+ t.ruby_opts = "-I ../boxgrinder-core/lib"
57
+ t.pattern = "spec/**/*-spec.rb"
58
+ t.rspec_opts = ['--colour', '--format', 'html', '--out', 'pkg/rspec_report.html', '-b']
66
59
  t.rcov = true
67
60
  t.rcov_opts = ['--exclude', 'spec,teamcity/*,/usr/lib/ruby/,.gem/ruby,/boxgrinder-core/,/gems/']
68
61
  t.verbose = true
@@ -2,17 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{boxgrinder-build}
5
- s.version = "0.9.3"
5
+ s.version = "0.9.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Marek Goldmann"]
9
- s.date = %q{2011-06-28}
9
+ s.date = %q{2011-08-17}
10
10
  s.default_executable = %q{boxgrinder-build}
11
11
  s.description = %q{A tool for creating appliances from simple plain text files for various virtual environments.}
12
12
  s.email = %q{info@boxgrinder.org}
13
13
  s.executables = ["boxgrinder-build"]
14
- s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.md", "bin/boxgrinder-build", "lib/boxgrinder-build.rb", "lib/boxgrinder-build/appliance.rb", "lib/boxgrinder-build/helpers/augeas-helper.rb", "lib/boxgrinder-build/helpers/guestfs-helper.rb", "lib/boxgrinder-build/helpers/image-helper.rb", "lib/boxgrinder-build/helpers/linux-helper.rb", "lib/boxgrinder-build/helpers/package-helper.rb", "lib/boxgrinder-build/helpers/plugin-helper.rb", "lib/boxgrinder-build/helpers/qemu.wrapper", "lib/boxgrinder-build/managers/plugin-manager.rb", "lib/boxgrinder-build/plugins/base-plugin.rb", "lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb", "lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb", "lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem", "lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb", "lib/boxgrinder-build/plugins/delivery/usb/usb-plugin.rb", "lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb", "lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb", "lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/kickstart.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb", "lib/boxgrinder-build/plugins/os/rpm-based/src/appliance.ks.erb", "lib/boxgrinder-build/plugins/os/rpm-based/src/base.repo", "lib/boxgrinder-build/plugins/os/rpm-based/src/motd.init", "lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_32bit", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_64bit", "lib/boxgrinder-build/plugins/platform/ec2/src/ifcfg-eth0", "lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst", "lib/boxgrinder-build/plugins/platform/ec2/src/rc_local", "lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb", "lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise", "lib/boxgrinder-build/plugins/platform/vmware/src/README-personal", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmx", "lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb"]
15
- s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.md", "Rakefile", "bin/boxgrinder-build", "boxgrinder-build.gemspec", "integ/appliances/_hardware_cpus.appl", "integ/appliances/_hardware_memory.appl", "integ/appliances/_hardware_partitions_home.appl", "integ/appliances/_hardware_partitions_root.appl", "integ/appliances/_os_password.appl", "integ/appliances/_packages_groups_base.appl", "integ/appliances/_packages_groups_core.appl", "integ/appliances/_packages_squid.appl", "integ/appliances/_packages_utils.appl", "integ/appliances/_repos_boxgrinder_permanent_noarch.appl", "integ/appliances/_repos_testlocal_ephemeral_noarch.appl", "integ/appliances/_test_base.appl", "integ/appliances/gnome-fedora.appl", "integ/appliances/jeos-centos.appl", "integ/appliances/jeos-fedora.appl", "integ/appliances/modular.appl", "integ/packages/ephemeral-repo-test-0.1-1.noarch.rpm", "integ/packages/local-repo-test.spec", "integ/spec/jeos-spec.rb", "integ/spec/modular-spec.rb", "lib/boxgrinder-build.rb", "lib/boxgrinder-build/appliance.rb", "lib/boxgrinder-build/helpers/augeas-helper.rb", "lib/boxgrinder-build/helpers/guestfs-helper.rb", "lib/boxgrinder-build/helpers/image-helper.rb", "lib/boxgrinder-build/helpers/linux-helper.rb", "lib/boxgrinder-build/helpers/package-helper.rb", "lib/boxgrinder-build/helpers/plugin-helper.rb", "lib/boxgrinder-build/helpers/qemu.wrapper", "lib/boxgrinder-build/managers/plugin-manager.rb", "lib/boxgrinder-build/plugins/base-plugin.rb", "lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb", "lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb", "lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem", "lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb", "lib/boxgrinder-build/plugins/delivery/usb/usb-plugin.rb", "lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb", "lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb", "lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/kickstart.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb", "lib/boxgrinder-build/plugins/os/rpm-based/src/appliance.ks.erb", "lib/boxgrinder-build/plugins/os/rpm-based/src/base.repo", "lib/boxgrinder-build/plugins/os/rpm-based/src/motd.init", "lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_32bit", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_64bit", "lib/boxgrinder-build/plugins/platform/ec2/src/ifcfg-eth0", "lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst", "lib/boxgrinder-build/plugins/platform/ec2/src/rc_local", "lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb", "lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise", "lib/boxgrinder-build/plugins/platform/vmware/src/README-personal", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmx", "lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb", "rubygem-boxgrinder-build.spec", "spec/appliance-spec.rb", "spec/helpers/augeas-helper-spec.rb", "spec/helpers/guestfs-helper-spec.rb", "spec/helpers/image-helper-spec.rb", "spec/helpers/linux-helper-spec.rb", "spec/helpers/package-helper-spec.rb", "spec/helpers/plugin-helper-spec.rb", "spec/managers/plugin-manager-spec.rb", "spec/plugins/base-plugin-spec.rb", "spec/plugins/delivery/ebs/ebs-plugin-spec.rb", "spec/plugins/delivery/ebs/ebs.yaml", "spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb", "spec/plugins/delivery/local/local-plugin-spec.rb", "spec/plugins/delivery/s3/s3-plugin-spec.rb", "spec/plugins/delivery/sftp/sftp-plugin-spec.rb", "spec/plugins/os/centos/centos-plugin-spec.rb", "spec/plugins/os/fedora/fedora-plugin-spec.rb", "spec/plugins/os/rhel/rhel-plugin-spec.rb", "spec/plugins/os/rpm-based/kickstart-spec.rb", "spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb", "spec/plugins/os/rpm-based/rpm-dependency-validator-spec.rb", "spec/plugins/os/rpm-based/src/jeos-f13-plain.ks", "spec/plugins/os/rpm-based/src/jeos-f13-without-version.ks", "spec/plugins/os/rpm-based/src/jeos-f13.ks", "spec/plugins/os/sl/sl-plugin-spec.rb", "spec/plugins/platform/ec2/ec2-plugin-spec.rb", "spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb", "spec/plugins/platform/vmware/vmware-plugin-spec.rb"]
14
+ s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.md", "bin/boxgrinder-build", "lib/boxgrinder-build.rb", "lib/boxgrinder-build/appliance.rb", "lib/boxgrinder-build/helpers/augeas-helper.rb", "lib/boxgrinder-build/helpers/aws-helper.rb", "lib/boxgrinder-build/helpers/ec2-helper.rb", "lib/boxgrinder-build/helpers/guestfs-helper.rb", "lib/boxgrinder-build/helpers/image-helper.rb", "lib/boxgrinder-build/helpers/linux-helper.rb", "lib/boxgrinder-build/helpers/package-helper.rb", "lib/boxgrinder-build/helpers/plugin-helper.rb", "lib/boxgrinder-build/helpers/qemu.wrapper", "lib/boxgrinder-build/helpers/s3-helper.rb", "lib/boxgrinder-build/managers/plugin-manager.rb", "lib/boxgrinder-build/plugins/base-plugin.rb", "lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb", "lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb", "lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem", "lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb", "lib/boxgrinder-build/plugins/delivery/usb/usb-plugin.rb", "lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb", "lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb", "lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/kickstart.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb", "lib/boxgrinder-build/plugins/os/rpm-based/src/appliance.ks.erb", "lib/boxgrinder-build/plugins/os/rpm-based/src/base.repo", "lib/boxgrinder-build/plugins/os/rpm-based/src/motd.init", "lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_32bit", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_64bit", "lib/boxgrinder-build/plugins/platform/ec2/src/ifcfg-eth0", "lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst", "lib/boxgrinder-build/plugins/platform/ec2/src/rc_local", "lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb", "lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise", "lib/boxgrinder-build/plugins/platform/vmware/src/README-personal", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmx", "lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb"]
15
+ s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.md", "Rakefile", "bin/boxgrinder-build", "boxgrinder-build.gemspec", "integ/appliances/_hardware_cpus.appl", "integ/appliances/_hardware_memory.appl", "integ/appliances/_hardware_partitions_home.appl", "integ/appliances/_hardware_partitions_root.appl", "integ/appliances/_os_password.appl", "integ/appliances/_packages_groups_base.appl", "integ/appliances/_packages_groups_core.appl", "integ/appliances/_packages_squid.appl", "integ/appliances/_packages_utils.appl", "integ/appliances/_repos_boxgrinder_permanent_noarch.appl", "integ/appliances/_repos_testlocal_ephemeral_noarch.appl", "integ/appliances/_test_base.appl", "integ/appliances/gnome-fedora.appl", "integ/appliances/jeos-centos.appl", "integ/appliances/jeos-fedora.appl", "integ/appliances/modular.appl", "integ/packages/ephemeral-repo-test-0.1-1.noarch.rpm", "integ/packages/local-repo-test.spec", "integ/spec/jeos-spec.rb", "integ/spec/modular-spec.rb", "lib/boxgrinder-build.rb", "lib/boxgrinder-build/appliance.rb", "lib/boxgrinder-build/helpers/augeas-helper.rb", "lib/boxgrinder-build/helpers/aws-helper.rb", "lib/boxgrinder-build/helpers/ec2-helper.rb", "lib/boxgrinder-build/helpers/guestfs-helper.rb", "lib/boxgrinder-build/helpers/image-helper.rb", "lib/boxgrinder-build/helpers/linux-helper.rb", "lib/boxgrinder-build/helpers/package-helper.rb", "lib/boxgrinder-build/helpers/plugin-helper.rb", "lib/boxgrinder-build/helpers/qemu.wrapper", "lib/boxgrinder-build/helpers/s3-helper.rb", "lib/boxgrinder-build/managers/plugin-manager.rb", "lib/boxgrinder-build/plugins/base-plugin.rb", "lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb", "lib/boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin.rb", "lib/boxgrinder-build/plugins/delivery/local/local-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/s3-plugin.rb", "lib/boxgrinder-build/plugins/delivery/s3/src/cert-ec2.pem", "lib/boxgrinder-build/plugins/delivery/sftp/sftp-plugin.rb", "lib/boxgrinder-build/plugins/delivery/usb/usb-plugin.rb", "lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb", "lib/boxgrinder-build/plugins/os/fedora/fedora-plugin.rb", "lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/kickstart.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb", "lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb", "lib/boxgrinder-build/plugins/os/rpm-based/src/appliance.ks.erb", "lib/boxgrinder-build/plugins/os/rpm-based/src/base.repo", "lib/boxgrinder-build/plugins/os/rpm-based/src/motd.init", "lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/ec2-plugin.rb", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_32bit", "lib/boxgrinder-build/plugins/platform/ec2/src/fstab_64bit", "lib/boxgrinder-build/plugins/platform/ec2/src/ifcfg-eth0", "lib/boxgrinder-build/plugins/platform/ec2/src/menu.lst", "lib/boxgrinder-build/plugins/platform/ec2/src/rc_local", "lib/boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin.rb", "lib/boxgrinder-build/plugins/platform/vmware/src/README-enterprise", "lib/boxgrinder-build/plugins/platform/vmware/src/README-personal", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk", "lib/boxgrinder-build/plugins/platform/vmware/src/base.vmx", "lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb", "rubygem-boxgrinder-build.spec", "spec/appliance-spec.rb", "spec/helpers/augeas-helper-spec.rb", "spec/helpers/ec2-helper-spec.rb", "spec/helpers/guestfs-helper-spec.rb", "spec/helpers/image-helper-spec.rb", "spec/helpers/linux-helper-spec.rb", "spec/helpers/package-helper-spec.rb", "spec/helpers/plugin-helper-spec.rb", "spec/helpers/s3-helper-spec.rb", "spec/managers/plugin-manager-spec.rb", "spec/plugins/base-plugin-spec.rb", "spec/plugins/delivery/ebs/ebs-plugin-spec.rb", "spec/plugins/delivery/ebs/ebs.yaml", "spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb", "spec/plugins/delivery/local/local-plugin-spec.rb", "spec/plugins/delivery/s3/s3-plugin-spec.rb", "spec/plugins/delivery/sftp/sftp-plugin-spec.rb", "spec/plugins/os/centos/centos-plugin-spec.rb", "spec/plugins/os/fedora/fedora-plugin-spec.rb", "spec/plugins/os/rhel/rhel-plugin-spec.rb", "spec/plugins/os/rpm-based/kickstart-spec.rb", "spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb", "spec/plugins/os/rpm-based/rpm-dependency-validator-spec.rb", "spec/plugins/os/rpm-based/src/jeos-f13-plain.ks", "spec/plugins/os/rpm-based/src/jeos-f13-without-version.ks", "spec/plugins/os/rpm-based/src/jeos-f13.ks", "spec/plugins/os/sl/sl-plugin-spec.rb", "spec/plugins/platform/ec2/ec2-plugin-spec.rb", "spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb", "spec/plugins/platform/vmware/vmware-plugin-spec.rb"]
16
16
  s.homepage = %q{http://boxgrinder.org/}
17
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Boxgrinder-build", "--main", "README.md"]
18
18
  s.require_paths = ["lib"]
@@ -26,16 +26,14 @@ Gem::Specification.new do |s|
26
26
 
27
27
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
28
28
  s.add_runtime_dependency(%q<boxgrinder-core>, ["~> 0.3.0"])
29
- s.add_runtime_dependency(%q<aws>, [">= 0"])
30
- s.add_runtime_dependency(%q<amazon-ec2>, [">= 0"])
29
+ s.add_runtime_dependency(%q<aws-sdk>, [">= 0"])
31
30
  s.add_runtime_dependency(%q<net-sftp>, [">= 0"])
32
31
  s.add_runtime_dependency(%q<net-ssh>, [">= 0"])
33
32
  s.add_runtime_dependency(%q<progressbar>, [">= 0"])
34
33
  s.add_runtime_dependency(%q<rest-client>, [">= 0"])
35
34
  else
36
35
  s.add_dependency(%q<boxgrinder-core>, ["~> 0.3.0"])
37
- s.add_dependency(%q<aws>, [">= 0"])
38
- s.add_dependency(%q<amazon-ec2>, [">= 0"])
36
+ s.add_dependency(%q<aws-sdk>, [">= 0"])
39
37
  s.add_dependency(%q<net-sftp>, [">= 0"])
40
38
  s.add_dependency(%q<net-ssh>, [">= 0"])
41
39
  s.add_dependency(%q<progressbar>, [">= 0"])
@@ -43,8 +41,7 @@ Gem::Specification.new do |s|
43
41
  end
44
42
  else
45
43
  s.add_dependency(%q<boxgrinder-core>, ["~> 0.3.0"])
46
- s.add_dependency(%q<aws>, [">= 0"])
47
- s.add_dependency(%q<amazon-ec2>, [">= 0"])
44
+ s.add_dependency(%q<aws-sdk>, [">= 0"])
48
45
  s.add_dependency(%q<net-sftp>, [">= 0"])
49
46
  s.add_dependency(%q<net-ssh>, [">= 0"])
50
47
  s.add_dependency(%q<progressbar>, [">= 0"])
@@ -0,0 +1,81 @@
1
+ #
2
+ # Copyright 2010 Red Hat, Inc.
3
+ #
4
+ # This is free software; you can redistribute it and/or modify it
5
+ # under the terms of the GNU Lesser General Public License as
6
+ # published by the Free Software Foundation; either version 3 of
7
+ # the License, or (at your option) any later version.
8
+ #
9
+ # This software is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this software; if not, write to the Free
16
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
18
+
19
+ require 'aws-sdk'
20
+
21
+ module BoxGrinder
22
+ class AWSHelper
23
+ #Setting value of a key to nil in opts_defaults forces non-nil value of key in opts_in
24
+ def parse_opts(opts_in, opts_defaults)
25
+ diff_id = opts_in.keys - opts_defaults.keys
26
+ raise ArgumentError, "Unrecognised argument(s): #{diff_id.join(", ")}" if diff_id.any?
27
+
28
+ (opts_in.keys & opts_defaults.keys).each do |k|
29
+ raise ArgumentError, "Argument #{k.to_s} must not be nil" if opts_defaults[k] == nil and opts_in[k] == nil
30
+ end
31
+
32
+ (opts_defaults.keys - opts_in.keys).each do |k|
33
+ raise ArgumentError, "Argument #{k.to_s} must not be nil" if opts_defaults[k] == nil
34
+ opts_in.merge!(k => opts_defaults[k])
35
+ end
36
+ opts_in
37
+ end
38
+
39
+ def wait_with_timeout(cycle_seconds, timeout_seconds)
40
+ Timeout::timeout(timeout_seconds) do
41
+ while not yield
42
+ sleep cycle_seconds
43
+ end
44
+ end
45
+ end
46
+
47
+ def select_aki(region, pattern)
48
+ candidates = region.images.with_owner('amazon').
49
+ filter('manifest-location','*pv-grub*').
50
+ sort().
51
+ reverse
52
+
53
+ candidates.each do |image|
54
+ return image.id if image.location =~ pattern
55
+ end
56
+ end
57
+
58
+ #Currently there is no API call for discovering S3 endpoint addresses
59
+ #but the base is presently the same as the EC2 endpoints, so this somewhat better
60
+ #than manually maintaining the data.
61
+ #S3 = /hd0-.*i386/, EBS = /hd00-.*i386/
62
+ def endpoints(service_name, aki_pattern)
63
+ endpoints = {}
64
+ AWS.memoize do
65
+ @ec2.regions.each do |region|
66
+ endpoints.merge!({
67
+ region.name => {
68
+ :endpoint => "#{service_name}.#{region.name}.amazonaws.com",
69
+ :location => region.name, #or alias?
70
+ :kernel => {
71
+ :i386 => select_aki(region, aki_pattern),
72
+ :x86_64 => select_aki(region, aki_pattern)
73
+ }
74
+ }
75
+ })
76
+ end
77
+ end
78
+ end
79
+
80
+ end
81
+ end
@@ -0,0 +1,182 @@
1
+ #
2
+ # Copyright 2010 Red Hat, Inc.
3
+ #
4
+ # This is free software; you can redistribute it and/or modify it
5
+ # under the terms of the GNU Lesser General Public License as
6
+ # published by the Free Software Foundation; either version 3 of
7
+ # the License, or (at your option) any later version.
8
+ #
9
+ # This software is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this software; if not, write to the Free
16
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
18
+
19
+ require 'boxgrinder-build/helpers/aws-helper'
20
+ require 'aws-sdk'
21
+ require 'timeout'
22
+
23
+ module BoxGrinder
24
+ class EC2Helper < AWSHelper
25
+
26
+ DEF_POLL_FREQ = 1
27
+ DEF_TIMEOUT = 1000
28
+ HTTP_TIMEOUT = 10
29
+
30
+ def initialize(ec2, opts={})
31
+ raise ArgumentError, "ec2 argument must not be nil" if ec2.nil?
32
+ @ec2 = ec2
33
+ @log = opts[:log] || LogHelper.new
34
+ end
35
+
36
+ # Wait cycles
37
+
38
+ def wait_for_image_state(state, ami, opts={})
39
+ #First wait for the AMI to be confirmed to exist (after creating, an immediate query can cause an error)
40
+ opts = parse_opts(opts, {:frequency => DEF_POLL_FREQ, :timeout => DEF_TIMEOUT})
41
+ wait_with_timeout(opts[:frequency], opts[:timeout]){ ami.exists? }
42
+ wait_with_timeout(opts[:frequency], opts[:timeout]){ ami.state == state }
43
+ end
44
+
45
+ def wait_for_image_death(ami, opts={})
46
+ opts = parse_opts(opts, {:frequency => DEF_POLL_FREQ, :timeout => DEF_TIMEOUT})
47
+ wait_with_timeout(opts[:frequency], opts[:timeout]){ !ami.exists? }
48
+ rescue AWS::EC2::Errors::InvalidImageID::NotFound
49
+ end
50
+
51
+ def wait_for_instance_status(status, instance, opts={})
52
+ opts = parse_opts(opts, {:frequency => DEF_POLL_FREQ, :timeout => DEF_TIMEOUT})
53
+ wait_with_timeout(opts[:frequency], opts[:timeout]){ instance.status == status }
54
+ end
55
+
56
+ #Being serial shouldn't be much slower as we are blocked by the slowest stopper anyway
57
+ def wait_for_instance_death(instance, opts={})
58
+ wait_for_instance_status(:terminated, instance, opts) if instance.exists?
59
+ rescue AWS::EC2::Errors::InvalidInstanceID::NotFound
60
+ end
61
+
62
+ def wait_for_snapshot_status(status, snapshot, opts={})
63
+ opts = parse_opts(opts, {:frequency => DEF_POLL_FREQ, :timeout => DEF_TIMEOUT})
64
+ progress = -1
65
+ wait_with_timeout(opts[:frequency], opts[:timeout]) do
66
+ current_progress = snapshot.progress || 0
67
+ unless progress == current_progress
68
+ @log.info "Progress: #{current_progress}%"
69
+ progress = current_progress
70
+ end
71
+ snapshot.status == status
72
+ end
73
+ rescue Exception
74
+ @log.debug "Polling of snapshot #{snapshot.id} for status '#{status}' failed" unless snapshot.nil?
75
+ raise
76
+ end
77
+
78
+ def wait_for_volume_status(status, volume, opts={})
79
+ opts = parse_opts(opts, {:frequency => DEF_POLL_FREQ, :timeout => DEF_TIMEOUT})
80
+ wait_with_timeout(opts[:frequency], opts[:timeout]) do
81
+ volume.status == status
82
+ end
83
+ end
84
+
85
+ # EC2 meta-data queries
86
+
87
+ def self.get_meta_data(path)
88
+ timeout(HTTP_TIMEOUT) do
89
+ req = Net::HTTP::Get.new(path)
90
+ res = Net::HTTP.start('169.254.169.254', 80) {|http| http.request(req)}
91
+ return res.body if Net::HTTPSuccess
92
+ res.error!
93
+ end
94
+ end
95
+
96
+ def self.current_availability_zone
97
+ get_meta_data('/latest/meta-data/placement/availability-zone/')
98
+ end
99
+
100
+ def self.current_instance_id
101
+ get_meta_data('/latest/meta-data/instance-id')
102
+ end
103
+
104
+ def self.availability_zone_to_region(availability_zone)
105
+ availability_zone.scan(/((\w+)-(\w+)-(\d+))/).flatten.first
106
+ end
107
+
108
+ # EC2 queries
109
+
110
+ def ami_by_name(name, account_number)
111
+ q = @ec2.images.with_owner(account_number).
112
+ filter("name", name)
113
+ return nil unless q.any?
114
+ q.first
115
+ end
116
+
117
+ def snapshot_by_id(snapshot_id)
118
+ q = @ec2.snapshots.filter('snapshot-id', snapshot_id)
119
+ return nil unless q.any?
120
+ q.first
121
+ end
122
+
123
+ def live_instances(ami)
124
+ q = @ec2.instances.filter('image-id', ami.id)
125
+ return q.select{|a| a.status != :terminated} if q.any?
126
+ nil
127
+ end
128
+
129
+ # EC2 Endpoints
130
+
131
+ def self.endpoints
132
+ SERVICES
133
+ end
134
+
135
+ SERVICES = {
136
+ 'eu-west-1' => {
137
+ :endpoint => 'ec2.eu-west-1.amazonaws.com',
138
+ :location => 'EU',
139
+ :kernel => {
140
+ :i386 => {:aki => 'aki-4deec439'},
141
+ :x86_64 => {:aki => 'aki-4feec43b'}
142
+ }
143
+ },
144
+
145
+ 'ap-southeast-1' => {
146
+ :endpoint => 'ec2.ap-southeast-1.amazonaws.com',
147
+ :location => 'ap-southeast-1',
148
+ :kernel => {
149
+ :i386 => {:aki => 'aki-13d5aa41'},
150
+ :x86_64 => {:aki => 'aki-11d5aa43'}
151
+ }
152
+ },
153
+
154
+ 'ap-northeast-1' => {
155
+ :endpoint => 'ec2.ap-northeast-1.amazonaws.com',
156
+ :location => 'ap-northeast-1',
157
+ :kernel => {
158
+ :i386 => {:aki => 'aki-d209a2d3'},
159
+ :x86_64 => {:aki => 'aki-d409a2d5'}
160
+ }
161
+ },
162
+
163
+ 'us-west-1' => {
164
+ :endpoint => 'ec2.us-west-1.amazonaws.com',
165
+ :location => 'us-west-1',
166
+ :kernel => {
167
+ :i386 => {:aki => 'aki-99a0f1dc'},
168
+ :x86_64 => {:aki => 'aki-9ba0f1de'}
169
+ }
170
+ },
171
+
172
+ 'us-east-1' => {
173
+ :endpoint => 'ec2.amazonaws.com',
174
+ :location => '',
175
+ :kernel => {
176
+ :i386 => {:aki => 'aki-407d9529'},
177
+ :x86_64 => {:aki => 'aki-427d952b'}
178
+ }
179
+ }
180
+ }
181
+ end
182
+ end
@@ -132,6 +132,10 @@ module BoxGrinder
132
132
  @guestfs.set_verbose(1)
133
133
  @guestfs.set_trace(1)
134
134
 
135
+ # https://issues.jboss.org/browse/BGBUILD-246
136
+ memsize = ENV['LIBGUESTFS_MEMSIZE'].nil? ? 300 : ENV['LIBGUESTFS_MEMSIZE'].to_i
137
+ @guestfs.set_memsize(memsize)
138
+
135
139
  # https://bugzilla.redhat.com/show_bug.cgi?id=502058
136
140
  @guestfs.set_append("noapic")
137
141
 
@@ -291,4 +295,4 @@ module BoxGrinder
291
295
  AugeasHelper.new(@guestfs, self, :log => @log).edit(&block)
292
296
  end
293
297
  end
294
- end
298
+ end