Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

initial outline of the acs template generator #3

Merged
merged 8 commits into from
Sep 30, 2016
Merged

Conversation

anhowe
Copy link
Contributor

@anhowe anhowe commented Sep 23, 2016

No description provided.

@colemickens
Copy link
Contributor

Out of curiosity, what's the difference between putting stuff here versus in VSO?

@anhowe
Copy link
Contributor Author

anhowe commented Sep 23, 2016

this tool will initially be for customers to build their custom templates

}

func (t *TemplateOutputs) generateContent(acsCluster *vlabs.AcsCluster) error {
t.Master = "TemplateOutputs master"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fake string, I think, right? Eventually to be replaced with a full JSON object?

How do you anticipate actually loading in the relevant data here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is gone, and the acsCluster object is bound directly to the templates.

Agents string
// Diagnostics describes the diagnostics section
Diagnostics string
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These represent the Master and Agent FQDN and Diagnostics Storage Account Uri like the current template in ACS? If yes, then you should rename the fields to match the template output so that the names are descriptive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These sections are gone. I've made the model under api/vlabs closely match closely to our API model.

"isStateless": false
},
{
"name": "agentpools",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent pool names should be unique within the cluster so you should name them as such in the example as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I've added validation to catch this now.

// DCOS is the string constant for DCOS orchestrator type
DCOS = "DCOS"
// SWARM is the string constant for the Swarm orchestrator type
SWARM = "Swarm"
Copy link
Contributor

@amanohar amanohar Sep 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all caps for Swarm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is now "Swarm"

}

// AgentPoolProfiles represents an agent pool definition
type AgentPoolProfiles struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be: 'AgentPoolProfile' (singular).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Count int `json:"count"`
VMSize string `json:"vmSize"`
IsStateless bool `json:"isStateless,omitempty"`
DNSPrefix string `json:"dnsPrefix,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a required field. Why would be it empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validation now added to require this if the user specifies ports

{{.Variables.Agents}}
{{.Variables.Diagnostics}}
},
"resources": [
Copy link
Contributor

@amanohar amanohar Sep 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Division of resources in 3 parts might be limiting since there will be common resources/vars between masters and agents like OS image pub/offer/sku.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has been heavily refactored from this initial version

@brendandburns
Copy link
Member

Is this ready to go? I'm happy to merge and iterate.

@anhowe
Copy link
Contributor Author

anhowe commented Sep 29, 2016

Yes, this is ready to go. Please integrate.

@anhowe anhowe merged commit 0b7295e into master Sep 30, 2016
Copy link
Contributor

@JackQuincy JackQuincy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't take the time to groc how different the swarm and disk templates are. But offhand it looks like we might be able to push those two templates file groups into one template files group, or we could break the shared pieces into template files that both call so that we wouldn't need as much duplication.

{"outputs", "zoutputs"},
}

template = translateJSON(template, translateParams, false)
Copy link
Contributor

@JackQuincy JackQuincy Sep 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a bug waiting to happen where a client names something verbedparameterstore, or something of the sort and we rename things to verbeparameterstore. Is there a way we can introduce path to the values we are changing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I shared this offline and anhowe fixed it by adding the quotes. Still possible, but Much less likely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -0,0 +1,392 @@
package clustertemplate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How some of the Json generation logic is here and some is in the go template files looks confusing to me. Is there a clean way to take the parts here where we are making json and move them in to the template files?

Copy link
Contributor Author

@anhowe anhowe Oct 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a strike of balance between having too many levels of templatefiles. Brendan had suggested having everything in code using JSON Path. I'm still trying to figure this out.

Copy link
Contributor

@amanohar amanohar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MasterProfile in the service API model also has a FQDN field that the service returns.

Copy link
Contributor

@amanohar amanohar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API has osType field as well

@anhowe anhowe deleted the anhowe-acstgen branch October 11, 2016 16:14
tanmaykm referenced this pull request in tanmaykm/acs-engine May 26, 2017
Parametrize kubernetes version checking function
lachie83 pushed a commit to lachie83/acs-engine that referenced this pull request Jul 20, 2017
pweil- pushed a commit to pweil-/acs-engine that referenced this pull request Mar 6, 2018
make openshift orchestrator output ARM template from azure-ansible 3.7 refarch
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants