Skip to content

Commit ba8a462

Browse files
author
Alex Suraci & Bleicke
committed
Revert 'Revert "remove framework/runtime"'
This reverts commit f5a7698.
1 parent f5a7698 commit ba8a462

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+63
-955
lines changed

bin/document_api

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ module Docs
2020
VCAP::CloudController::User,
2121
VCAP::CloudController::Space,
2222
VCAP::CloudController::App,
23-
VCAP::CloudController::Runtime,
24-
VCAP::CloudController::Framework,
2523
VCAP::CloudController::Service,
2624
VCAP::CloudController::ServicePlan,
2725
VCAP::CloudController::ServiceInstance,

config/frameworks/myframework.yml

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

config/frameworks/node.yml

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

config/frameworks/sinatra.yml

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

config/frameworks/spring.yml

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

config/frameworks/standalone.yml

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

config/runtimes.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2009-2012 VMware, Inc.
2+
3+
Sequel.migration do
4+
change do
5+
alter_table :apps do
6+
drop_column :framework_id
7+
drop_column :runtime_id
8+
end
9+
10+
drop_table :frameworks
11+
drop_table :runtimes
12+
end
13+
end

lib/cloud_controller/api/app.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ module VCAP::CloudController
1515
attribute :production, Message::Boolean, :default => false
1616

1717
to_one :space
18-
to_one :runtime, :optional_in => :create
19-
to_one :framework, :optional_in => :create
2018
to_one :stack, :optional_in => :create
2119

2220
attribute :environment_json, Hash, :default => {}
@@ -37,7 +35,7 @@ module VCAP::CloudController
3735
to_many :routes
3836
end
3937

40-
query_parameters :name, :space_guid, :organization_guid, :framework_guid, :runtime_guid
38+
query_parameters :name, :space_guid, :organization_guid
4139

4240
def self.translate_validation_exception(e, attributes)
4341
space_and_name_errors = e.errors.on([:space_id, :name])

lib/cloud_controller/api/app_summary.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ def summary(id)
2020
:guid => app.guid,
2121
:name => app.name,
2222
:routes => app.routes.map(&:as_summary_json),
23-
:framework => app.framework.to_hash.merge(:guid => app.framework.guid),
24-
:runtime => app.runtime.to_hash.merge(:guid => app.runtime.guid),
2523
:running_instances => app.running_instances,
2624
:services => app.service_instances.map(&:as_summary_json),
2725
:available_domains => app.space.domains.map(&:as_summary_json)

lib/cloud_controller/api/framework.rb

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

lib/cloud_controller/api/runtime.rb

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

lib/cloud_controller/api/space_summary.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ def app_summary(app)
4949
:urls => app.routes.map(&:fqdn),
5050
:routes => app.routes.map(&:as_summary_json),
5151
:service_count => app.service_bindings_dataset.count,
52-
:framework => { :name => app.framework.name },
53-
:runtime => { :name => app.runtime.name },
5452
:running_instances => 0,
5553
}.merge(app.to_hash)
5654
end

lib/cloud_controller/app_stager.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,6 @@ def destroy_upload_handle
195195
def staging_task_properties(app)
196196
{
197197
:services => app.service_bindings.map { |sb| service_binding_to_staging_request(sb) },
198-
:framework => app.framework.name,
199-
:framework_info => app.framework.internal_info,
200-
201-
:runtime => app.runtime.name,
202-
:runtime_info => app.runtime.internal_info.merge(
203-
:name => app.runtime.name
204-
),
205198

206199
:buildpack => app.buildpack,
207200

lib/cloud_controller/config.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class VCAP::CloudController::Config < VCAP::Config
4646
optional(:staging_manifests) => String,
4747
},
4848

49-
optional(:runtimes_file) => String,
5049
optional(:stacks_file) => String,
5150

5251
:db => {
@@ -168,7 +167,6 @@ def self.config_dir
168167
private
169168

170169
def self.merge_defaults(config)
171-
config[:runtimes_file] ||= File.join(config_dir, "runtimes.yml")
172170
config[:stacks_file] ||= File.join(config_dir, "stacks.yml")
173171

174172
config[:directories] ||= {}

lib/cloud_controller/dea/dea_client.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def start_instances_with_message(app, indices, message_override)
225225

226226
indices.each do |idx|
227227
msg[:index] = idx
228-
dea_id = dea_pool.find_dea(app.memory, app.runtime.name, app.stack.name)
228+
dea_id = dea_pool.find_dea(app.memory, app.stack.name)
229229
if dea_id
230230
dea_publish("#{dea_id}.start", msg.merge(message_override))
231231
else
@@ -313,11 +313,6 @@ def start_app_message(app)
313313
:droplet => app.guid,
314314
:name => app.name,
315315
:uris => app.uris,
316-
:runtime => app.runtime.name,
317-
:runtime_info => app.runtime.internal_info.merge(
318-
:name => app.runtime.name
319-
),
320-
:framework => app.framework.name,
321316
:prod => app.production,
322317
:sha1 => app.droplet_hash,
323318
:executableFile => "deprecated",

lib/cloud_controller/dea/dea_pool.rb

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ def process_advertise_message(msg)
2929
end
3030
end
3131

32-
def find_dea(mem, runtime, stack)
32+
def find_dea(mem, stack)
3333
mutex.synchronize do
3434
@deas.keys.shuffle.each do |id|
3535
dea = @deas[id]
3636
if dea_expired?(dea)
3737
@deas.delete(id)
38-
elsif dea_meets_needs?(dea, mem, runtime, stack)
38+
elsif dea_meets_needs?(dea, mem, stack)
3939
return id
4040
end
4141
end
@@ -49,17 +49,12 @@ def dea_expired?(dea)
4949
(Time.now.to_i - dea[:last_update].to_i) > ADVERTISEMENT_EXPIRATION
5050
end
5151

52-
def dea_meets_needs?(dea, mem, runtime, stack)
52+
def dea_meets_needs?(dea, mem, stack)
5353
stats = dea[:advertisement]
5454

55-
has_runtime = stats[:runtimes].nil? || stats[:runtimes].include?(runtime)
5655
has_stack = stats[:stacks].include?(stack)
5756

58-
if stats[:available_memory] >= mem
59-
has_runtime && has_stack
60-
else
61-
false
62-
end
57+
(stats[:available_memory] >= mem) && has_stack
6358
end
6459

6560
def mutex

lib/cloud_controller/legacy_api/legacy_apps.rb

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ def instances(name)
129129
def legacy_app_encoding(app)
130130
{
131131
:name => app.name,
132-
:staging => {
133-
:model => app.framework.name,
134-
:stack => app.runtime.name,
135-
},
136132
:uris => app.uris,
137133
:instances => app.instances,
138134
:runningInstances => app.running_instances,
@@ -215,21 +211,6 @@ def translate_legacy_create_json(hash)
215211
end
216212

217213
if staging = hash["staging"]
218-
framework = nil
219-
if framework_name = staging["framework"] || staging["model"]
220-
framework = Models::Framework.find(:name => framework_name)
221-
raise FrameworkInvalid.new(framework_name) unless framework
222-
req[:framework_guid] = framework.guid
223-
end
224-
225-
runtime_name = staging["runtime"] || staging["stack"]
226-
runtime_name ||= default_runtime_for_framework(framework)
227-
if runtime_name
228-
runtime = Models::Runtime.find(:name => runtime_name)
229-
raise RuntimeInvalid.new(runtime_name) unless runtime
230-
req[:runtime_guid] = runtime.guid
231-
end
232-
233214
req[:command] = staging["command"] if staging["command"]
234215
end
235216

@@ -292,16 +273,6 @@ def around_translate(old_json, &translate)
292273
Yajl::Encoder.encode(translated)
293274
end
294275

295-
def default_runtime_for_framework(framework)
296-
return unless framework
297-
framework.internal_info["runtimes"].each do |runtime|
298-
runtime.each do |runtime_name, runtime_info|
299-
return runtime_name if runtime_info["default"] == true
300-
end
301-
end
302-
nil
303-
end
304-
305276
def self.setup_routes
306277
get "/apps", :enumerate
307278
post "/apps", :create

lib/cloud_controller/legacy_api/legacy_bulk.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ class BulkResponse < JsonMessage
1010
{
1111
"id" => String,
1212
"instances" => Integer,
13-
"framework" => String,
14-
"runtime" => String,
1513
# FIXME: find the enum for this
1614
"state" => String,
1715
"memory" => Integer,
@@ -96,8 +94,6 @@ def bulk_apps
9694
end
9795
hash["id"] = app.guid
9896
hash["updated_at"] = app.updated_at || app.created_at
99-
hash["runtime"] = app.runtime.name
100-
hash["framework"] = app.framework.name
10197
apps[app.guid] = hash
10298
id_for_next_token = app.id
10399
end

0 commit comments

Comments
 (0)