Skip to content

Commit

Permalink
atmosphere - cornell workshop version
Browse files Browse the repository at this point in the history
  • Loading branch information
Seungjin Kim committed May 29, 2011
1 parent c6e25dd commit 6a6b6fc
Show file tree
Hide file tree
Showing 4,241 changed files with 231 additions and 411,438 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
24 changes: 18 additions & 6 deletions README
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
Copyright (c) 2011, The Arizona Board of Regents on behalf of The University of Arizona

Atmosphere:
http://www.iplantcollaborative.org
https://atmo.iplantcollaborative.org
All rights reserved.

Author:
Seung-jin Kim <http://:github.com/seungjin, twitter:@seungjin>
Developed by: iPlant Collaborative as a collaboration between participants at BIO5 at The University of Arizona (the primary hosting institution), Cold Spring Harbor Laboratory, The University of Texas at Austin, and individual contributors. Find out more at http://www.iplantcollaborative.org/.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the iPlant Collaborative, BIO5, The University of Arizona, Cold Spring Harbor Laboratory, The University of Texas at Austin, nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


"atmosphere" project"
Branch "preview-one"
test1

Contact: Seung-jin Kim <seungjin@email.arizona.edu>
6 changes: 4 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
# Twitter: @seungjin
#
#
7 changes: 6 additions & 1 deletion atmosphere.wsgi
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand Down Expand Up @@ -27,3 +29,6 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'atmosphere.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()


os.environ['PYTHON_EGG_CACHE'] = '/home/atmosphere_dev/atmosphere'
6 changes: 6 additions & 0 deletions cloudauth/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ def auth_response(request):
#login validation
#return HttpResponse("hello",mimetype="text/plain" )
response = HttpResponse()

response['Access-Control-Allow-Origin'] = '*'
response['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'
response['Access-Control-Max-Age'] = 1000
response['Access-Control-Allow-Headers'] = '*'

#response.write("heelo it is me")
response['X-Server-Management-Url'] = api_server_url.value
response['X-Storage-Url'] = "http://"
Expand Down
2 changes: 1 addition & 1 deletion cloudauth/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
#
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
# Twitter: @seungjin
Expand Down
8 changes: 5 additions & 3 deletions cloudfront/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
#
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
# Twitter: @seungjin
#
#
7 changes: 5 additions & 2 deletions cloudfront/first_time_login.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env python

#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand All @@ -24,4 +27,4 @@ def make_new_ec2_acct(sekf):

def update_ec2_key_table():
pass


6 changes: 4 additions & 2 deletions cloudfront/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand Down Expand Up @@ -41,4 +43,4 @@ def clean_username(self):
return username
raise forms.ValidationError('Username is already taken.')



7 changes: 5 additions & 2 deletions cloudfront/login.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env python

#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand Down Expand Up @@ -89,4 +92,4 @@ def ldap_auth(username,password) :
else :
return True
except :
return False
return False
4 changes: 3 additions & 1 deletion cloudfront/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand Down
5 changes: 4 additions & 1 deletion cloudfront/resource.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env python

#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand Down
4 changes: 3 additions & 1 deletion cloudfront/token.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand Down
9 changes: 6 additions & 3 deletions cloudfront/user.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env python
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.

#
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand Down Expand Up @@ -61,4 +64,4 @@ def set_is_in_atmo_ldap_group(self,username):

def set_has_ec2_key(self,username):
return True if len(Ec2_keys.objects.filter(username=username)) > 0 else False


4 changes: 3 additions & 1 deletion cloudfront/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand Down
2 changes: 1 addition & 1 deletion cloudservice/alter.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- The contents of this file are subject to the terms listed in the LICENSE file you received with this code.

--
-- 2/7/2011
alter table cloudservice_api_logs add request_remote_user_agent varchar(128)
Expand Down
9 changes: 6 additions & 3 deletions cloudservice/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/env python
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.

#
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
# Twitter: @seungjin
#
#
7 changes: 5 additions & 2 deletions cloudservice/api/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/env python

#
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
# Twitter: @seungjin
Expand Down
6 changes: 0 additions & 6 deletions cloudservice/api/v1/atmo-init.20110111.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#!/usr/bin/ruby
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
#
#
#
#

require 'net/http'
require 'net/https'
require 'openssl'
Expand Down
5 changes: 0 additions & 5 deletions cloudservice/api/v1/atmo-init.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/usr/bin/ruby
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
#
#
#
require 'net/http'
require 'net/https'
require 'openssl'
Expand Down
37 changes: 29 additions & 8 deletions cloudservice/api/v1/cloud.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand Down Expand Up @@ -804,9 +803,8 @@ def getAttachedVolumeList(self,req) :
def createVolume(self,req):
#euca-create-volume -S, --size size | --snapshot snapshot_id -z zone
# for current system. zone is fixed. zone=iplant

size = None
zone = "iplant01"
zone = "bespin"
snaphost_id = None
name = None
description = None
Expand Down Expand Up @@ -839,7 +837,7 @@ def createVolume(self,req):
volume_id = str(volume).split(":")[1]
except Exception, ex:
print ex

machine_volume = Machine_volumes(
volume_name = name,
volume_description = description,
Expand All @@ -851,7 +849,8 @@ def createVolume(self,req):
volume_create_time = datetime.datetime.now()
)
machine_volume.save()
return atmo_util.jsoner("\"success\"","\"\"","[%s]" % volume_id)

return atmo_util.jsoner("\"success\"","null","[\"%s\"]" % volume_id)

def deleteVolume(self, req):
volume_id = None
Expand All @@ -868,7 +867,7 @@ def deleteVolume(self, req):
return_code = euca_conn.delete_volume(volume_id)
except Exception, ex:
print ex
return atmo_util.jsoner("\"success\"","\"\"","")
return atmo_util.jsoner("\"success\"","\"\"","\"\"")

def getAppList(self, req):

Expand Down Expand Up @@ -984,8 +983,13 @@ def launchApp(self, req):
#user_data_file = open(os.path.abspath(os.path.dirname(__file__))+'/../../api/v1/atmo-init.rb', 'r')
#user_data = user_data_file.read()
#user_data_file.close()

user_data = Machine_image_userdata_scripts.objects.get(script_id=(Applications.objects.get(application_id = req.POST['application_id']).machine_image_user_data_scripts_script_id)).script

if req.POST['application_id'][:2] == "u_" :
user_app_id = req.POST['application_id'][2:]
user_data = Machine_image_userdata_scripts.objects.get(script_id=(User_applications.objects.get(application_id = user_app_id)).machine_image_user_data_scripts_script_id).script
else :
user_data = Machine_image_userdata_scripts.objects.get(script_id=(Applications.objects.get(application_id = req.POST['application_id']).machine_image_user_data_scripts_script_id)).script

logging.debug(user_data)

instance_token = str(uuid.uuid4())
Expand Down Expand Up @@ -1103,3 +1107,20 @@ def convertMachineTypeStringToNum(self,machine_type):

def getMethodsList(self):
return atmo_util.jsoner("\"fail\"","\"not yet implemented\"","\"\"")

def createInstanceAsImage(self):
import sys
#from euca2ools import Euca2ool, Util, InstanceValidationError ConnectionFailed
import base64
from datetime import datetime, timedelta


#key:
"""
try:
bundle_task = euca_conn.bundle_instance(instance_id = instance_id, s3_bucket=bucket, s3_prefix=prefix, s3_upload_policy=policy)
except Exception, ex:
euca.display_error_and_exit('%s' % ex)
"""
pass
7 changes: 5 additions & 2 deletions cloudservice/api/v1/cloudadmin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env python

#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand Down Expand Up @@ -85,4 +88,4 @@ def avgInstanceLaunchTime(self):





9 changes: 1 addition & 8 deletions cloudservice/api/v1/cloudservice.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
# Twitter: @seungjin
#


from atmosphere.cloudservice.api.v1.cloud import Ec2_cloud
Expand All @@ -23,4 +16,4 @@ def jsoner(self,code,meta,value):
"value" : %s
}
}""" % (code,meta,value)
return final_json
return final_json
5 changes: 4 additions & 1 deletion cloudservice/api/v1/image.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env python

#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: seungjin@email.arizona.edu
Expand Down
Loading

0 comments on commit 6a6b6fc

Please sign in to comment.