def deploy_cloud(self): dep = Deployment(self.dea, YAML_CONF_DIR, self.env_id, self.node_roles_dict, self.no_health_check, self.deploy_timeout) if not self.no_deploy_environment: dep.deploy() else: log('Configuration is done. Deployment is not launched.')
def main(argv): file = argv[1]; graph = Graph(); # read input file of teacher and student relation and create graph network with open(file) as f: for line in f: line = line.strip().split(',') user1 = User(line[0]) user2 = User(line[1]) graph.addConnection(user1, user2, True) version = '2.0' newversion = Deployment(graph, version) print "----Initial state:----" printAllUsers(graph) # Ask admin to select the node to start the deployment process node = raw_input('Select node to deploy: ') user = graph.getUser(node) threshold = None strict = None isthreshold = raw_input('Do you want to limit the infection[y/n]: ') if isthreshold == 'y': threshold = int(raw_input('Enter the limit: ')) isstrict = raw_input('Is this limit strict[y/n]: ') if isstrict == 'y': strict = 'strict' newversion.deploy(user, threshold, strict) print "------Final State-------" printAllUsers(graph) plotGraph(graph)
def deploy_cloud(self): dep = Deployment(self.dea, YAML_CONF_DIR, self.env_id, self.node_roles_dict, self.no_health_check) dep.deploy()
parser.add_argument('--end', '-e', type=int, default=16, help='end step') parser.add_argument('--clean', '-c', action='store_true', help='cleanup instances') args = parser.parse_args() def validate_deployment_id(deployment_id): # Since hydra depends on dashes and gce api doesn't allow other non-aphanumeric characters # in instance names, don't allow them in deployment_ids if re.match(r"^[a-z0-9]+$", deployment_id): return deployment_id else: exception_msg = "--deployment_id | -i <%s> cannot contain non-alphanumeric characters" % (deployment_id) raise ValueError(exception_msg) if __name__ == "__main__": deployment_id = validate_deployment_id(args.deployment_id) config_file = args.config_file config = Config(deployment_id) config.parse_config_file(config_file) # Will populate config section list of config. dep = Deployment(config) if args.clean: print("==> Removing deployment nodes for deployment-id: %s" % deployment_id) dep.cleanup() else: for step in range(args.start, args.end + 1): print ("======================= STEP %d =======================" % step) dep.deploy(step)
def validate_deployment_id(deployment_id): # Since hydra depends on dashes and gce api doesn't allow other non-aphanumeric characters # in instance names, don't allow them in deployment_ids if re.match(r"^[A-Za-z0-9]+$", deployment_id): return deployment_id else: exception_msg = "--deployment_id | -i <%s> cannot contain non-alphanumeric characters" % ( deployment_id) raise ValueError(exception_msg) if __name__ == "__main__": deployment_id = validate_deployment_id(args.deployment_id) config_file = args.config_file config = Config(deployment_id) config.parse_config_file( config_file) # Will populate config section list of config. dep = Deployment(config) if args.clean: print("==> Removing deployment nodes for deployment-id: %s" % deployment_id) dep.cleanup() else: for step in range(args.start, args.end + 1): print("======================= STEP %d =======================" % step) dep.deploy(step)
def deploy_cloud(self): dep = Deployment(self.dea, YAML_CONF_DIR, self.env_id, self.node_id_roles_dict) dep.deploy()