Fedora 16 Test Day
by Chris Lalancette
All,
On October 20th, Fedora will be running a Cloud Test Day. For those not
familiar with the Fedora Test Days, they are essentially used to target
particular pieces of Fedora for more rigorous testing. Aeolus will be one of
the projects involved with the cloud test day.
What I'm looking for is twofold:
1) We need a couple of volunteers to write up some aeolus-specific testing
information on the Fedora wiki. This should be instructions about how to
install the software, instructions about how to use it, and *specific* tests
that we would like to see people do. Some of this can be copy-n-pasted (or
linked) from the aeolus website, but some of it will be Fedora specific.
2) On the test day, it would be best if as many people as possible from the
Aeolus team are involved. In particular, we should make sure that the people
from the team are available on IRC (Freenode: #fedora-test-day) to help others
out for testing, and we should also make sure that people from the team are
doing tests themselves.
Here are some links with more information:
https://fedoraproject.org/wiki/Test_Day
https://fedoraproject.org/wiki/QA/Fedora_16_test_days
https://fedoraproject.org/wiki/QA/SOP_Test_Day_management
Note that whoever takes on the first job above should coordinate with Robyn
Bergeron (rbergeron on Freenode IRC) about the Test Day.
Please let me know if you have any questions.
--
Chris Lalancette
12 years, 7 months
[PATCH] Better error handling on instance start.
by Ian Main
This provides better error handling on instance start and will set the
task state to CREATE_FAILED on failure. It also sets last_error on
the instance properly.
Signed-off-by: Ian Main <imain(a)redhat.com>
---
src/app/util/taskomatic.rb | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/app/util/taskomatic.rb b/src/app/util/taskomatic.rb
index 155abe6..7094b1d 100644
--- a/src/app/util/taskomatic.rb
+++ b/src/app/util/taskomatic.rb
@@ -42,9 +42,9 @@ module Taskomatic
task.instance.save!
rescue HttpException => ex
task.failure_code = Task::FAILURE_PROVIDER_CONTACT_FAILED
- handle_create_instance_error(task, ex)
+ handle_instance_error(task, ex)
rescue Exception => ex
- handle_create_instance_error(task, ex)
+ handle_instance_error(task, ex)
ensure
task.instance.save!
task.save!
@@ -62,16 +62,19 @@ module Taskomatic
task.save!
dcloud_instance.send(action)
+ handle_dcloud_error(dcloud_instance)
Rails.logger.info("Task instance '#{action}' complete, now in state #{dcloud_instance.state}.")
task.instance.state = dcloud_to_instance_state(dcloud_instance.state)
- task.instance.save!
task.state = Task::STATE_FINISHED
+ rescue HttpException => ex
+ task.failure_code = Task::FAILURE_PROVIDER_CONTACT_FAILED
+ handle_instance_error(task, ex)
rescue Exception => ex
- task.state = Task::STATE_FAILED
- task.message = ex.message
+ handle_instance_error(task, ex)
ensure
+ task.instance.save!
task.save!
end
end
@@ -137,11 +140,12 @@ module Taskomatic
raise HttpException, "Error creating dcloud instance, returned internal server error." if dcloud_instance.class == Net::HTTPInternalServerError
end
- def self.handle_create_instance_error(task, ex)
+ def self.handle_instance_error(task, ex)
Rails.logger.error ex.message
Rails.logger.error ex.backtrace.join("\n")
task.state = Task::STATE_FAILED
task.instance.state = Instance::STATE_CREATE_FAILED
+ task.instance.last_error = ex.message
raise ex
end
--
1.7.6.2
12 years, 7 months
[PATCH conductor 4/7] added api controllers+views into specfile
by Maros Zatko
From: Maros Zatko <mzatko(a)redhat.com>
---
aeolus-conductor.spec.in | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/aeolus-conductor.spec.in b/aeolus-conductor.spec.in
index 8d5e1eb..842d4a6 100644
--- a/aeolus-conductor.spec.in
+++ b/aeolus-conductor.spec.in
@@ -138,7 +138,9 @@ haml="app/views/hardware_profiles app/views/realm_mappings \
app/views/deployments app/views/pools \
app/views/instances app/views/user_sessions \
app/views/catalog_entries app/views/catalogs \
- app/views/provider_types"
+ app/views/provider_types app/views/api/images \
+ app/views/api/builds app/views/api/provider_images \
+ app/views/api/target_images"
html="public"
ico="public"
jpg="public/images public/stylesheets/images"
@@ -152,8 +154,8 @@ opts="spec"
png="public/images public/images/icons public/stylesheets/images \
public/stylesheets/jquery.ui-1.8.1/images"
rake="lib/tasks"
-rb="app/models app/controllers app/helpers app/services app/util config \
- config/initializers config/environments db db/migrate \
+rb="app/models app/controllers app/controllers/api app/helpers app/services app/util \
+ config config/initializers config/environments db db/migrate \
features/support features/step_definitions lib spec spec/controllers \
spec/factories spec/helpers spec/models spec/services"
rhtml="app/views/layouts"
@@ -301,6 +303,9 @@ fi
%{app_root}/spec
%changelog
+* Tue Oct 04 2011 Maros Zatko <mzatko(a)redhat.com> - 0.4.0-1
+- added controllers/api + views
+
* Thu Jul 21 2011 Mo Morsi <mmorsi(a)redhat.com> - 0.3.0-2
- update Source0 checkout instructions
--
1.7.6.2
12 years, 7 months
[PATCH conductor] HW profile perms checked when launching a deployment
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
https://www.aeolusproject.org/redmine/issues/2402
---
src/app/models/deployment.rb | 11 +++++++++--
src/spec/models/deployment_spec.rb | 12 +++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
index 0fb8e7c..1190334 100644
--- a/src/app/models/deployment.rb
+++ b/src/app/models/deployment.rb
@@ -152,7 +152,7 @@ class Deployment < ActiveRecord::Base
begin
task = nil
Instance.transaction do
- hw_profile = HardwareProfile.frontend.find_by_name(assembly.hwp)
+ hw_profile = permissioned_frontend_hwprofile(user, assembly.hwp)
raise "Hardware Profile #{assembly.hwp} not found." unless hw_profile
instance = Instance.create!(
:deployment => self,
@@ -220,7 +220,7 @@ class Deployment < ActiveRecord::Base
errs = {}
deployable_xml.assemblies.each do |assembly|
begin
- hw_profile = HardwareProfile.frontend.find_by_name(assembly.hwp)
+ hw_profile = permissioned_frontend_hwprofile(user, assembly.hwp)
raise "Hardware Profile #{assembly.hwp} not found." unless hw_profile
instance = Instance.new(
:deployment => self,
@@ -316,4 +316,11 @@ class Deployment < ActiveRecord::Base
return
end
end
+
+ private
+
+ def permissioned_frontend_hwprofile(user, hwp_name)
+ HardwareProfile.list_for_user(user, Privilege::VIEW,
+ :conditions => ['hardware_profiles.name = :name AND provider_id IS NULL', {:name => hwp_name}]).first
+ end
end
diff --git a/src/spec/models/deployment_spec.rb b/src/spec/models/deployment_spec.rb
index c7bbe17..3251fb6 100644
--- a/src/spec/models/deployment_spec.rb
+++ b/src/spec/models/deployment_spec.rb
@@ -111,7 +111,8 @@ describe Deployment do
provider_name = Image.find(image_id).latest_build.provider_images.first.provider_name
provider = FactoryGirl.create(:mock_provider, :name => provider_name)
@deployment.pool.pool_family.provider_accounts = [FactoryGirl.create(:mock_provider_account, :label => 'testaccount', :provider => provider)]
- @user_for_launch = FactoryGirl.create(:user)
+ admin_perms = FactoryGirl.create :admin_permission
+ @user_for_launch = admin_perms.user
end
it "should return errors when checking assemblies matches which are not launchable" do
@@ -129,6 +130,15 @@ describe Deployment do
@deployment.instances.count.should == 2
end
+ it "should not launch instances if user has no access to hardware profile" do
+ @deployment.save!
+ @deployment.instances.should be_empty
+
+ Taskomatic.stub!(:create_instance).and_return(true)
+ @deployment.launch(@user_for_launch)[:errors].should be_empty
+ @deployment.instances.count.should == 2
+ end
+
end
it "should be able to stop running instances on deletion" do
--
1.7.6
12 years, 7 months
[PATCH] Fixed hw property enum nil value exceptions
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
https://www.aeolusproject.org/redmine/issues/2453
---
src/app/models/hardware_profile.rb | 34 ++++++-----------------
src/app/models/hardware_profile_property.rb | 2 +-
src/spec/factories/hardware_profile.rb | 9 ++++++
src/spec/factories/hardware_profile_property.rb | 7 +++++
src/spec/models/hardware_profile_spec.rb | 9 +++++-
5 files changed, 34 insertions(+), 27 deletions(-)
diff --git a/src/app/models/hardware_profile.rb b/src/app/models/hardware_profile.rb
index 2a5268e..cfe7022 100644
--- a/src/app/models/hardware_profile.rb
+++ b/src/app/models/hardware_profile.rb
@@ -137,29 +137,13 @@ class HardwareProfile < ActiveRecord::Base
def self.match_provider_hardware_profile(provider, hardware_profile)
hardware_profiles = match_hardware_profiles(provider, hardware_profile)
- matched_hwp = hardware_profiles.first
- value = '99999999'
- hardware_profiles.each do |hwp|
- case hwp.memory.kind
- when "fixed"
- if BigDecimal.new(hwp.memory.value.to_s) < BigDecimal.new(value.to_s)
- value = hwp.memory.value
- matched_hwp = hwp
- end
- when "range"
- if BigDecimal.new(hwp.memory.range_last.to_s) < BigDecimal.new(value.to_s)
- value = hwp.memory.range_last
- matched_hwp = hwp
- end
- when "enum"
- values = create_array_from_property(hwp.memory.to_s).sort
- if BigDecimal.new(value.last) < BigDecimal.new(value.to_s)
- value = values.last
- matched_hwp = hwp
- end
- end
- end
- return matched_hwp
+ # there can be multiple matching hw profiles,
+ # for now pick hw profile with lowest memory.
+ # (supposing that memory is most expensive component
+ # of hw profile)
+ hardware_profiles.sort do |hw1, hw2|
+ BigDecimal.new(hw1.memory.sort_value(false).to_s) <=> BigDecimal.new(hw2.memory.sort_value(false).to_s)
+ end.first
end
def self.generate_override_property_values(front_end_hwp, back_end_hwp)
@@ -180,7 +164,7 @@ class HardwareProfile < ActiveRecord::Base
return front_end_property.value.present? ? front_end_property.value : back_end_property.value
when "enum"
create_array_from_property(back_end_property).sort!.each do |value|
- if BigDecimal.new(value) >= BigDecimal.new(front_end_property.value)
+ if front_end_property.value.nil? or BigDecimal.new(value) >= BigDecimal.new(front_end_property.value)
return value
end
end
@@ -223,7 +207,7 @@ class HardwareProfile < ActiveRecord::Base
match = BigDecimal.new(back_end_property.range_last.to_s) >= BigDecimal.new(front_end_property.value.to_s) ? true : false
when "enum"
create_array_from_property(back_end_property).each do |value|
- if BigDecimal.new(value) >= BigDecimal.new(front_end_property.value.to_s)
+ if front_end_property.value.nil? or BigDecimal.new(value) >= BigDecimal.new(front_end_property.value)
match = true
end
end
diff --git a/src/app/models/hardware_profile_property.rb b/src/app/models/hardware_profile_property.rb
index 41ba959..6cf38ca 100644
--- a/src/app/models/hardware_profile_property.rb
+++ b/src/app/models/hardware_profile_property.rb
@@ -136,7 +136,7 @@ class HardwareProfileProperty < ActiveRecord::Base
when "fixed"
sort_value = value
when "range"
- sort_value = ascending ? range_from : range_to
+ sort_value = ascending ? range_first : range_last
when "enum"
entries = (property_enum_entries.map { |enum| enum.value }).sort!
sort_value = ascending ? entries.first : entries.last
diff --git a/src/spec/factories/hardware_profile.rb b/src/spec/factories/hardware_profile.rb
index d505838..c8ac8c6 100644
--- a/src/spec/factories/hardware_profile.rb
+++ b/src/spec/factories/hardware_profile.rb
@@ -93,4 +93,13 @@ FactoryGirl.define do
external_key 'front_nil_cpu'
end
+ factory :front_end_nil_storage, :parent => :hardware_profile do
+ memory { |p| p.association(:front_hwp3_memory) }
+ storage { |p| p.association(:hwpp_nil_storage) }
+ cpu { |p| p.association(:front_hwp1_cpu) }
+ architecture { |p| p.association(:front_hwp3_arch) }
+ name 'front_nil_storage'
+ external_key 'front_nil_storage'
+ end
+
end
diff --git a/src/spec/factories/hardware_profile_property.rb b/src/spec/factories/hardware_profile_property.rb
index 9ddde28..7b78868 100644
--- a/src/spec/factories/hardware_profile_property.rb
+++ b/src/spec/factories/hardware_profile_property.rb
@@ -243,4 +243,11 @@ FactoryGirl.define do
value nil
end
+ factory :hwpp_nil_storage, :parent => :hardware_profile_property do
+ name 'storage'
+ kind 'enum'
+ unit 'GB'
+ value nil
+ end
+
end
diff --git a/src/spec/models/hardware_profile_spec.rb b/src/spec/models/hardware_profile_spec.rb
index fcf9296..6fef1fe 100644
--- a/src/spec/models/hardware_profile_spec.rb
+++ b/src/spec/models/hardware_profile_spec.rb
@@ -95,7 +95,7 @@ describe HardwareProfile do
front_end_cpu = FactoryGirl.create(:hwpp_fixed, :name => 'cpu', :unit => 'count', :value => '2')
front_end_architecture = FactoryGirl.create(:hwpp_fixed, :name => 'architecture', :unit => 'label', :value => 'x86_64')
- back_end_memory1 = FactoryGirl.create(:hwpp_range, :name => 'memory', :unit => 'MB', :value => '4048', :range_first => '1024', :range_last => '4048')
+ back_end_memory1 = create_hwpp_enum(['1024', '2048', '4048'], {:name => 'memory', :unit => 'MB', :value => '4048'})
back_end_storage1 = create_hwpp_enum(['500', '1500', '2000'], {:name => 'storage', :unit => 'GB', :value => '1500'})
back_end_cpu1 = FactoryGirl.create(:hwpp_range, :name => 'cpu', :unit => 'count', :value => '4', :range_first => '1', :range_last => '4')
back_end_architecture1 = FactoryGirl.create(:hwpp_fixed, :name => 'architecture', :unit => 'label', :value => 'x86_64')
@@ -215,6 +215,13 @@ describe HardwareProfile do
overrides[:cpu].should_not be_blank
end
+ it "should handle nils in enum values in generate_override_property_values" do
+ p = create_hwpp_enum(['500', '1500', '2000'], {:name => 'storage', :unit => 'GB', :value => '1500'})
+ fe_hwp = Factory.create(:front_end_nil_storage)
+ be_hwp = Factory.create(:mock_hwp2, :storage => p)
+ overrides = HardwareProfile.generate_override_property_values(fe_hwp, be_hwp)
+ overrides[:storage].should_not be_blank
+ end
def create_hwpp_enum(value_array, properties = {})
hwpp_enum = FactoryGirl.create(:hwpp_enum, properties)
--
1.7.6.2
12 years, 7 months
[PATCH 0/9] Adds support for launch-time parameter collection (rev. 2)
by Greg Blomquist
This is the second revision of this patchset. The original was sent on
04-Oct-2011. This revision fixes a rebase regression so that user data is now
propagated to deltacloud through taskomatic. Also, this revision removes the
requirement for a deployableXML file to contain a mandatory description
element.
This patch adds the ability to collect launch-time parameters and propagate
those parameters to a config server.
To do this, several pieces have been added:
* add/manage config server connections per provider account
* updated deployable_xml to know about "services"
* UI elements added to collect launch-parameters (service parameters) during
deployment launch
* model elements added to capture launch parameters for later retrieval
* UI added to display launch parameters post-launch
12 years, 7 months
[PATCH conductor] BZ#743992 Pool-> Catalog Entries will create a 500 error if
by Chris Alfonso
BZ#743992 Pool-> Catalog Entries will create a 500 error if template is moved/renamed
I've fixed the code to recover gracefully when the deployment.xml is missing as stated in this defect.
The Catalog Images page under pools probably needs a bit of tlc, but that UI improvement will be in
a commit outside the scope of the bz fix.
12 years, 7 months
Factory write immediately to warehouse?
by Martyn Taylor
We have a requirement in conductor that requires an owner to be set on
images in the warehouse. It is currently difficult to do this for two
reasons:
1. Factory does not offer a way to specify owner information through its
interfaces.
and I personally do not think that factory should have to offer this
functionality
2. Factory does not write to warehouse straight away.
Since factory does not write to warehouse before returning a response,
(containing i.d. information), it is not possible for conductor to add a
tag to the appropriate objects in warehouse as they don't yet exist. In
addition this behaviour means that we can not get any information on
images (other than status) whilst they are in factory (building). This
means we are having to either:
a) Monitor Factory Progress then update the warehouse when its done.
or
b) Store metadata in conductor that ties warehouse objects together.
I personally feel that all metadata should exist in warehouse only and
it is not practical for us to monitor status of builds, we really want
to kick them off then just get any information from warehouse. So
neither of these solutions are ideal.
Really we hope that factory could offer the behaviour as described, I
know myself, Steve, Ian and Jay have talked about this in the past, so
apologies for bringing this up again, but this seems like it's starting
to become a recurring theme.
Can people reply with thoughts/ideas on this.
Thanks
Martyn
12 years, 7 months
Nightly builds version change
by Michal Fojtik
Hi,
I recently changed the version schema I use for the deltacloud-core nightly builds.
The current schema is:
deltacloud-core-[NEXT_RELEASE_VERSION]-9999.[GIT_SHORT_TAG]git.noarch
Please reinstall deltacloud-core if you are using version deltacloud-core-0.5.0.
Sorry for all inconveniences...
-- Michal
------------------------------------------------------
Michal Fojtik, mfojtik(a)redhat.com
Deltacloud API: http://deltacloud.org
12 years, 7 months
[PATCH conductor] fixed deployments controller spec
by Tomas Hrcka
---
src/app/models/deployment.rb | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
index 2edd65e..0fb8e7c 100644
--- a/src/app/models/deployment.rb
+++ b/src/app/models/deployment.rb
@@ -305,11 +305,15 @@ class Deployment < ActiveRecord::Base
end
def deployment_state
- return instances.first.state if not instances.empty? and instances.length == 1
- oracle = instances.first.state
- instances.each do |i|
- return STATE_MIXED if i.state != oracle
+ unless instances.empty?
+ return instances.first.state if not instances.empty? and instances.length == 1
+ oracle = instances.first.state
+ instances.each do |i|
+ return STATE_MIXED if i.state != oracle
+ end
+ return oracle
+ else
+ return
end
- return oracle
end
end
--
1.7.6.4
12 years, 7 months