EC2Cluster.to_json
Creates JSON representation of this cluster that can be used to connect to the cluster again.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output |
str
|
Path to output file. Defaults to "cluster.json". |
'cluster.json'
|
Return
None
Examples:
>>> from pyquokka.utils import *
>>> manager = QuokkaClusterManager(key_name = "my_key", key_location = "/home/ubuntu/.ssh/my_key.pem", security_group = "my_security_group")
>>> cluster = manager.create_cluster(aws_access_key, aws_access_id, num_instances = 2, instance_type = "i3.2xlarge", ami="ami-0530ca8899fac469f", requirements = ["numpy", "pandas"])
>>> cluster.to_json("my_cluster.json")
You can now close this Python session. In a new Python session you can connect to this cluster by doing:
>>> from pyquokka.utils import *
>>> manager = QuokkaClusterManager(key_name = "my_key", key_location = "/home/ubuntu/.ssh/my_key.pem", security_group = "my_security_group")
>>> cluster = manager.from_json("my_cluster.json")
Source code in pyquokka/utils.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|