Skip to content

Commit

Permalink
Adding argument to select infra nodes flavor
Browse files Browse the repository at this point in the history
  • Loading branch information
morenod authored and Russell Zaleski committed Mar 5, 2021
1 parent 1cb8b36 commit 9bae288
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions rosa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ without uploading any information**
| --rosa-env | Rosa environment where to install clusters. | -- |
| --rosa-multi-az | Install ROSA clusters with multi-az support, deploying on multiple datacenters | False |
| --rosa-addons | Comma separated list of addons to be added after cluster installation | -- |
| --rosa-flavour | AWS Flavour to be use on the infra nodes | -- |
| --aws-profile | AWS profile to use if there is more than one on AWS cli configuration file | -- |
| --cluster-count | Total number of clusters to create. | 1 |
| --batch-size | Number of clusters to create in a batch. If not set it will try and create them all at once. <br>**NOTE**: If not used in conjunction with --delay-between-batch the cluster creation will block at the set batch size until one completes then continue. I.e. if 3 clusters are requested with a batch size of 2. The first two will be requested and then it will block until one of those completes to request the third. | -- |
Expand Down
13 changes: 9 additions & 4 deletions rosa/rosa-wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _install_addons(rosa_cmnd,cluster_id,addons):
logging.error(addon_stderr.strip().decode("utf-8"))
# TODO: control addon is installed with: rosa list addons -c <<cluster_name>>

def _build_cluster(rosa_cmnd,cluster_name_seed,expiration,rosa_azs,my_path,es,index,my_uuid,my_inc,timestamp,index_retry,addons,es_ignored_metadata):
def _build_cluster(rosa_cmnd,cluster_name_seed,expiration,rosa_azs,my_path,es,index,my_uuid,my_inc,timestamp,index_retry,addons,es_ignored_metadata,rosa_flavour):
cluster_start_time = time.strftime("%Y-%m-%dT%H:%M:%S")
success = True
metadata = {}
Expand All @@ -121,6 +121,8 @@ def _build_cluster(rosa_cmnd,cluster_name_seed,expiration,rosa_azs,my_path,es,in
cluster_cmd = [rosa_cmnd, "create","cluster", "--cluster-name", cluster_name, "-y", "--watch"]
if rosa_azs:
cluster_cmd.append('--multi-az')
if rosa_flavour:
cluster_cmd.append('--flavour=' + rosa_flavour)
logging.debug(cluster_cmd)
installation_log = open(cluster_path + "/" + 'installation.log', 'w')
process = subprocess.Popen(cluster_cmd, stdout=installation_log, stderr=installation_log)
Expand Down Expand Up @@ -261,8 +263,11 @@ def main():
parser.add_argument(
'--rosa-addons',
type=str,
help='Comma separated list of addons to add to each cluster after installation is completed'
)
help='Comma separated list of addons to add to each cluster after installation is completed')
parser.add_argument(
'--rosa-flavour',
type=str,
help='AWS Flavor to use for infra nodes')
parser.add_argument(
'--aws-profile',
type=str,
Expand Down Expand Up @@ -423,7 +428,7 @@ def main():
logging.debug('Starting Cluster thread %d' % (loop_counter + 1))
try:
timestamp = time.strftime("%Y-%m-%dT%H:%M:%S")
thread = threading.Thread(target=_build_cluster,args=(rosa_cmnd,cluster_name_seed,args.expire,args.rosa_azs,my_path,es,args.es_index,my_uuid,loop_counter,timestamp,args.es_index_retry,args.rosa_addons,_es_ignored_metadata))
thread = threading.Thread(target=_build_cluster,args=(rosa_cmnd,cluster_name_seed,args.expire,args.rosa_azs,my_path,es,args.es_index,my_uuid,loop_counter,timestamp,args.es_index_retry,args.rosa_addons,_es_ignored_metadata,args.rosa_flavour))
except Exception as err:
logging.error(err)
cluster_thread_list.append(thread)
Expand Down

0 comments on commit 9bae288

Please sign in to comment.