Conductor API + aeolus-image: Multiple Push + Push Syntax approach
by Martyn Taylor
Gents.
As discussed on previous threads, the push syntax has now changed in
aeolus-image.
The decision to change the syntax was made based on changes in the new
Factory Rest API. The factory Rest API no longer supports multiple push
and requires the image, build and targetimage to be supplied in the push
request. We reflected this in the conductor API and as a result lost
the ability for multiple push and changed the push syntax in
aeolus-image to be more complex.
In order to add multiple push support and provide a simpler syntax in
aeolus-image. We shall expose a multiple push API through conductor.
This will take an image, build or targetimage and a list of provider
accounts a user wishes to push to. Conductor will determine the
targetimages to push by looking them up iwhd and create individual
requests for each targetimage to factory.
These changes will be reflected in aeolus-image, the new syntax will
look like:
aeolus-image push --image 12343214132 --accounts ec2-acc,mock-acc,rhevm-acc
aeolus-image push --build 12343214132 --accounts ec2-acc,mock-acc,rhevm-acc
aeolus-image push --targetimage 12343214132 --accounts ec2-acc
N.B. This requires that the image or build has associated targetimages
which are built for the provider each account is associated with. If
the request for multiple push is received by conductor and an
appropriate targetimage is not found. Conductor will continue to push
to the providers that targetimages are found and return an appropriate
error for those that failed.
Thanks
Martyn
12 years, 4 months
[PATCH conductor] Marking the deployment features as @wip so that they aren't run implicitly.
by Chris Alfonso
The deployment features currently rely on the deltacloud-core service running.
rake cucumber will by default not run tests marked with the tag @wip
To run the @wip tests with rake, use rake cucumber:wip
You can also exclude the @wip tests using cucumber directly with,
cucumber --tags ~@wip <feature>
---
src/features/deployment.feature | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/features/deployment.feature b/src/features/deployment.feature
index 0df9549..6eec21a 100644
--- a/src/features/deployment.feature
+++ b/src/features/deployment.feature
@@ -26,6 +26,7 @@ Feature: Manage Deployments
#It's difficult to mock out all the dependencies to get the instance launching
#working in a testable scenario.
+ @wip
Scenario: Launch new deployment
Given a pool "mockpool" exists
And there is "front_hwp1" conductor hardware profile
@@ -79,6 +80,7 @@ Feature: Manage Deployments
And I press "stop_button"
Then I should see "testdeployment"
+ @wip
Scenario: Stop a deployment over XHR
Given there is a deployment named "testdeployment" belonging to "testdeployable" owned by "testuser"
And I request XHR
@@ -175,6 +177,7 @@ Feature: Manage Deployments
When I follow "details_instances"
Then I should see "testdeployment"
+ @wip
Scenario: Delete a deployment
Given there is a deployment named "testdeployment" belonging to "testdeployable" owned by "testuser"
And I am on the pools page
@@ -182,6 +185,7 @@ Feature: Manage Deployments
And I press "delete"
Then I should see "The deployment testdeployment was scheduled for deletion"
+ @wip
Scenario: Delete multiple deployments
Given a deployment "mydeployment1" exists
And a deployment "mydeployment2" exists
@@ -193,6 +197,7 @@ Feature: Manage Deployments
And I press "delete_button"
Then I should see "The deployments mydeployment1, mydeployment2 were scheduled for deletion"
+ @wip
Scenario: Delete a deployment with running instances
Given a deployment "mockdeployment" exists
And the deployment "mockdeployment" has an instance named "myinstance"
--
1.7.6.4
12 years, 4 months
[PATCH conductor] Added a few more @wip to tests that require deltacloud-core to be running.
by Chris Alfonso
---
src/features/instance.feature | 2 ++
src/features/provider.feature | 2 ++
src/features/provider_account.feature | 1 +
3 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/features/instance.feature b/src/features/instance.feature
index c36647c..a51f22d 100644
--- a/src/features/instance.feature
+++ b/src/features/instance.feature
@@ -65,6 +65,7 @@ Feature: Manage Instances
Then I should get back a partial
And I should see "Name"
+ @wip
Scenario: Stop instance
Given there is a "mock1" running instance
And I am on the instances page
@@ -73,6 +74,7 @@ Feature: Manage Instances
Then I should be on the instances page
And I should see "mock1: stop action was successfully queued"
+ @wip
Scenario: Stop multiple instances
Given there is a "mock1" running instance
And there is a "mock2" running instance
diff --git a/src/features/provider.feature b/src/features/provider.feature
index 44c3c11..f8abd93 100644
--- a/src/features/provider.feature
+++ b/src/features/provider.feature
@@ -45,6 +45,7 @@ Feature: Manage Providers
Then I should see "Provider Name"
And I should see "Provider URL"
+ @wip
Scenario: Create a new Provider
Given I am on the providers page
And there is not a provider named "testprovider"
@@ -83,6 +84,7 @@ Feature: Manage Providers
And there should not be a provider account
And there should not be a realm
+ @wip
Scenario: Disable a provider
Given there is a provider named "provider1"
And this provider has a provider account with 2 running instances
diff --git a/src/features/provider_account.feature b/src/features/provider_account.feature
index fd078fd..bc68999 100644
--- a/src/features/provider_account.feature
+++ b/src/features/provider_account.feature
@@ -27,6 +27,7 @@ Feature: Manage Provider Accounts
| name | provider | provider_type | access_key | secret_access_key |
| ec2_account | ec2provider| ec2 |||
+ @wip
Scenario: Create a new Provider Account
Given there is a provider named "testprovider"
And there are no provider accounts
--
1.7.6.4
12 years, 4 months
[PATCH conductor] BZ 746032 - fixed error message when provider is disabled
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
---
src/app/models/deployment.rb | 3 ++-
src/app/models/instance.rb | 17 +++++++----------
src/app/models/pool.rb | 4 ----
src/app/models/pool_family.rb | 4 ++--
src/app/models/provider_account.rb | 4 ----
src/config/locales/en.yml | 4 ++++
src/spec/models/instance_spec.rb | 21 ++++++++++++++++-----
7 files changed, 31 insertions(+), 26 deletions(-)
diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
index e75c113..c83fcca 100644
--- a/src/app/models/deployment.rb
+++ b/src/app/models/deployment.rb
@@ -93,7 +93,8 @@ class Deployment < ActiveRecord::Base
end
def pool_must_be_enabled
- errors.add(:pool, "must be enabled") unless pool and pool.enabled?
+ errors.add(:pool, I18n.t('pools.errors.must_be_enabled')) unless pool and pool.enabled?
+ errors.add(:pool, I18n.t('pools.errors.providers_disabled')) if pool and pool.pool_family.all_providers_disabled?
end
def object_list
diff --git a/src/app/models/instance.rb b/src/app/models/instance.rb
index a83b2f5..9d9c634 100644
--- a/src/app/models/instance.rb
+++ b/src/app/models/instance.rb
@@ -163,17 +163,9 @@ class Instance < ActiveRecord::Base
return_val
end
- def enabled?
- pool and pool.enabled? and (provider_account.nil? or provider_account.enabled?)
- end
-
def pool_and_account_enabled_validation
- return if enabled?
-
- errors.add(:pool, 'must be enabled') unless pool and pool.enabled?
- unless provider_account.nil? or provider_account.enabled?
- errors.add(:provider_account, 'must be enabled')
- end
+ errors.add(:pool, I18n.t('pools.errors.must_be_enabled')) unless pool and pool.enabled?
+ errors.add(:pool, I18n.t('pools.errors.providers_disabled')) if pool and pool.pool_family.all_providers_disabled?
end
@@ -338,6 +330,11 @@ class Instance < ActiveRecord::Base
provider_images = build ? build.provider_images : []
matched = []
pool.pool_family.provider_accounts.each do |account|
+ unless account.provider.enabled?
+ errors << I18n.t('instances.errors.must_be_enabled', :account_name => account.name)
+ next
+ end
+
# match_provider_hardware_profile returns a single provider
# hardware_profile that can satisfy the input hardware_profile
hwp = HardwareProfile.match_provider_hardware_profile(account.provider,
diff --git a/src/app/models/pool.rb b/src/app/models/pool.rb
index ce8d83b..14e8a6d 100644
--- a/src/app/models/pool.rb
+++ b/src/app/models/pool.rb
@@ -77,10 +77,6 @@ class Pool < ActiveRecord::Base
instances.all? {|i| i.destroyable? }
end
- def enabled?
- self.enabled and pool_family and pool_family.enabled?
- end
-
# TODO: Implement Alerts and Updates
def statistics
# TODO - Need to set up cache invalidation before this is safe
diff --git a/src/app/models/pool_family.rb b/src/app/models/pool_family.rb
index 26d5efb..4cad050 100644
--- a/src/app/models/pool_family.rb
+++ b/src/app/models/pool_family.rb
@@ -65,7 +65,7 @@ class PoolFamily < ActiveRecord::Base
self != PoolFamily.default
end
- def enabled?
- provider_accounts.blank? or provider_accounts.any? {|acc| acc.enabled?}
+ def all_providers_disabled?
+ !provider_accounts.empty? and !provider_accounts.any? {|acc| acc.provider.enabled?}
end
end
diff --git a/src/app/models/provider_account.rb b/src/app/models/provider_account.rb
index 38083c2..4e3242e 100644
--- a/src/app/models/provider_account.rb
+++ b/src/app/models/provider_account.rb
@@ -125,10 +125,6 @@ class ProviderAccount < ActiveRecord::Base
instances.empty? || instances.all? { |i| i.destroyable? }
end
- def enabled?
- provider and provider.enabled?
- end
-
def connect
begin
opts = {:username => credentials_hash['username'],
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index c62c67a..666c057 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -334,6 +334,7 @@ en:
provider_account_quota_too_low: "%{match_provider_account} quota limit too low to launch deployable"
stop_invalid: "stop is an invalid action."
stop_not_be_performed: "stop cannot be performed on this instance."
+ must_be_enabled: "%{account_name}: provider must be enabled"
headers:
vm_name: VM NAME
status: STATUS
@@ -406,6 +407,9 @@ en:
instance_or: instance or
unlimited: unlimited
pool_enabled: Pool enabled
+ errors:
+ providers_disabled: has all associated providers disabled
+ must_be_enabled: must be enabled
hardware_profiles:
hardware: Hardware
hardware_profile: Hardware Profile
diff --git a/src/spec/models/instance_spec.rb b/src/spec/models/instance_spec.rb
index 4ffdae0..2ac70f9 100644
--- a/src/spec/models/instance_spec.rb
+++ b/src/spec/models/instance_spec.rb
@@ -230,16 +230,27 @@ describe Instance do
export_string.include?("created").should be_true
end
- it "should not be launchable if its provider is disabled" do
- instance = FactoryGirl.build(:instance_with_disabled_provider)
- instance.should_not be_enabled
- instance.should_not be_valid
+ it "should not be launchable on disabled provider account" do
+ instance = FactoryGirl.create(:instance)
+ pf = instance.pool.pool_family
+ pf.provider_accounts = [FactoryGirl.create(:disabled_provider_account)]
+ errors = instance.matches.last
+ errors.find {|e| e =~ /provider must be enabled/}.should_not be_nil
end
it "should not be launchable if its pool is disabled" do
instance = FactoryGirl.build(:instance_in_disabled_pool)
- instance.should_not be_enabled
instance.should_not be_valid
+ instance.errors[:pool].should_not be_empty
+ instance.errors[:pool].first.should == "must be enabled"
+ end
+
+ it "should not be launchable if its pool's providers are all disabled" do
+ instance = FactoryGirl.build(:instance)
+ instance.pool.pool_family.provider_accounts << FactoryGirl.create(:disabled_provider_account)
+ instance.should_not be_valid
+ instance.errors[:pool].should_not be_empty
+ instance.errors[:pool].first.should == "has all associated providers disabled"
end
context "When more instances of deployment are starting" do
--
1.7.6
12 years, 4 months
Trademarked image included in conductor
by James Laska
Greetings gang,
Not sure whether branding is a high priority at the moment, but I did
want to highlight that aeolus-conductor includes a trademarked Red Hat
logo (/usr/share/aeolus-conductor/public/images/rh_logo.png).
From
https://fedoraproject.org/wiki/Legal:Trademark_guidelines#Logo_Usage_Guid... ...
"Red Hat, Inc. ("Red Hat") does not permit use of its registered
trademarks without permission. If you are aware of any such use,
please contact us at fedora-legal(a)redhat.com."
Some options that come to mind ...
1. If the red hat logo is needed in Fedora, Spot is willing to add
rh-logo to the fedora-logos package. Other packages that need
the rh-logo would just need to %requires fedora-logos
2. Another option would be to rely on the system-logos %provides,
and just reference the logo provided there. Both Fedora and
RHEL offer %provides for system-logos [1]. For conductor in
Fedora, you'd get a Fedora logo. For conductor in RHEL, you'd
get the Red Hat logo. A symlink would be needed in the %files
for conductor to ensure the logo is accessible in the web root?
3. Another option ... remove the logo usage from the web-ui
entirely
4. Yet another option ... create some sort of custom upstream logo?
Thoughts/comments/concerns?
Thanks,
James
[1] Okay I lied, redhat-logos doesn't appear to offer the %provides yet,
but it should. Investigating... Either way, it should be
straightforward to special case the %{dist} in the .spec file.
12 years, 4 months
removed footer
by Jan Provazník
Hi,
there was a request to remove footer attached to mails bounced by
aeolus-devel mailing list. Reason for this is that utf-8 mails are
recoded with base64 then, more info is here:
http://mail.python.org/pipermail/mailman-users/2008-September/063295.html
Honestly I don't think that base64 recoding is an issue, but I don't
care much about footer. I disabled it for now as it could help others
who don't like base64 body, if you have objections let me know or
reenable it in admin section of mailing list (if you have perms) by
filling "Footer added to every digest" with this:
_______________________________________________
%(real_name)s mailing list
%(real_name)s@%(host_name)s
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
Jan
12 years, 4 months
no more gratuitously base64-obfuscated bodies for aeolus-devel
by Jim Meyering
Yesterday, by chance, I noticed that all messages to this list
were being base64-encoded, apparently unconditionally.
I brought it up on IRC and Jan Provaznik discovered that removing
the list's mailman-added footer would disable this misfeature.
He made that change, so this message should go through unmolested.
Thanks, Jan.
12 years, 4 months