Skip to content

Commit

Permalink
Add utilities to generate pipeline.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
travelist committed May 31, 2015
1 parent 0422901 commit dea77c0
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions surge/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__author__ = 'kshimamu'
63 changes: 63 additions & 0 deletions surge/surge_deployer/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import os
import shutil
import yaml

BASE_DIR = os.path.dirname(os.path.realpath(__file__))


def generate_pipeline(number_nimbus=0, number_supervisor=0,
number_kafka=0, number_zk=0):

pipeline = {
'provider': {
'type': {
'virtualbox': {
'hostname_prefix': "",
'ip_start': '10.20.30.10'
}
},
},
'hosts': {
"zookeeper": {
"count": number_zk,
"provider": {
'virtualbox': {
'memory': 1024
}
}
},
"kafka": {
"count": number_kafka,
"provider": {
'virtualbox': {
'memory': 2048
}
}

},
"storm-nimbus": {
"count": number_nimbus,
"provider": {
'virtualbox': {
'memory': 1024,
'forwarded_ports': {
'guest': 8080,
'host': 28080
}
}
}
},
"storm-supervisor": {
"count": number_supervisor,
"provider": {
'virtualbox': {
'memory': 1024
}
}
}
}
}

with open(BASE_DIR + "/basevb/pipeline.yml", 'w') as pipeline_file:
pipeline_file.write(yaml.dump(pipeline, default_flow_style=False))
pipeline_file.close()

0 comments on commit dea77c0

Please sign in to comment.