You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by lu...@redhat.com on 2012/12/03 08:54:06 UTC
A few CIMI fixes
These patches address a few things I ran across running the CIMI
tests. Patch 2/3 makes cep_test avoid accessing the
forwarding_group_templates collection, since that makes the server eat up
all available memory (very unpleasant) - I am not sure what the actual
issue is, but it seems to happen before we get into the control block of
the CIMI collection; i.e., I am looking angrily at our middleware and/or
rabbit ;)
David
[PATCH 2/3] CIMI tests (cep_test): do not accss forwarding_group_templates collection
Posted by lu...@redhat.com.
From: David Lutterkort <lu...@redhat.com>
This sends the server into an infnite loop
---
tests/cimi/cep_test.rb | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/tests/cimi/cep_test.rb b/tests/cimi/cep_test.rb
index f764ea2..3c8149d 100644
--- a/tests/cimi/cep_test.rb
+++ b/tests/cimi/cep_test.rb
@@ -27,7 +27,9 @@ class CloundEntryPointBehavior < CIMI::Test::Spec
"networks", "networkTemplates", "networkConfigs", "networkPorts",
"networkPortTemplates", "networkPortConfigs",
"addresses", "addressTemplates", "forwardingGroups",
- "forwardingGroupTemplates",
+# FIXME: accessing this collection causes the thin process to take
+# all available memory
+# "forwardingGroupTemplates",
"jobs", "meters", "meterTemplates", "meterConfigs",
"eventLogs", "eventLogTemplates" ]
--
1.7.7.6
[PATCH 3/3] Server: make sure we initialize the DB dir and the mock driver's data properly
Posted by lu...@redhat.com.
From: David Lutterkort <lu...@redhat.com>
Server startup failed if /var/tmp/deltacloud-mock-$USER failed because the
DB initialization code did not create that directory. Creating that
directory fooled the logic in the mock driver that determined if the stock
data needed to be copied there.
---
server/lib/db.rb | 4 ++++
server/lib/deltacloud/drivers/mock/mock_client.rb | 4 +---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/server/lib/db.rb b/server/lib/db.rb
index ac6d913..e6fe761 100644
--- a/server/lib/db.rb
+++ b/server/lib/db.rb
@@ -21,6 +21,10 @@ module Deltacloud
def self.initialize_database
DataMapper::Logger.new($stdout, :debug)
+ dbdir = File::dirname(DATABASE_LOCATION)
+ unless File::directory?(dbdir)
+ FileUtils::mkdir(dbdir)
+ end
DataMapper::setup(:default, "sqlite://#{DATABASE_LOCATION}")
DataMapper::finalize
DataMapper::auto_upgrade!
diff --git a/server/lib/deltacloud/drivers/mock/mock_client.rb b/server/lib/deltacloud/drivers/mock/mock_client.rb
index c6dd464..919ee27 100644
--- a/server/lib/deltacloud/drivers/mock/mock_client.rb
+++ b/server/lib/deltacloud/drivers/mock/mock_client.rb
@@ -26,9 +26,7 @@ module Deltacloud::Drivers::Mock
@storage_root = storage_root
@collections = []
- if ! File::directory?(@storage_root)
- FileUtils::rm_rf(@storage_root)
- FileUtils::mkdir_p(@storage_root, :mode => 0750)
+ if ! File::directory?(File::join(@storage_root, "images"))
data = Dir[File::join(File::dirname(__FILE__), "data", "*")]
FileUtils::cp_r(data, @storage_root)
end
--
1.7.7.6
Re: A few CIMI fixes
Posted by David Lutterkort <lu...@redhat.com>.
On Mon, 2012-12-03 at 15:49 +0100, Michal Fojtik wrote:
> On 12/03, marios@redhat.com wrote:
> > ACK & pushed:
> >
> > On 03/12/12 09:54, lutter@redhat.com wrote:
> > > These patches address a few things I ran across running the CIMI
> > > tests. Patch 2/3 makes cep_test avoid accessing the
> > > forwarding_group_templates collection, since that makes the server eat up
> > > all available memory (very unpleasant) - I am not sure what the actual
> > > issue is, but it seems to happen before we get into the control block of
> > > the CIMI collection; i.e., I am looking angrily at our middleware and/or
> > > rabbit ;)
> >
> > Michal is chasing this - it seems to be very specific to F16 1.8.7 ruby
>
> As marios wrote, this issues seems to be *very* F16 ruby (1.8.7-p371)
> specific. I'm not able to reproduce it on F18 (rbenv 1.8.7) or OSX (same).
>
> Exceptions seems to be random:
>
> This is the same request (I just hit Ctrl+R in browser):
>
> stack level too deep
> /usr/lib/ruby/gems/1.8/gems/dm-core-1.2.0/lib/dm-core/model.rb:696:in
> `repository_name'
>
> stack level too deep
> /home/mfojtik/deltacloud/server/lib/deltacloud_rack.rb:55:in
> `default_frontend'
> /home/mfojtik/deltacloud/server/lib/deltacloud/helpers/driver_helper.rb:32:in
> `driver_name
>
> stack level too deep
> /home/mfojtik/deltacloud/server/lib/deltacloud/helpers/driver_helper.rb:32:in
> `driver_name'
> /home/mfojtik/deltacloud/server/lib/deltacloud/helpers/driver_helper.rb:28:in
> `driver_symbol'
>
> There are couple more, I really dunno how to track this issue. I tried to
> disable everything that touch DataMapper but still the same problem.
>
> I tried to use Tracer (it usually reveals infinite loops/recursions), but
> no luck either :/
>
> So I desperately installed rbenv on that F16 box and then I installed
> ruby 1.8.7 (CONFIGURE_OPTS="--without-dl" - this is broken on new glibc).
> The I installed bundler and bootstraped deltacloud.... When I switched
> to this version **everything** works!
One thing I just realized from trying around is that accessing
http://localhost:3001/cimi/cloudEntryPoint/ (note the trailing slash)
sends my server into this infinite loop. Maybe that'll help debugging
it.
David
Re: A few CIMI fixes
Posted by Michal Fojtik <mf...@redhat.com>.
On 12/03, marios@redhat.com wrote:
> ACK & pushed:
>
> On 03/12/12 09:54, lutter@redhat.com wrote:
> > These patches address a few things I ran across running the CIMI
> > tests. Patch 2/3 makes cep_test avoid accessing the
> > forwarding_group_templates collection, since that makes the server eat up
> > all available memory (very unpleasant) - I am not sure what the actual
> > issue is, but it seems to happen before we get into the control block of
> > the CIMI collection; i.e., I am looking angrily at our middleware and/or
> > rabbit ;)
>
> Michal is chasing this - it seems to be very specific to F16 1.8.7 ruby
As marios wrote, this issues seems to be *very* F16 ruby (1.8.7-p371)
specific. I'm not able to reproduce it on F18 (rbenv 1.8.7) or OSX (same).
Exceptions seems to be random:
This is the same request (I just hit Ctrl+R in browser):
stack level too deep
/usr/lib/ruby/gems/1.8/gems/dm-core-1.2.0/lib/dm-core/model.rb:696:in
`repository_name'
stack level too deep
/home/mfojtik/deltacloud/server/lib/deltacloud_rack.rb:55:in
`default_frontend'
/home/mfojtik/deltacloud/server/lib/deltacloud/helpers/driver_helper.rb:32:in
`driver_name
stack level too deep
/home/mfojtik/deltacloud/server/lib/deltacloud/helpers/driver_helper.rb:32:in
`driver_name'
/home/mfojtik/deltacloud/server/lib/deltacloud/helpers/driver_helper.rb:28:in
`driver_symbol'
There are couple more, I really dunno how to track this issue. I tried to
disable everything that touch DataMapper but still the same problem.
I tried to use Tracer (it usually reveals infinite loops/recursions), but
no luck either :/
So I desperately installed rbenv on that F16 box and then I installed
ruby 1.8.7 (CONFIGURE_OPTS="--without-dl" - this is broken on new glibc).
The I installed bundler and bootstraped deltacloud.... When I switched
to this version **everything** works!
-- Michal
>
> marios
>
> >
> > David
> >
>
--
Michal Fojtik <mf...@redhat.com>
Deltacloud API, CloudForms
Re: A few CIMI fixes
Posted by "marios@redhat.com" <ma...@redhat.com>.
ACK & pushed:
On 03/12/12 09:54, lutter@redhat.com wrote:
> These patches address a few things I ran across running the CIMI
> tests. Patch 2/3 makes cep_test avoid accessing the
> forwarding_group_templates collection, since that makes the server eat up
> all available memory (very unpleasant) - I am not sure what the actual
> issue is, but it seems to happen before we get into the control block of
> the CIMI collection; i.e., I am looking angrily at our middleware and/or
> rabbit ;)
Michal is chasing this - it seems to be very specific to F16 1.8.7 ruby
marios
>
> David
>
[PATCH 1/3] CIMI: make CIMI::Model::VolumeImage.find behavie like Machine.find
Posted by lu...@redhat.com.
From: David Lutterkort <lu...@redhat.com>
---
server/lib/cimi/models/volume_image.rb | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/server/lib/cimi/models/volume_image.rb b/server/lib/cimi/models/volume_image.rb
index 5052ff5..811d9c9 100644
--- a/server/lib/cimi/models/volume_image.rb
+++ b/server/lib/cimi/models/volume_image.rb
@@ -25,12 +25,15 @@ class CIMI::Model::VolumeImage < CIMI::Model::Base
end
def self.find(id, context)
- storage_snapshots = []
- opts = ( id==:all ) ? {} : { :id=>id }
- storage_snapshots = context.driver.storage_snapshots(context.credentials, opts)
- storage_snapshots.collect!{ |snapshot| from_storage_snapshot(snapshot, context) }
- return storage_snapshots.first unless storage_snapshots.length > 1
- return storage_snapshots
+ creds = context.credentials
+ if id == :all
+ snapshots = context.driver.storage_snapshots(creds)
+ snapshots.collect{ |snapshot| from_storage_snapshot(snapshot, context) }
+ else
+ snapshot = context.driver.storage_snapshots(creds)
+ raise CIMI::Model::NotFound unless snapshot
+ from_storage_snapshot(snapshot)
+ end
end
def self.all(context); find(:all, context); end
--
1.7.7.6