[PATCH aggregator 1/2] limits template name to standard db varchar length of 255 characters
by Mo Morsi
---
src/app/models/template.rb | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/app/models/template.rb b/src/app/models/template.rb
index 9264e76..e9f2327 100644
--- a/src/app/models/template.rb
+++ b/src/app/models/template.rb
@@ -14,6 +14,7 @@ class Template < ActiveRecord::Base
# unset)
validates_presence_of :name
validates_uniqueness_of :name
+ validates_length_of :name, :maximum => 255
validates_presence_of :platform
validates_presence_of :platform_version
validates_presence_of :architecture
--
1.7.2.3
13 years, 7 months
[PATCH aggregator] BZ 643915: elaborate errors reported by registration service
by Mo Morsi
---
src/app/services/registration_service.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/app/services/registration_service.rb b/src/app/services/registration_service.rb
index 046fdcd..06d2749 100644
--- a/src/app/services/registration_service.rb
+++ b/src/app/services/registration_service.rb
@@ -7,7 +7,7 @@ class RegistrationService
def save
unless valid?
- @error = "validation failed"
+ @error = "validation failed #{(a)user.errors.full_messages.join(',')}"
return false
end
--
1.7.2.3
13 years, 7 months
[PATCH docs] BZ 645124: Add end-to-end initial usage documentation
by Steve Linabery
---
deltacloud.org/content/use.haml | 8 +++
deltacloud.org/lib/documentation.rb | 1 +
docs/use.mdown | 87 +++++++++++++++++++++++++++++++++++
3 files changed, 96 insertions(+), 0 deletions(-)
create mode 100644 deltacloud.org/content/use.haml
create mode 100644 docs/use.mdown
diff --git a/deltacloud.org/content/use.haml b/deltacloud.org/content/use.haml
new file mode 100644
index 0000000..8abaab7
--- /dev/null
+++ b/deltacloud.org/content/use.haml
@@ -0,0 +1,8 @@
+---
+title: Deltacloud - Documentation
+area: documentation
+extension: html
+filter:
+ - haml
+---
+= render(:partial => "external", :locals => { :path => '../docs/use.mdown' })
diff --git a/deltacloud.org/lib/documentation.rb b/deltacloud.org/lib/documentation.rb
index 4863732..676a7de 100644
--- a/deltacloud.org/lib/documentation.rb
+++ b/deltacloud.org/lib/documentation.rb
@@ -2,6 +2,7 @@ module DocumentationHelper
def documentation_pages
[
{ :href => 'documentation.html', :menu => 'Overview' },
+ { :href => 'use.html', :menu => 'Post-Install', :description => 'Post-installation End-to-End Usage Documentation' },
{ :href => "api.html" , :menu => 'REST API', :description => 'REST API definition' },
{ :href => "drivers.html" , :menu => 'Drivers', :description => 'Currently-supported drivers' },
{ :href => "framework.html" , :menu => 'Framework', :description => 'Framework for writing additional drivers' },
diff --git a/docs/use.mdown b/docs/use.mdown
new file mode 100644
index 0000000..e3b8f9c
--- /dev/null
+++ b/docs/use.mdown
@@ -0,0 +1,87 @@
+Now that you have successfully installed the set of deltacloud packages and run deltacloud-configure, you can use the web interface to start and manage instances. We'll be using EC2 as the 'back end' cloud provider for these instructions, although this is only one of many cloud services providers you can manage with deltacloud.
+
+#### Change Default Administrator Password ####
+
+The post-install default username/password combination is admin/password. We strongly recommend changing the default password as a basic protection against unauthorized use of your cloud resources.
+
+1. First browse to http://localhost/deltacloud/login
+
+1. In the Administer section, click 'System Settings', then Manage Users.
+
+1. Select the 'admin' user's radio button, and click 'edit' lefthand column, or just click the admin username link. Enter and confirm a new password and click 'save'.
+
+#### Add a Provider ####
+
+The next step is to add a cloud services Provider whose resources will be added to your Pool.
+
+1. In the Administer section, click 'System Settings', and then 'Manage Providers' in the resulting screen.
+
+1. On the 'Manage Providers' page, in the left hand-navigation column under 'Providers', click 'Add'.
+
+1. Enter a name for the provider (e.g. 'ec2') and for Provider URL, use 'http://localhost:3002/api'. You can test the provider URL by clicking 'Test Connection' and then add the provider if the connection test succeeds.
+
+You should now see your new provider listed on the left column labeled 'Providers,' and you should be at the Provider Summary for the new Provider.
+
+#### Add a Provider Account ####
+
+The Provider Account you add in this step will allow Deltacloud to access your Provider's resources using the account credentials.
+
+1. Click 'Provider Accounts' above the summary information area. Since you haven't previously added any accounts, you'll start at the NEW ACCOUNT form.
+
+1. Since we're using EC2, you will need five pieces of security credentials from EC2:
+ * Access Key ID
+ * Secret Access Key
+ * AWS Account ID
+ * EC2 x509 private key
+ * EC2 x509 public key
+
+
+ These can all be obtained via the [EC2 management console](https://aws-portal.amazon.com/gp/aws/developer/account/index.htm...
+
+ If you haven't already done so, you'll need to create a public/private X.509 pair and save them in your filesystem. EC2 naming convention for the private key is 'pk-ABCDEFG.pem', and for the public key, 'cert-HIJKLMN.pem'
+
+1. Enter these 5 credentials and give your Provider Account a name of your choosing (e.g. 'myEC2'). For now, leave the 'Quota Instance' field set to the default value of 'unlimited'.
+
+ (Note that if you test the account settings before clicking 'Add' you'll need to re-select your x.509 cert files.)
+
+#### Create a Template ####
+
+Now that your pool contains a cloud provider, you need to create an image to run an instance in your cloud. Please note that image building is currently supported only on 64-bit versions of Fedora 13, the platform we use for development and testing.
+
+1. In the 'Define' section, click 'Deployables'. Then in the left hand navigation bar, under CREATE NEW, click 'Template'.
+
+1. Give your template a name, and select 'Fedora 13 (64-bit)' for Platform Choice. Support for building RHEL images is forthcoming but not yet available.
+
+1. You'll see that you have the option to 'Add Software' packages from available repos, but refrain from adding any for your first image build. The default image for development contains a base set of packages that will allow you to do basic things like ssh in to your instance, etc. Once you're sure that your end-to-end setup is functional, you can experiment with adding packages to image builds.
+
+ Please also note the caveat that when using EC2 there is a 9.9GB image size limit, and exceeding it may lead to failed builds or instance starts. Aggregator does not precalculate image sizes.
+
+1. After saving your template, you should see it listed in all three sections of the Deployables screen: Templates, Assemblies and Deployables. For the moment, only Templates are functional. Select your new Template's radio button and click 'Build.'
+
+#### Build an Image ####
+
+1. On the following Build Request screen, be sure 'Amazon EC2' is checked as the Provider Format, and click 'Submit to Build'. You should now see the Builds screen with your new template in the 'RUNNING' table with 'queued' or 'building' status. Refresh this page periodically to check the progress of your build request.
+
+ If your build fails, you will see a new table listing failed builds. If the build succeeds, you will see it in a Completed table, with status of 'OK'.
+
+ Once your build has completed, you can use it to start an image. In the 'RUN' section, click 'Instance Management' and then the 'Launch Instance' button. Click the 'Launch' button under your new template's description.
+
+This brings you to the Launch Instance screen, where you should give your instance an identifying Name, select a hardware profile from the Hardware Profile dropdown, optionally choose a desired Realm, and then click 'Launch'. Typical instance start times are under five minutes, but your mileage may vary.
+
+Waiting for your new instance to start is an excellent time to confirm that your default security groups setting on EC2 allows connections via SSH on port 22. Consult EC2 documentation if you haven't already configured your default security group settings. This can be configured before, during, or after your instance's start up and takes effect immediately.
+
+#### Connect to Your New Instance ####
+
+Once you can see that your instance is in state 'running', you should download its ssh private key and try connecting to it.
+
+1. In the 'RUN' section, click 'Instance Management', select the radio button of your running instance, and click 'Instance Details'.
+
+1. Click the link to download your instance's ssh key and save it to your filesystem.
+
+1. 'chmod 600' the file you downloaded
+
+1. Now you should be able to connect with:
+
+ $ ssh -i the-key-you-downloaded.pem root(a)ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com
+
+ (substituting your actual key filename and FQHN)
--
1.7.2.3
13 years, 7 months
[PATCH aggregator] BZ #643916 limits user first and last names to standard db varchar length of 255 characters
by Mo Morsi
to display the validation error, the last patch i sent out
"elaborate errors reported by registration service" needs to
be applied
---
src/app/models/user.rb | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/app/models/user.rb b/src/app/models/user.rb
index fe429bd..8e007bc 100644
--- a/src/app/models/user.rb
+++ b/src/app/models/user.rb
@@ -27,4 +27,7 @@ class User < ActiveRecord::Base
belongs_to :quota, :autosave => true
accepts_nested_attributes_for :quota
+
+ validates_length_of :first_name, :maximum => 255
+ validates_length_of :last_name, :maximum => 255
end
--
1.7.2.3
13 years, 7 months
[PATCH aggregator] BZ 649397: gracefully handle and report errors on template creation
by Mo Morsi
Also limits template name to standard db varchar length of 255
characters. Eventually all the other db string fields should
have this validation
---
src/app/controllers/templates_controller.rb | 6 ++++--
src/app/models/template.rb | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/app/controllers/templates_controller.rb b/src/app/controllers/templates_controller.rb
index 3373c05..f9eaf5e 100644
--- a/src/app/controllers/templates_controller.rb
+++ b/src/app/controllers/templates_controller.rb
@@ -106,11 +106,13 @@ class TemplatesController < ApplicationController
# synchronize it at first to xml
@tpl.update_xml_attributes(params[:tpl])
- if @tpl.save
+ begin
+ @tpl.save!
flash[:notice] = "Template saved."
@tpl.set_complete
redirect_to :action => 'index'
- else
+ rescue Exception => e
+ flash[:notice] = "There was a problem saving the template: #{e.to_s}"
get_selected_packages(@tpl)
render :action => 'new'
end
diff --git a/src/app/models/template.rb b/src/app/models/template.rb
index 9264e76..e9f2327 100644
--- a/src/app/models/template.rb
+++ b/src/app/models/template.rb
@@ -14,6 +14,7 @@ class Template < ActiveRecord::Base
# unset)
validates_presence_of :name
validates_uniqueness_of :name
+ validates_length_of :name, :maximum => 255
validates_presence_of :platform
validates_presence_of :platform_version
validates_presence_of :architecture
--
1.7.2.3
13 years, 7 months
[PATCH aggregator] BZ #649397: limits template name to standard db varchar length of 255 characters
by Mo Morsi
Eventually all the other appropriate db string
fields should have this validation
---
src/app/models/template.rb | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/app/models/template.rb b/src/app/models/template.rb
index 9264e76..e9f2327 100644
--- a/src/app/models/template.rb
+++ b/src/app/models/template.rb
@@ -14,6 +14,7 @@ class Template < ActiveRecord::Base
# unset)
validates_presence_of :name
validates_uniqueness_of :name
+ validates_length_of :name, :maximum => 255
validates_presence_of :platform
validates_presence_of :platform_version
validates_presence_of :architecture
--
1.7.2.3
13 years, 7 months
Acceptance test
by Sang-Min Park
Dear all,
I am a software engineer at Eucalyptus systems.
We’re planning to work on getting Eucalyptus to work with DeltaCloud.
Probably, we’re going to use the existing EC2 drivers with minimal changes.
I have one question regarding testing procedure. Are there any acceptance
tests for a new driver implementation?
We want to know in general the QA process for DeltaCloud.
Thanks!
-------------------------------------------------------------
Sang-Min Park
Software Engineer, Eucalyptus Systems, Inc.
6755 Hollister Avenue | Goleta, CA | 93117
Office: 805-845-8000 (+9038) Cell: 434-825-4939
email: spark(a)eucalyptus.com <woody(a)eucalyptus.com>
www.eucalyptus.com
13 years, 7 months
[PATCH cloud engine 1/2] BZ642165: Add the tests for password confirmation
by Tomas Sedovic
From: Tomas Sedovic <tsedovic(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=642165
Steps:
(on the user edit page)
1. Leave the "Change Password" field blank
2. Fill in the "Confirm Password" field with some text
3. Press Save
The test is currently failing.
---
src/features/step_definitions/user_steps.rb | 3 +++
src/features/user.feature | 27 +++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 0 deletions(-)
create mode 100644 src/features/step_definitions/user_steps.rb
create mode 100644 src/features/user.feature
diff --git a/src/features/step_definitions/user_steps.rb b/src/features/step_definitions/user_steps.rb
new file mode 100644
index 0000000..09bbaf8
--- /dev/null
+++ b/src/features/step_definitions/user_steps.rb
@@ -0,0 +1,3 @@
+Given /^there is a user "([^"]*)"$/ do |name|
+ @user = User.find_by_login(name)
+end
diff --git a/src/features/user.feature b/src/features/user.feature
new file mode 100644
index 0000000..e11dfba
--- /dev/null
+++ b/src/features/user.feature
@@ -0,0 +1,27 @@
+Feature: Manage Users
+ In order to manage users
+ As an admin
+ I want to add/edit/remove users
+
+ Background:
+ Given I am an authorised user
+ And I am logged in
+ And a user "testuser" exists
+
+ Scenario: Change the password
+ Given I am on the users page
+ And there is a user "testuser"
+ When I follow "testuser"
+ Then I should see "Editing User:"
+ When I fill in "user[password]" with "new password"
+ And I fill in "user[password_confirmation]" with ""
+ And I press "Save"
+ Then I should see "Password doesn't match confirmation"
+ When I fill in "user[password]" with ""
+ And I fill in "user[password_confirmation]" with "new password"
+ And I press "Save"
+ Then I should see "Password doesn't match confirmation"
+ When I fill in "user[password]" with "new password"
+ And I fill in "user[password_confirmation]" with "new password"
+ And I press "Save"
+ Then I should see "User updated!"
--
1.7.2.3
13 years, 7 months
[PATCH docs] Add end-to-end initial usage documentation
by Steve Linabery
Includes post-install instructions which should get user to the point of ssh-ing to a running EC2 instance.
---
deltacloud.org/content/use.mdown | 92 ++++++++++++++++++++++++++++++++++++++
1 files changed, 92 insertions(+), 0 deletions(-)
create mode 100644 deltacloud.org/content/use.mdown
diff --git a/deltacloud.org/content/use.mdown b/deltacloud.org/content/use.mdown
new file mode 100644
index 0000000..361dc9c
--- /dev/null
+++ b/deltacloud.org/content/use.mdown
@@ -0,0 +1,92 @@
+---
+title: Deltacloud - Usage
+extension: html
+filter: markdown
+---
+Now that you have successfully installed the set of deltacloud packages and run deltacloud-configure, you can use the web interface to start and manage instances. We'll be using EC2 as the 'back end' cloud provider for these instructions, although this is only one of many cloud services providers you can manage with deltacloud.
+
+#### Change Default Administrator Password ####
+
+The post-install default username/password combination is admin/password. We strongly recommend changing the default password as a basic protection against unauthorized use of your cloud resources.
+
+1. First browse to http://localhost/deltacloud/login
+
+1. In the Administer section, click 'System Settings', then Manage Users.
+
+1. Select the 'admin' user's radio button, and click 'edit' lefthand column, or just click the admin username link. Enter and confirm a new password and click 'save'.
+
+#### Add a Provider ####
+
+The next step is to add a cloud services Provider whose resources will be added to your Pool.
+
+1. In the Administer section, click 'System Settings', and then 'Manage Providers' in the resulting screen.
+
+1. On the 'Manage Providers' page, in the left hand-navigation column under 'Providers', click 'Add'.
+
+1. Enter a name for the provider (e.g. 'ec2') and for Provider URL, use 'http://localhost:3002/api'. You can test the provider URL by clicking 'Test Connection' and then add the provider if the connection test succeeds.
+
+You should now see your new provider listed on the left column labeled 'Providers,' and you should be at the Provider Summary for the new Provider.
+
+#### Add a Provider Account ####
+
+The Provider Account you add in this step will allow Deltacloud to access your Provider's resources using the account credentials.
+
+1. Click 'Provider Accounts' above the summary information area. Since you haven't previously added any accounts, you'll start at the NEW ACCOUNT form.
+
+1. Since we're using EC2, you will need five pieces of security credentials from EC2:
+ * Access Key ID
+ * Secret Access Key
+ * AWS Account ID
+ * EC2 x509 private key
+ * EC2 x509 public key
+
+
+ These can all be obtained via the [EC2 management console](https://aws-portal.amazon.com/gp/aws/developer/account/index.htm...
+
+ If you haven't already done so, you'll need to create a public/private X.509 pair and save them in your filesystem. EC2 naming convention for the private key is 'pk-ABCDEFG.pem', and for the public key, 'cert-HIJKLMN.pem'
+
+1. Enter these 5 credentials and give your Provider Account a name of your choosing (e.g. 'myEC2'). For now, leave the 'Quota Instance' field set to the default value of 'unlimited'.
+
+ (Note that if you test the account settings before clicking 'Add' you'll need to re-select your x.509 cert files.)
+
+#### Create a Template ####
+
+Now that your pool contains a cloud provider, you need to create an image to run an instance in your cloud. Please note that image building is currently supported only on 64-bit versions of Fedora 13, the platform we use for development and testing.
+
+1. In the 'Define' section, click 'Deployables'. Then in the left hand navigation bar, under CREATE NEW, click 'Template'.
+
+1. Give your template a name, and select 'Fedora 13 (64-bit)' for Platform Choice. Support for building RHEL images is forthcoming but not yet available.
+
+1. You'll see that you have the option to 'Add Software' packages from available repos, but refrain from adding any for your first image build. The default image for development contains a base set of packages that will allow you to do basic things like ssh in to your instance, etc. Once you're sure that your end-to-end setup is functional, you can experiment with adding packages to image builds.
+
+ Please also note the caveat that when using EC2 there is a 9.9GB image size limit, and exceeding it may lead to failed builds or instance starts. Aggregator does not precalculate image sizes.
+
+1. After saving your template, you should see it listed in all three sections of the Deployables screen: Templates, Assemblies and Deployables. For the moment, only Templates are functional. Select your new Template's radio button and click 'Build.'
+
+#### Build an Image ####
+
+1. On the following Build Request screen, be sure 'Amazon EC2' is checked as the Provider Format, and click 'Submit to Build'. You should now see the Builds screen with your new template in the 'RUNNING' table with 'queued' status. Refresh this page periodically to check the progress of your build request.
+
+ If your build fails, you will see a new table listing failed builds. If the build succeeds, you will see it in a Completed table, with status of 'OK'.
+
+ Once your build has completed, you can use it to start an image. In the 'RUN' section, click 'Instance Management' and then the 'Launch Instance' button. Click the 'Launch' button under your new template's description.
+
+This brings you to the Launch Instance screen, where you should give your instance an identifying Name, select a hardware profile from the Hardware Profile dropdown, optionally choose a desired Realm, and then click 'Launch'. Typical instance start times are under five minutes, but your mileage may vary.
+
+Waiting for your new instance to start is an excellent time to confirm that your default security groups setting on EC2 allows connections via SSH on port 22. Consult EC2 documentation if you haven't already configured your default security group settings. This can be configured before, during, or after your instance's startup and takes effect immediately.
+
+#### Connect to Your New Instance ####
+
+Once you can see that your instance is in state 'running', you should download its ssh private key and try connecting to it.
+
+1. In the 'RUN' section, click 'Instance Management', select the radio button of your running instance, and click 'Instance Details'.
+
+1. Click the link to download your instance's ssh key and save it to your filesystem.
+
+1. 'chmod 600' the file you downloaded
+
+1. Now you should be able to connect with:
+
+ $ ssh -i the-key-you-downloaded.pem root(a)ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com
+
+ (substituting your actual key filename and FQHN)
--
1.7.2.3
13 years, 7 months