bosh-stemcell 1.3215.4.0 → 1.3232.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d48198e84b48412db7a00636f437cb4e3ada0c0
4
- data.tar.gz: 23578cec445e59b0078e09b600197a5bf7d2398b
3
+ metadata.gz: 7de7caef97cfee142cb1f9d1cbef3144cad49894
4
+ data.tar.gz: 79b67b96758237d97c6afb243e990213b1ad9e19
5
5
  SHA512:
6
- metadata.gz: 41f614d46b02623924a34d56b4b421e523b8f45045e3984fc0cc1918ab80465c3cf40754255361fe6b71580e278e706a4861e5f0b6a6a4e4b05429c95568a0ed
7
- data.tar.gz: 74e983d1d49c7922deb54ace2d82a2e0edb404798a5b0e5dcd1a3c1b9e8e324fa21edbf8ce1c1fa226c9c3f98e72eafb0e913c787619299e2c12b6b53e61924e
6
+ metadata.gz: 14c029edcba45d41d9710b8a34a53b6cff19a084413f999e7580a34e396be6b1a4c5d05d160ca3de2a5cac2a38e376b27316ed11aac82f99a65b094cfc6de95c
7
+ data.tar.gz: b0b0e2c4b6c80cd3c7da72994ce7135947479ba109ba69daedb4de386f597743d1fb9c33efd00487daf7d5e15cf88b410c11564ac10e4f54f649f87c4bba81ec
data/README.md CHANGED
@@ -2,55 +2,28 @@
2
2
 
3
3
  Tools for creating stemcells
4
4
 
5
- ## Bringing up stemcell building VM
5
+ ## Choosing execution environment
6
6
 
7
- ### Once-off manual steps:
7
+ Stemcells can be built using either a local Docker container or a Vagrant VM on AWS.
8
8
 
9
- Note: Use US East (Northern Virginia) region when using AWS in following steps. AMI (Amazon Machine Image) to be used for the stemcell building VM is in the US East (Northern Virginia) region.
10
-
11
- 0. Upload a keypair called "bosh" to AWS that you'll use to connect to the remote vm later
12
- 0. Create "bosh-stemcell" security group on AWS to allow SSH access to the stemcell (once per AWS account)
13
- 0. Install the vagrant plugins we use:
14
-
15
- vagrant plugin install vagrant-aws
16
-
17
- ### Bring up the vagrant stemcell building VM
18
-
19
- From a fresh copy of the bosh repo:
20
-
21
- git submodule update --init --recursive
22
-
23
- If you use AWS VPC environment, run:
24
-
25
- export BOSH_VAGRANT_KEY_PATH=PATH-TO-YOUR-SSH-KEY
26
- export BOSH_AWS_ACCESS_KEY_ID=YOUR-AWS-ACCESS-KEY
27
- export BOSH_AWS_SECRET_ACCESS_KEY=YOUR-AWS-SECRET-KEY
28
- export BOSH_AWS_SECURITY_GROUP=YOUR-AWS-SECURITY-GROUP-ID
29
- export BOSH_AWS_SUBNET_ID=YOUR-AWS-SUBNET-ID
30
- cd bosh-stemcell
31
- vagrant up remote --provider=aws
32
-
33
- (Note: BOSH\_AWS\_SECURITY\_GROUP should be security group id (e.g. "sg-b799b9dc"), instead of name "bosh-stemcell")
34
-
35
- ## Updating source code on stemcell building VM
9
+ To run a given command in Docker:
36
10
 
37
- With existing stemcell building VM run:
11
+ # run this command from the root of the bosh project
12
+ docker run -it -v $PWD:/bosh -w /bosh -u ubuntu --privileged bosh/os-image-stemcell-builder
38
13
 
39
- export BOSH_AWS_ACCESS_KEY_ID=YOUR-AWS-ACCESS-KEY
40
- export BOSH_AWS_SECRET_ACCESS_KEY=YOUR-AWS-SECRET-KEY
41
- cd bosh-stemcell
42
- vagrant provision remote
43
-
44
- ## Configure your local ssh and scp to communicate with the stemcell building VM
14
+ # from within docker container
15
+ bundle install --local
16
+ <STEMCELL_COMMAND>
45
17
 
46
- Once the stemcell-building machine is up, run:
18
+ To run a command in Vagrant:
47
19
 
48
- vagrant ssh-config remote
49
-
50
- Then copy the resulting output into your `~/.ssh/config` file.
20
+ vagrant ssh -c '
21
+ cd /bosh
22
+ bundle install --local
23
+ <STEMCELL_COMMAND>
24
+ ' remote
51
25
 
52
- Once this has been done, you can ssh into the stemcell building machine with `ssh remote`
53
- and you can copy files to and from it using `scp localfile remote:/path/to/destination`
26
+ Jump to [Vagrant Setup](#vagrant-setup) for instructions on configuring the Vagrant box.
54
27
 
55
28
  ## Build an OS image
56
29
 
@@ -58,10 +31,7 @@ An OS image is a tarball that contains a snapshot of an entire OS filesystem tha
58
31
 
59
32
  If you have changes that will require new OS image you need to build one. A stemcell with a custom OS image can be built using the stemcell-building VM described above.
60
33
 
61
- vagrant ssh -c '
62
- cd /bosh
63
- bundle exec rake stemcell:build_os_image[ubuntu,trusty,/tmp/ubuntu_base_image.tgz]
64
- ' remote
34
+ bundle exec rake stemcell:build_os_image[ubuntu,trusty,$PWD/tmp/ubuntu_base_image.tgz]
65
35
 
66
36
  The arguments to `stemcell:build_os_image` are:
67
37
 
@@ -87,8 +57,7 @@ There are a few extra steps you need to do before building a RHEL OS image:
87
57
 
88
58
  5. On the stemcell building machine, run the stemcell building rake task:
89
59
 
90
- $ cd /bosh
91
- $ bundle exec rake stemcell:build_os_image[rhel,7,/tmp/rhel_7_base_image.tgz]
60
+ $ bundle exec rake stemcell:build_os_image[rhel,7,$PWD/tmp/rhel_7_base_image.tgz]
92
61
 
93
62
  See below [Building the stemcell with local OS image](#building-the-stemcell-with-local-os-image) on how to build stemcell with the new OS image.
94
63
 
@@ -105,8 +74,7 @@ There are a few extra steps you need to do before building a PhotonOS image:
105
74
 
106
75
  4. On the stemcell building machine, run the stemcell building rake task:
107
76
 
108
- $ cd /bosh
109
- $ bundle exec rake stemcell:build_os_image[photonos,TP2,/tmp/photon_TP2_base_image.tgz]
77
+ $ bundle exec rake stemcell:build_os_image[photonos,TP2,$PWD/tmp/photon_TP2_base_image.tgz]
110
78
 
111
79
  See below [Building the stemcell with local OS image](#building-the-stemcell-with-local-os-image) on how to build stemcell with the new OS image.
112
80
 
@@ -116,18 +84,12 @@ See below [Building the stemcell with local OS image](#building-the-stemcell-wit
116
84
 
117
85
  Substitute *\<current_build\>* with the current build number, which can be found by looking at [bosh.io/stemcells](https://bosh.io/stemcells). Note that the last two arguments to the rake command are the S3 bucket and key of the OS image to use (i.e. in the example below, the .tgz will be downloaded from [http://bosh-os-images.s3.amazonaws.com/bosh-centos-7-os-image.tgz](http://bosh-os-images.s3.amazonaws.com/bosh-centos-7-os-image.tgz)). More info at OS\_IMAGES.
118
86
 
119
- vagrant ssh -c '
120
- cd /bosh
121
- CANDIDATE_BUILD_NUMBER=<current_build> bundle exec rake stemcell:build[vsphere,esxi,centos,7,go,bosh-os-images,bosh-centos-7-os-image.tgz]
122
- ' remote
123
-
87
+ CANDIDATE_BUILD_NUMBER=<current_build> bundle exec rake \
88
+ stemcell:build[vsphere,esxi,centos,7,go,bosh-os-images,bosh-centos-7-os-image.tgz]
124
89
 
125
90
  ### Building the stemcell with local OS image
126
91
 
127
- vagrant ssh -c '
128
- cd /bosh
129
- bundle exec rake stemcell:build_with_local_os_image[aws,xen,ubuntu,trusty,go,/tmp/ubuntu_base_image.tgz]
130
- ' remote
92
+ bundle exec rake stemcell:build_with_local_os_image[aws,xen,ubuntu,trusty,go,$PWD/tmp/ubuntu_base_image.tgz]
131
93
 
132
94
 
133
95
  Public OS images can be obtained here:
@@ -137,14 +99,13 @@ Public OS images can be obtained here:
137
99
 
138
100
  ### Building light stemcell
139
101
 
102
+ **Warning:** You must use Vagrant on AWS to build light stemcells.
103
+
140
104
  AWS stemcells can be shipped in light format which includes a reference to a public AMI. This speeds up the process of uploading the stemcell to AWS. To build a light stemcell:
141
105
 
142
- vagrant ssh -c '
143
- cd /bosh
144
- export BOSH_AWS_ACCESS_KEY_ID=YOUR-AWS-ACCESS-KEY
145
- export BOSH_AWS_SECRET_ACCESS_KEY=YOUR-AWS-SECRET-KEY
146
- bundle exec rake stemcell:build_light[/tmp/bosh-stemcell.tgz,hvm]
147
- ' remote
106
+ export BOSH_AWS_ACCESS_KEY_ID=YOUR-AWS-ACCESS-KEY
107
+ export BOSH_AWS_SECRET_ACCESS_KEY=YOUR-AWS-SECRET-KEY
108
+ bundle exec rake stemcell:build_light[$PWD/tmp/bosh-stemcell.tgz,hvm]
148
109
 
149
110
  To build for specific region specify `BOSH_AWS_REGION` environment variable.
150
111
 
@@ -167,5 +128,56 @@ If you find yourself debugging any of the above processes, here is what you need
167
128
  For example:
168
129
 
169
130
  ```
170
- bundle exec rake stemcell:build_os_image[ubuntu,trusty,/tmp/ubuntu_base_image.tgz] resume_from=rsyslog_config
131
+ bundle exec rake stemcell:build_os_image[ubuntu,trusty,$PWD/tmp/ubuntu_base_image.tgz] resume_from=rsyslog_config
171
132
  ```
133
+
134
+ ## <a name="vagrant-setup"></a>Vagrant Setup
135
+
136
+ **Warning:** You cannot building a stemcell using Vagrant on Virtualbox.
137
+
138
+ ### Bring up the vagrant stemcell building VM
139
+
140
+ Note: Use US East (Northern Virginia) region when using AWS in following steps. AMI (Amazon Machine Image) to be used for the stemcell building VM is in the US East (Northern Virginia) region.
141
+
142
+ 0. Upload a keypair called "bosh" to AWS that you'll use to connect to the remote vm later
143
+ 0. Create "bosh-stemcell" security group on AWS to allow SSH access to the stemcell (once per AWS account)
144
+ 0. Install the vagrant plugins we use:
145
+
146
+ vagrant plugin install vagrant-aws
147
+
148
+
149
+ From a fresh copy of the bosh repo:
150
+
151
+ git submodule update --init --recursive
152
+
153
+ If you use AWS VPC environment, run:
154
+
155
+ export BOSH_VAGRANT_KEY_PATH=PATH-TO-YOUR-SSH-KEY
156
+ export BOSH_AWS_ACCESS_KEY_ID=YOUR-AWS-ACCESS-KEY
157
+ export BOSH_AWS_SECRET_ACCESS_KEY=YOUR-AWS-SECRET-KEY
158
+ export BOSH_AWS_SECURITY_GROUP=YOUR-AWS-SECURITY-GROUP-ID
159
+ export BOSH_AWS_SUBNET_ID=YOUR-AWS-SUBNET-ID
160
+ cd bosh-stemcell
161
+ vagrant up remote --provider=aws
162
+
163
+ (Note: BOSH\_AWS\_SECURITY\_GROUP should be security group id (e.g. "sg-b799b9dc"), instead of name "bosh-stemcell")
164
+
165
+ ### Updating source code on stemcell building VM
166
+
167
+ With existing stemcell building VM run:
168
+
169
+ export BOSH_AWS_ACCESS_KEY_ID=YOUR-AWS-ACCESS-KEY
170
+ export BOSH_AWS_SECRET_ACCESS_KEY=YOUR-AWS-SECRET-KEY
171
+ cd bosh-stemcell
172
+ vagrant provision remote
173
+
174
+ ### Configure your local ssh and scp to communicate with the stemcell building VM
175
+
176
+ Once the stemcell-building machine is up, run:
177
+
178
+ vagrant ssh-config remote
179
+
180
+ Then copy the resulting output into your `~/.ssh/config` file.
181
+
182
+ Once this has been done, you can ssh into the stemcell building machine with `ssh remote`
183
+ and you can copy files to and from it using `scp localfile remote:/path/to/destination`
@@ -59,7 +59,7 @@ module Bosh::Stemcell
59
59
  end
60
60
 
61
61
  def validate_stemcell
62
- raise "Cannot find file `#{path}'" unless File.exists?(path)
62
+ raise "Cannot find file '#{path}'" unless File.exists?(path)
63
63
  end
64
64
  end
65
65
  end
@@ -172,6 +172,8 @@ module Bosh::Stemcell
172
172
  ' --tag ~exclude_on_azure'
173
173
  when 'softlayer'
174
174
  ' --tag ~exclude_on_softlayer'
175
+ when 'google'
176
+ ' --tag ~exclude_on_google'
175
177
  else
176
178
  ''
177
179
  end,
@@ -6,6 +6,8 @@ module Bosh::Stemcell
6
6
  OpenStack.new
7
7
  when 'aws'
8
8
  Aws.new
9
+ when 'google'
10
+ Google.new
9
11
  when 'vsphere'
10
12
  Vsphere.new
11
13
  when 'warden'
@@ -101,6 +103,16 @@ module Bosh::Stemcell
101
103
  end
102
104
  end
103
105
 
106
+ class Google < Base
107
+ def initialize
108
+ super(name: 'google', hypervisor: 'kvm', default_disk_size: 3072, disk_formats: ['rawdisk'])
109
+ end
110
+
111
+ def additional_cloud_properties
112
+ {'root_device_name' => '/dev/sda1'}
113
+ end
114
+ end
115
+
104
116
  class Warden < Base
105
117
  def initialize
106
118
  super(name: 'warden', hypervisor: 'boshlite', default_disk_size: 2048, disk_formats: ['files'])
@@ -44,6 +44,8 @@ module Bosh::Stemcell
44
44
  stages = case infrastructure
45
45
  when Infrastructure::Aws then
46
46
  aws_stages
47
+ when Infrastructure::Google then
48
+ google_stages
47
49
  when Infrastructure::OpenStack then
48
50
  openstack_stages
49
51
  when Infrastructure::Vsphere then
@@ -65,6 +67,8 @@ module Bosh::Stemcell
65
67
  case disk_format
66
68
  when 'raw' then
67
69
  raw_package_stages
70
+ when 'rawdisk' then
71
+ rawdisk_package_stages
68
72
  when 'qcow2' then
69
73
  qcow2_package_stages
70
74
  when 'ovf' then
@@ -108,7 +112,6 @@ module Bosh::Stemcell
108
112
  [
109
113
  :system_network,
110
114
  :system_open_vm_tools,
111
- :password_policies,
112
115
  :system_vsphere_cdrom,
113
116
  :system_parameters,
114
117
  :bosh_clean,
@@ -136,6 +139,21 @@ module Bosh::Stemcell
136
139
  ]
137
140
  end
138
141
 
142
+ def google_stages
143
+ [
144
+ :system_network,
145
+ :system_google_modules,
146
+ :system_google_packages,
147
+ :system_parameters,
148
+ :bosh_clean,
149
+ :bosh_harden,
150
+ :bosh_google_agent_settings,
151
+ :bosh_clean_ssh,
152
+ :image_create,
153
+ :image_install_grub,
154
+ ]
155
+ end
156
+
139
157
  def warden_stages
140
158
  [
141
159
  :system_parameters,
@@ -145,6 +163,7 @@ module Bosh::Stemcell
145
163
  :bosh_enable_password_authentication,
146
164
  :bosh_clean_ssh,
147
165
  :image_create,
166
+ :image_install_grub,
148
167
  ]
149
168
  end
150
169
 
@@ -195,11 +214,14 @@ module Bosh::Stemcell
195
214
  :system_kernel_modules,
196
215
  :system_ixgbevf,
197
216
  bosh_steps,
217
+ :password_policies,
218
+ :tty_config,
198
219
  :rsyslog_config,
199
220
  :delay_monit_start,
200
221
  :system_grub,
201
222
  :cron_config,
202
- :escape_ctrl_alt_del
223
+ :escape_ctrl_alt_del,
224
+ :bosh_audit
203
225
  ].flatten
204
226
  end
205
227
 
@@ -234,12 +256,15 @@ module Bosh::Stemcell
234
256
  :system_kernel_modules,
235
257
  :system_ixgbevf,
236
258
  bosh_steps,
259
+ :password_policies,
260
+ :tty_config,
237
261
  :rsyslog_config,
238
262
  :delay_monit_start,
239
263
  :system_grub,
240
264
  :vim_tiny,
241
265
  :cron_config,
242
266
  :escape_ctrl_alt_del,
267
+ :bosh_audit
243
268
  ].flatten.reject{ |s| Bosh::Stemcell::Arch.ppc64le? and s == :system_ixgbevf }
244
269
  end
245
270
 
@@ -263,8 +288,7 @@ module Bosh::Stemcell
263
288
  :bosh_monit,
264
289
  :bosh_ntpdate,
265
290
  :bosh_sudoers,
266
- :password_policies,
267
- ]
291
+ ].flatten
268
292
  end
269
293
 
270
294
  def raw_package_stages
@@ -273,6 +297,12 @@ module Bosh::Stemcell
273
297
  ]
274
298
  end
275
299
 
300
+ def rawdisk_package_stages
301
+ [
302
+ :prepare_rawdisk_image_stemcell,
303
+ ]
304
+ end
305
+
276
306
  def qcow2_package_stages
277
307
  [
278
308
  :prepare_qcow2_image_stemcell,
@@ -48,7 +48,7 @@ module Bosh
48
48
  def manifest_cloud_properties(disk_format, infrastructure, stemcell_name)
49
49
  architecture = 'x86_64'
50
50
  if Bosh::Stemcell::Arch.ppc64le?
51
- architecture = 'ppc64le'
51
+ architecture = 'ppc64'
52
52
  end
53
53
 
54
54
  {
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Stemcell
3
- VERSION = '1.3215.4.0'
3
+ VERSION = '1.3232.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh-stemcell
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3215.4.0
4
+ version: 1.3232.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-14 00:00:00.000000000 Z
11
+ date: 2016-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bosh_aws_cpi
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.3215.4.0
33
+ version: 1.3232.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.3215.4.0
40
+ version: 1.3232.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: fakefs
43
43
  requirement: !ruby/object:Gem::Requirement