Skip to content

Commit 8577486

Browse files
committed
Stop populating apply_spec.yml - AWS, Azure, GCP
A file called `apply_spec.yml` had historically been placed onto the Windows stemcell on AWS, Azure, GCP, and possibly prior to `stembuild` on vSphere as well. Given that the vSphere Windows stemcells have shipped without this file for many years it does not appear to be valuable. For consistency this is being removed everywhere instead of propigated to vSphere.
1 parent 0d0f24d commit 8577486

File tree

18 files changed

+4
-111
lines changed

18 files changed

+4
-111
lines changed

ci/tasks/build-agent-zip/run.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ mkdir -p "${zip_deps_dir}"
1919

2020
# agent-zip root
2121
cp "${bosh_agent_resource_dir}/bosh-agent-${bosh_agent_resource_version}-windows-amd64.exe" "${zip_dir}/bosh-agent.exe"
22-
# `sha` filename expected by `bosh-windows-stemcell-builder` rake tasks; TODO: reduce coupling
23-
cp "${bosh_agent_resource_dir}/git-sha-${bosh_agent_resource_version}" "${zip_dir}/sha"
2422
cp "${bosh_agent_resource_dir}/service_wrapper-${bosh_agent_resource_version}.xml" "${zip_dir}/service_wrapper.xml"
2523

2624
cp "${CONCOURSE_ROOT}"/windows-winsw/WinSW.NET461.exe "${zip_dir}/service_wrapper.exe"

lib/stemcell/apply_spec.rb

Lines changed: 0 additions & 13 deletions
This file was deleted.

lib/stemcell/builder.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
require_relative '../packer/runner'
77
require_relative 'manifest'
88
require_relative 'packager'
9-
require_relative 'apply_spec'

lib/stemcell/builder/base.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,23 @@ def self.validate_env_dir(vars)
2020
end
2121

2222
class Base
23-
def initialize(os:, output_directory:, version:, agent_commit:, packer_vars:, region: nil, mount_ephemeral_disk: 'false')
23+
def initialize(os:, output_directory:, version:, packer_vars:, region: nil, mount_ephemeral_disk: 'false')
2424
@os = os
2525
@output_directory = output_directory
2626
@version = version
27-
@agent_commit = agent_commit
2827
@packer_vars = packer_vars
2928
@region = region
3029
@mount_ephemeral_disk = mount_ephemeral_disk == 'true'
3130
end
3231

3332
def build(iaas:, is_light:, image_path:, manifest:, update_list:)
34-
apply_spec = ApplySpec.new(@agent_commit).dump
3533
Packager.package(
3634
iaas: iaas,
3735
os: @os,
3836
is_light: is_light,
3937
version: @version,
4038
image_path: image_path,
4139
manifest: manifest,
42-
apply_spec: apply_spec,
4340
output_directory: @output_directory,
4441
update_list: update_list,
4542
region: @region

lib/stemcell/packager.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def self.read_from_tgz(path, filename)
7676
contents
7777
end
7878

79-
def self.package(iaas:, os:, is_light:, version:, image_path:, manifest:, apply_spec:, output_directory:, update_list:, region: nil)
79+
def self.package(iaas:, os:, is_light:, version:, image_path:, manifest:, output_directory:, update_list:, region: nil)
8080
raise InvalidImagePathError unless File.file?(image_path) || is_light
8181
raise InvalidOutputDirError unless File.directory?(output_directory)
8282

@@ -106,10 +106,6 @@ def self.package(iaas:, os:, is_light:, version:, image_path:, manifest:, apply_
106106
end
107107
end
108108

109-
tar.add_file_simple('apply_spec.yml', 0o666, apply_spec.length) do |io|
110-
io.write(apply_spec)
111-
end
112-
113109
if update_list
114110
tar.add_file_simple('updates.txt', 0o666, File.size(update_list)) do |io|
115111
updates = File.open(update_list,'rb')

lib/tasks/build/aws.rake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,8 @@ def get_aws_builder(output_directory, region, base_ami = '')
184184
build_dir = File.join(base_dir, 'build')
185185
agent_dir = File.join(build_dir,'compiled-agent')
186186
version = File.read(File.join(version_dir, 'number')).chomp
187-
agent_commit = File.read(File.join(agent_dir, 'sha')).chomp
188187

189188
Stemcell::Builder::Aws.new(
190-
agent_commit: agent_commit,
191189
ami: base_ami,
192190
aws_access_key: ENV['PACKER_AWS_ACCESS_KEY'] || ENV['AWS_ACCESS_KEY'],
193191
aws_secret_key: ENV['PACKER_AWS_SECRET_KEY'] || ENV['AWS_SECRET_KEY'],

lib/tasks/build/azure.rake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ namespace :build do
1111
version_dir = Stemcell::Builder::validate_env_dir('VERSION_DIR')
1212

1313
version = File.read(File.join(version_dir, 'number')).chomp
14-
agent_commit = File.read(File.join(build_dir, 'compiled-agent', 'sha')).chomp
1514

1615
output_directory = File.absolute_path('bosh-windows-stemcell')
1716
FileUtils.mkdir_p(output_directory)
@@ -29,7 +28,6 @@ namespace :build do
2928
azure_builder = Stemcell::Builder::Azure.new(
3029
packer_vars: {},
3130
version: version,
32-
agent_commit: agent_commit,
3331
os: Stemcell::Builder::validate_env('OS_VERSION'),
3432
output_directory: output_directory,
3533
client_id: Stemcell::Builder::validate_env('CLIENT_ID'),

lib/tasks/build/gcp.rake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace :build do
1313
base_image_dir = Stemcell::Builder::validate_env_dir('BASE_IMAGE_DIR')
1414

1515
version = File.read(File.join(version_dir, 'number')).chomp
16-
agent_commit = File.read(File.join(build_dir, 'compiled-agent', 'sha')).chomp
1716
gcp_image = JSON.parse(
1817
File.read(
1918
Dir.glob(File.join(base_image_dir, 'base-gcp-image-*.json'))[0]
@@ -27,7 +26,6 @@ namespace :build do
2726

2827
gcp_builder = Stemcell::Builder::Gcp.new(
2928
account_json: Stemcell::Builder::validate_env('ACCOUNT_JSON'),
30-
agent_commit: agent_commit,
3129
os: Stemcell::Builder::validate_env('OS_VERSION'),
3230
output_directory: output_directory,
3331
packer_vars: {},

spec/integration/build/aws_spec.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
@os_version = 'windows2019'
2020
@version = '1200.3.1-build.2'
21-
@agent_commit = 'some-agent-commit'
2221

2322
ENV['AMIS_DIR'] = @amis_dir
2423
ENV['PACKER_AWS_ACCESS_KEY'] = @aws_access_key = 'some-aws_access_key'
@@ -37,10 +36,6 @@
3736
)
3837

3938
FileUtils.mkdir_p(File.join(@build_dir, 'compiled-agent'))
40-
File.write(
41-
File.join(@build_dir, 'compiled-agent', 'sha'),
42-
@agent_commit
43-
)
4439

4540
File.write(
4641
File.join(@base_amis_dir, 'base-amis-1.json'),
@@ -91,9 +86,6 @@
9186
expect(stemcell_manifest['cloud_properties']['ami']['us-east-1']).to eq('ami-east1id')
9287
expect(stemcell_manifest['cloud_properties']['ami']['us-east-2']).to be_nil
9388

94-
apply_spec = JSON.parse(read_from_tgz(stemcell, 'apply_spec.yml'))
95-
expect(apply_spec['agent_commit']).to eq(@agent_commit)
96-
9789
expect(read_from_tgz(stemcell, 'image')).to be_empty
9890
expect(File.read(stemcell_sha)).to eq(Digest::SHA1.hexdigest(File.read(stemcell)))
9991

@@ -263,9 +255,6 @@
263255

264256
expect(read_from_tgz(stemcell, 'updates.txt')).not_to be_nil
265257

266-
apply_spec = JSON.parse(read_from_tgz(stemcell, 'apply_spec.yml'))
267-
expect(apply_spec['agent_commit']).to eq(@agent_commit)
268-
269258
expect(read_from_tgz(stemcell, 'image')).to be_empty
270259
expect(File.read(stemcell_sha)).to eq(Digest::SHA1.hexdigest(File.read(stemcell)))
271260
end

spec/integration/build/azure_spec.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
Dir.mktmpdir('azure-stemcell-test') do |tmpdir|
3838
os_version = 'windows2019'
3939
version = '1200.0.1-build.7'
40-
agent_commit = 'some-agent-commit'
4140

4241
ENV['CLIENT_ID'] = 'some-azure_access_key'
4342
ENV['CLIENT_SECRET'] = 'some-azure_secret_key'
@@ -63,10 +62,6 @@
6362
)
6463

6564
FileUtils.mkdir_p(File.join(@build_dir, 'compiled-agent'))
66-
File.write(
67-
File.join(@build_dir, 'compiled-agent', 'sha'),
68-
agent_commit
69-
)
7065

7166
# This allows the task to be ran multiple times by different tests
7267
Rake::Task['build:azure'].reenable
@@ -95,11 +90,6 @@
9590
expect(stemcell_manifest['cloud_properties']['image']['sku']).to eq('some-sku')
9691
expect(stemcell_manifest['cloud_properties']['image']['version']).to eq('1200.0.001007')
9792

98-
apply_spec = JSON.parse(read_from_tgz(stemcell, 'apply_spec.yml'))
99-
expect(apply_spec['agent_commit']).to eq(agent_commit)
100-
101-
# expect(read_from_tgz(stemcell, 'updates.txt')).to eq('some-updates')
102-
10393
expect(read_from_tgz(stemcell, 'image')).to be_empty
10494
expect(File.read(stemcell_sha)).to eq(Digest::SHA1.hexdigest(File.read(stemcell)))
10595
end

0 commit comments

Comments
 (0)