Skip to content

Commit

Permalink
update on changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lee212 committed Sep 28, 2016
1 parent 13aa3ec commit 4b1f36d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
Simple Azure
============
===============================================================================

Simple Azure supports cloud computing management in the Python Programming Language. It plans to support WIndows Azure, OpenStack, etc.
[Documentation](https://simple-azure.readthedocs.org/)

Prerequisite
-------------------------------------------------------------------------------

- Azure Cli installation

```
sudo apt-get install nodejs-legacy
sudo apt-get install npm
sudo npm install -g azure-cli
```

Example
--------
-------------------------------------------------------------------------------
Create a VM on Windows Azure
(ubuntu 12.04 is a default image)
(ubuntu 14.04 is a default image)

```
from simpleazure.simpleazure import SimpleAzure as saz
Expand Down Expand Up @@ -47,7 +58,7 @@ print vars(azure.get_deployment())
```

Example for multiple deployment
-------------------------------
-------------------------------------------------------------------------------
cluster() function helps to deploy several VMs at once.

```
Expand All @@ -68,7 +79,7 @@ my-cluster-vm-3-46927
```

Example for multiple deployment with Azure Data Science Core
-------------------------------------------------------------
-------------------------------------------------------------------------------
Deploy 5 VMs with Azure Data Science Core at West Europe

```
Expand All @@ -81,13 +92,16 @@ azure.create_cluster(num=5)
```

Clustering
-----------
-------------------------------------------------------------------------------

TBD

Description
-----------
-------------------------------------------------------------------------------
* This development is planned to support ipython clustering modules/plugines like the StarCluster project (which is supporting Amazon EC2).
* This development is planned to support command-line tools to launch / execute .ipynb files in parallel.

Contact
--------
-------------------------------------------------------------------------------

hroe.lee at gmail.com
2 changes: 1 addition & 1 deletion simpleazure/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
CLUSTER_DIR = '/cluster'
AZURE_CLOUD_DOMAIN = 'cloudapp.net'

DEFAULT_IMAGE_LABEL = "Ubuntu Server 12.04.2 LTS"
DEFAULT_IMAGE_LABEL = "Ubuntu Server 14.04 LTS"
DEFAULT_LOCATION = "Central US"
DEFAULT_ROLE_SIZE = "Small" # ExtraSmall|Small|Medium|Large|ExtraLarge

Expand Down
6 changes: 3 additions & 3 deletions simpleazure/ext/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Credentials(object):
Azure credentials needed to run Azure.
'''
def __init__(self):
configFilename = os.environ["HOME"] + "/.azure/config.json"
configFilename = os.environ["HOME"] + "/.azure/azureProfile.json"
tmpName = os.path.join(os.getcwd(), configFilename)

if not os.path.exists(tmpName):
Expand All @@ -27,10 +27,10 @@ def getManagementCertFile(self):
return self.config_path + "/managementCertificate.pem"

def getSubscriptionId(self):
return self.ns[u'subscriptionid']
return self.ns[u'subscriptions'][0][u'id']

def getSubscription(self):
return self.ns[u'subscription']
return self.ns[u'subscriptions']

def getServiceBusKey(self):
return self.ns[u'servicebuskey']
Expand Down
7 changes: 4 additions & 3 deletions simpleazure/simpleazure.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def get_creds(self):
a local system. These information should be set by the azure-cli
tool."""
self.cert = Credentials()
self.subscription_id = self.cert.getSubscription()
self.subscription_id = self.cert.getSubscriptionId()
self.certificate_path = self.cert.getManagementCertFile()

def create_vm(self, name=None, location=None):
Expand All @@ -183,9 +183,9 @@ def create_vm(self, name=None, location=None):
linux_config = LinuxConfigurationSet(self.get_name(), self.linux_user_id,
self.linux_user_passwd, True)

self.set_ssh_keys(linux_config)
#self.set_ssh_keys(linux_config)
self.set_network()
self.set_service_certs()
#self.set_service_certs()
# can't find certificate right away.
sleep(5)

Expand Down Expand Up @@ -332,6 +332,7 @@ def get_registered_image(self, label=None, name=None):
if not label and not name:
return images

lastone = None
for image in images:
if name and image.name == name:
return image
Expand Down

0 comments on commit 4b1f36d

Please sign in to comment.