def do_create(tag, repo_channel_path, channel_commit_path, commit, variant_arguments, all_bootstraps): extra_packages = list() artifacts = list() for arm_t in ["dcos", "acs"]: for num_masters in [1, 3, 5]: for bootstrap_name, gen_arguments in variant_arguments.items(): gen_args = deepcopy(gen_arguments) if arm_t == "acs": gen_args["ui_tracking"] = "false" gen_args["telemetry_enabled"] = "false" dcos_template, artifact = make_template( num_masters, gen_args, arm_t, pkgpanda.util.variant_prefix(bootstrap_name) ) extra_packages += util.cluster_to_extra_packages(dcos_template.results.cluster_packages) artifacts.append(artifact) artifacts.append( { "channel_path": "azure.html", "local_content": gen_buttons(repo_channel_path, channel_commit_path, tag, commit), "content_type": "text/html; charset=utf-8", } ) return {"packages": extra_packages, "artifacts": artifacts}
def _as_artifact_and_pkg(variant_prefix, filename, gen_out): yield _as_cf_artifact("{}{}".format(variant_prefix, filename), gen_out.cloudformation) yield { 'packages': util.cluster_to_extra_packages(gen_out.results.cluster_packages) }
def do_create(tag, repo_channel_path, channel_commit_path, commit, variant_arguments, all_bootstraps): extra_packages = list() artifacts = list() for arm_t in ['dcos', 'acs']: for num_masters in [1, 3, 5]: for bootstrap_name, gen_arguments in variant_arguments.items(): gen_args = deepcopy(gen_arguments) if arm_t == 'acs': gen_args['ui_tracking'] = 'false' gen_args['telemetry_enabled'] = 'false' dcos_template, artifact = make_template(num_masters, gen_args, arm_t, pkgpanda.util.variant_prefix(bootstrap_name)) extra_packages += util.cluster_to_extra_packages(dcos_template.results.cluster_packages) artifacts.append(artifact) artifacts.append({ 'channel_path': 'azure.html', 'local_content': gen_buttons(repo_channel_path, channel_commit_path, tag, commit), 'content_type': 'text/html; charset=utf-8' }) return { 'packages': extra_packages, 'artifacts': artifacts }
def do_create(tag, repo_channel_path, channel_commit_path, commit, variant_arguments, all_bootstraps): extra_packages = list() artifacts = list() for arm_t in ['dcos', 'acs']: for num_masters in [1, 3, 5]: for bootstrap_name, gen_arguments in variant_arguments.items(): gen_args = deepcopy(gen_arguments) if arm_t == 'acs': gen_args['ui_tracking'] = 'false' gen_args['telemetry_enabled'] = 'false' dcos_template, artifact = make_template( num_masters, gen_args, arm_t, pkgpanda.util.variant_prefix(bootstrap_name)) extra_packages += util.cluster_to_extra_packages( dcos_template.results.cluster_packages) artifacts.append(artifact) artifacts.append({ 'channel_path': 'azure.html', 'local_content': gen_buttons(repo_channel_path, channel_commit_path, tag, commit), 'content_type': 'text/html; charset=utf-8' }) return {'packages': extra_packages, 'artifacts': artifacts}
def add_pre_genned(filename, gen_out): nonlocal extra_packages artifacts.append({ 'channel_path': 'cloudformation/{}{}'.format(variant_prefix, filename), 'local_content': gen_out.cloudformation, 'content_type': 'application/json; charset=utf-8' }) extra_packages += util.cluster_to_extra_packages(gen_out.results.cluster_packages)
def make_template(num_masters, gen_arguments, varietal, bootstrap_variant_prefix): ''' Return a tuple: the generated template for num_masters and the artifact dict. @param num_masters: int, number of master nodes to embed in the generated template @param gen_arguments: dict, args to pass to the gen library. These are user input arguments which get filled in/prompted for. @param varietal: string, indicate template varietal to build for either 'acs' or 'dcos' ''' gen_arguments['master_list'] = master_list_arm_json(num_masters, varietal) args = deepcopy(gen_arguments) if varietal == 'dcos': args['exhibitor_azure_prefix'] = "[[[variables('uniqueName')]]]" args[ 'exhibitor_azure_account_name'] = "[[[variables('storageAccountName')]]]" args['exhibitor_azure_account_key'] = ( "[[[listKeys(resourceId('Microsoft.Storage/storageAccounts', " "variables('storageAccountName')), '2015-05-01-preview').key1]]]") args['cluster_name'] = "[[[variables('uniqueName')]]]" dcos_template = gen_templates(args, 'azuredeploy') elif varietal == 'acs': args[ 'exhibitor_azure_prefix'] = "[[[variables('masterPublicIPAddressName')]]]" args[ 'exhibitor_azure_account_name'] = "[[[variables('masterStorageAccountExhibitorName')]]]" args['exhibitor_azure_account_key'] = ( "[[[listKeys(resourceId('Microsoft.Storage/storageAccounts', " "variables('masterStorageAccountExhibitorName')), '2015-06-15').key1]]]" ) args['cluster_name'] = "[[[variables('masterPublicIPAddressName')]]]" dcos_template = gen_templates(args, 'acs') else: raise ValueError("Unknown Azure varietal specified") yield { 'packages': util.cluster_to_extra_packages(dcos_template.results.cluster_packages) } yield { 'channel_path': 'azure/{}{}-{}master.azuredeploy.json'.format(bootstrap_variant_prefix, varietal, num_masters), 'local_content': dcos_template.arm, 'content_type': 'application/json; charset=utf-8' }
def make_template(num_masters, gen_arguments, varietal, bootstrap_variant_prefix): ''' Return a tuple: the generated template for num_masters and the artifact dict. @param num_masters: int, number of master nodes to embed in the generated template @param gen_arguments: dict, args to pass to the gen library. These are user input arguments which get filled in/prompted for. @param varietal: string, indicate template varietal to build for either 'acs' or 'dcos' ''' gen_arguments['master_list'] = master_list_arm_json(num_masters, varietal) args = deepcopy(gen_arguments) if varietal == 'dcos': args['exhibitor_azure_prefix'] = "[[[variables('uniqueName')]]]" args['exhibitor_azure_account_name'] = "[[[variables('storageAccountName')]]]" args['exhibitor_azure_account_key'] = ("[[[listKeys(resourceId('Microsoft.Storage/storageAccounts', " "variables('storageAccountName')), '2015-05-01-preview').key1]]]") args['cluster_name'] = "[[[variables('uniqueName')]]]" dcos_template = gen_templates(args, 'azuredeploy') elif varietal == 'acs': args['exhibitor_azure_prefix'] = "[[[variables('masterPublicIPAddressName')]]]" args['exhibitor_azure_account_name'] = "[[[variables('masterStorageAccountExhibitorName')]]]" args['exhibitor_azure_account_key'] = ("[[[listKeys(resourceId('Microsoft.Storage/storageAccounts', " "variables('masterStorageAccountExhibitorName')), '2015-06-15').key1]]]") args['cluster_name'] = "[[[variables('masterPublicIPAddressName')]]]" dcos_template = gen_templates(args, 'acs') else: raise ValueError("Unknown Azure varietal specified") yield {'packages': util.cluster_to_extra_packages(dcos_template.results.cluster_packages)} yield { 'channel_path': 'azure/{}{}-{}master.azuredeploy.json'.format(bootstrap_variant_prefix, varietal, num_masters), 'local_content': dcos_template.arm, 'content_type': 'application/json; charset=utf-8' }
def _as_artifact_and_pkg(variant_prefix, filename, gen_out): yield _as_cf_artifact("{}{}".format(variant_prefix, filename), gen_out.cloudformation) yield {'packages': util.cluster_to_extra_packages(gen_out.results.cluster_packages)}