[hg] galaxy 3062: Cloud tab is now enabled/disabled through conf...
details: http://www.bx.psu.edu/hg/galaxy/rev/52318cf73454 changeset: 3062:52318cf73454 user: Enis Afgan <afgane@gmail.com> date: Mon Sep 14 15:08:23 2009 -0400 description: Cloud tab is now enabled/disabled through configuration option in universe_wsgi.ini file diffstat: lib/galaxy/config.py | 2 ++ lib/galaxy/web/controllers/cloud.py | 6 +++++- templates/base_panels.mako | 18 ++++++++++-------- templates/root/index.mako | 34 ++++++++++++++++++++-------------- 4 files changed, 37 insertions(+), 23 deletions(-) diffs (121 lines): diff -r 2d1b957b8448 -r 52318cf73454 lib/galaxy/config.py --- a/lib/galaxy/config.py Fri Sep 11 15:25:21 2009 -0400 +++ b/lib/galaxy/config.py Mon Sep 14 15:08:23 2009 -0400 @@ -103,6 +103,8 @@ except ConfigParser.NoSectionError: self.tool_runners = [] self.datatypes_config = kwargs.get( 'datatypes_config_file', 'datatypes_conf.xml' ) + # Cloud configuration options + self.cloud_controller_instance = string_as_bool( kwargs.get( 'cloud_controller_instance', 'False' ) ) def get( self, key, default ): return self.config_dict.get( key, default ) def get_bool( self, key, default ): diff -r 2d1b957b8448 -r 52318cf73454 lib/galaxy/web/controllers/cloud.py --- a/lib/galaxy/web/controllers/cloud.py Fri Sep 11 15:25:21 2009 -0400 +++ b/lib/galaxy/web/controllers/cloud.py Mon Sep 14 15:08:23 2009 -0400 @@ -20,6 +20,7 @@ import galaxy.eggs galaxy.eggs.require("boto") from boto.ec2.connection import EC2Connection +from boto.ec2.regioninfo import RegionInfo import logging log = logging.getLogger( __name__ ) @@ -937,7 +938,10 @@ if creds: a_key = creds.access_key s_key = creds.secret_key - conn = EC2Connection( a_key, s_key ) + #conn = EC2Connection( a_key, s_key ) + euca_region = RegionInfo(None, "eucalyptus", "mayhem9.cs.ucsb.edu") + #conn = EC2Connection(aws_access_key_id="2s42fQmcCu4WBpS3RJ9e5g", aws_secret_access_key="2iEzpThjZQttuvWYXL-0nRUuurzl2dump2drwg", is_secure=False, port=8773, region=euca_region, path="/services/Eucalyptus") + conn = EC2Connection(aws_access_key_id=a_key, aws_secret_access_key=s_key, is_secure=False, port=8773, region=euca_region, path="/services/Eucalyptus") return conn else: error( "You must specify default credentials before starting an instance." ) diff -r 2d1b957b8448 -r 52318cf73454 templates/base_panels.mako --- a/templates/base_panels.mako Fri Sep 11 15:25:21 2009 -0400 +++ b/templates/base_panels.mako Mon Sep 14 15:08:23 2009 -0400 @@ -16,7 +16,7 @@ </%def> ## Default title -<%def name="title()">Galaxy Cloud</%def> +<%def name="title()">Galaxy</%def> ## Default stylesheets <%def name="stylesheets()"> @@ -135,13 +135,15 @@ <td class="${cls}" style="${style}"><a target="${target}" href="${href}">${display}</a></td> </%def> - ##${tab( "analysis", "Analyze Data", h.url_for( controller='root', action='index' ))} - - ##${tab( "workflow", "Workflow", h.url_for( controller='workflow', action='index' ))} - - ##${tab( "libraries", "Data Libraries", h.url_for( controller='library', action='index' ))} - - ${tab( "cloud", "Cloud", h.url_for( controller='cloud', action='index' ))} + %if app.config.cloud_controller_instance: + ${tab( "cloud", "Cloud", h.url_for( controller='cloud', action='index' ))} + %else: + ${tab( "analysis", "Analyze Data", h.url_for( controller='root', action='index' ))} + + ${tab( "workflow", "Workflow", h.url_for( controller='workflow', action='index' ))} + + ${tab( "libraries", "Data Libraries", h.url_for( controller='library', action='index' ))} + %endif %if trans.request_types(): <td class="tab"> diff -r 2d1b957b8448 -r 52318cf73454 templates/root/index.mako --- a/templates/root/index.mako Fri Sep 11 15:25:21 2009 -0400 +++ b/templates/root/index.mako Mon Sep 14 15:08:23 2009 -0400 @@ -2,9 +2,14 @@ <%def name="init()"> <% - self.has_left_panel=False - self.has_right_panel=False - self.active_view="cloud" +if trans.app.config.cloud_controller_instance: + self.has_left_panel=False + self.has_right_panel=False + self.active_view="cloud" +else: + self.has_left_panel=True + self.has_right_panel=True + self.active_view="analysis" %> %if trans.app.config.require_login and not trans.user: <script type="text/javascript"> @@ -28,17 +33,18 @@ ## If a specific tool id was specified, load it in the middle frame <% - if trans.app.config.require_login and not trans.user: - center_url = h.url_for( controller='user', action='login' ) - elif tool_id is not None: - center_url = h.url_for( 'tool_runner', tool_id=tool_id, from_noframe=True ) - elif workflow_id is not None: - center_url = h.url_for( controller='workflow', action='run', id=workflow_id ) - elif m_c is not None: - center_url = h.url_for( controller=m_c, action=m_a ) - else: - #center_url = h.url_for( '/static/welcome.html' ) - center_url = h.url_for( controller='cloud', action='list' ) +if trans.app.config.require_login and not trans.user: + center_url = h.url_for( controller='user', action='login' ) +elif tool_id is not None: + center_url = h.url_for( 'tool_runner', tool_id=tool_id, from_noframe=True ) +elif workflow_id is not None: + center_url = h.url_for( controller='workflow', action='run', id=workflow_id ) +elif m_c is not None: + center_url = h.url_for( controller=m_c, action=m_a ) +elif trans.app.config.cloud_controller_instance: + center_url = h.url_for( controller='cloud', action='list' ) +else: + center_url = h.url_for( '/static/welcome.html' ) %> <iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${center_url}"> </iframe>
participants (1)
-
Greg Von Kuster