diff --git a/parts/dcos/bstrap/dcoscustomdata111.t b/parts/dcos/bstrap/dcos1.11.0.customdata.t similarity index 100% rename from parts/dcos/bstrap/dcoscustomdata111.t rename to parts/dcos/bstrap/dcos1.11.0.customdata.t diff --git a/parts/dcos/bstrap/dcos1.11.2.customdata.t b/parts/dcos/bstrap/dcos1.11.2.customdata.t new file mode 100644 index 0000000000..11c331e682 --- /dev/null +++ b/parts/dcos/bstrap/dcos1.11.2.customdata.t @@ -0,0 +1,76 @@ +bootcmd: +- bash -c "if [ ! -f /var/lib/sdb-gpt ];then echo DCOS-5890;parted -s /dev/sdb mklabel + gpt;touch /var/lib/sdb-gpt;fi" +disk_setup: + ephemeral0: + layout: + - 50 + - 50 + overwrite: true + table_type: gpt +fs_setup: +- device: ephemeral0.1 + filesystem: ext4 + overwrite: true +- device: ephemeral0.2 + filesystem: ext4 + overwrite: true +mounts: +- - ephemeral0.1 + - /var/lib/mesos +- - ephemeral0.2 + - /var/lib/docker +runcmd: PREPROVISION_EXTENSION +- ln -s /bin/rm /usr/bin/rm +- ln -s /bin/mkdir /usr/bin/mkdir +- ln -s /bin/tar /usr/bin/tar +- ln -s /bin/ln /usr/bin/ln +- ln -s /bin/cp /usr/bin/cp +- ln -s /bin/systemctl /usr/bin/systemctl +- ln -s /bin/mount /usr/bin/mount +- ln -s /bin/bash /usr/bin/bash +- ln -s /usr/sbin/useradd /usr/bin/useradd +- systemctl disable --now resolvconf.service +- systemctl mask --now lxc-net.service +- systemctl disable --now unscd.service +- systemctl stop --now unscd.service +- /opt/azure/containers/provision.sh +- bash /tmp/dcos/dcos_install.sh ROLENAME +write_files: +- content: | + [Service] + Restart=always + StartLimitInterval=0 + RestartSec=15 + ExecStartPre=-/sbin/ip link del docker0 + ExecStart= + ExecStart=/usr/bin/dockerd --storage-driver=overlay + path: /etc/systemd/system/docker.service.d/execstart.conf + permissions: '0644' +- content: | + [Unit] + PartOf=docker.service + [Socket] + ListenStream=/var/run/docker.sock + SocketMode=0660 + SocketUser=root + SocketGroup=docker + ListenStream=2375 + BindIPv6Only=both + [Install] + WantedBy=sockets.target + path: /etc/systemd/system/docker.socket + permissions: '0644' +- content: | + DCOS_ENVIRONMENT={{{targetEnvironment}}} + owner: root + path: /opt/azure/dcos/environment + permissions: '0644' +- path: /var/lib/dcos/mesos-slave-common + content: 'ATTRIBUTES_STR' + permissions: "0644" + owner: "root" +- content: 'PROVISION_STR' + path: /opt/azure/containers/provision.sh + permissions: "0744" + owner: "root" diff --git a/pkg/acsengine/defaults.go b/pkg/acsengine/defaults.go index b63b426bff..ed73a794db 100644 --- a/pkg/acsengine/defaults.go +++ b/pkg/acsengine/defaults.go @@ -576,7 +576,7 @@ func setOrchestratorDefaults(cs *api.ContainerService) { o.DcosConfig.DcosWindowsBootstrapURL = DefaultDCOSSpecConfig.DCOSWindowsBootstrapDownloadURL } dcosSemVer, _ := semver.NewVersion(o.OrchestratorVersion) - dcosBootstrapSemVer, _ := semver.NewVersion(api.DCOSVersion1Dot11Dot0) + dcosBootstrapSemVer, _ := semver.NewVersion(common.DCOSVersion1Dot11Dot0) if !dcosSemVer.LessThan(dcosBootstrapSemVer) { if o.DcosConfig.BootstrapProfile == nil { o.DcosConfig.BootstrapProfile = &api.BootstrapProfile{} diff --git a/pkg/acsengine/engine.go b/pkg/acsengine/engine.go index 4a291f7566..5c974923c1 100644 --- a/pkg/acsengine/engine.go +++ b/pkg/acsengine/engine.go @@ -56,7 +56,8 @@ const ( dcos2Provision = "dcos/bstrap/dcosprovision.sh" dcos2BootstrapProvision = "dcos/bstrap/bootstrapprovision.sh" - dcos2CustomData111 = "dcos/bstrap/dcoscustomdata111.t" + dcos2CustomData1110 = "dcos/bstrap/dcos1.11.0.customdata.t" + dcos2CustomData1112 = "dcos/bstrap/dcos1.11.2.customdata.t" ) const ( @@ -405,13 +406,12 @@ func (t *TemplateGenerator) prepareTemplateFiles(properties *api.Properties) ([] var baseFile string switch properties.OrchestratorProfile.OrchestratorType { case api.DCOS: - switch properties.OrchestratorProfile.OrchestratorVersion { - case api.DCOSVersion1Dot11Dot0: - files = append(commonTemplateFiles, dcos2TemplateFiles...) - baseFile = dcos2BaseFile - default: + if properties.OrchestratorProfile.DcosConfig == nil || properties.OrchestratorProfile.DcosConfig.BootstrapProfile == nil { files = append(commonTemplateFiles, dcosTemplateFiles...) baseFile = dcosBaseFile + } else { + files = append(commonTemplateFiles, dcos2TemplateFiles...) + baseFile = dcos2BaseFile } case api.Swarm: files = append(commonTemplateFiles, swarmTemplateFiles...) @@ -819,15 +819,15 @@ func getParameters(cs *api.ContainerService, isClassicMode bool, generatorCode s switch properties.OrchestratorProfile.OrchestratorType { case api.DCOS: switch properties.OrchestratorProfile.OrchestratorVersion { - case api.DCOSVersion1Dot8Dot8: + case common.DCOSVersion1Dot8Dot8: dcosBootstrapURL = cloudSpecConfig.DCOSSpecConfig.DCOS188BootstrapDownloadURL - case api.DCOSVersion1Dot9Dot0: + case common.DCOSVersion1Dot9Dot0: dcosBootstrapURL = cloudSpecConfig.DCOSSpecConfig.DCOS190BootstrapDownloadURL - case api.DCOSVersion1Dot9Dot8: + case common.DCOSVersion1Dot9Dot8: dcosBootstrapURL = cloudSpecConfig.DCOSSpecConfig.DCOS198BootstrapDownloadURL - case api.DCOSVersion1Dot10Dot0: + case common.DCOSVersion1Dot10Dot0: dcosBootstrapURL = cloudSpecConfig.DCOSSpecConfig.DCOS110BootstrapDownloadURL - case api.DCOSVersion1Dot11Dot0: + default: dcosBootstrapURL = getDCOSDefaultBootstrapInstallerURL(properties.OrchestratorProfile) } } @@ -850,13 +850,9 @@ func getParameters(cs *api.ContainerService, isClassicMode bool, generatorCode s properties.OrchestratorProfile.OrchestratorType, properties.OrchestratorProfile.OrchestratorVersion) } + if properties.OrchestratorProfile.DcosConfig.DcosClusterPackageListID != "" { dcosClusterPackageListID = properties.OrchestratorProfile.DcosConfig.DcosClusterPackageListID - } else { - dcosClusterPackageListID = getDCOSDefaultClusterPackageListGUID( - properties.OrchestratorProfile.OrchestratorType, - properties.OrchestratorProfile.OrchestratorVersion, - properties.MasterProfile.Count) } if properties.OrchestratorProfile.DcosConfig.DcosProviderPackageID != "" { @@ -1021,16 +1017,8 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat }, "IsDCOS19": func() bool { return cs.Properties.OrchestratorProfile.OrchestratorType == api.DCOS && - (cs.Properties.OrchestratorProfile.OrchestratorVersion == api.DCOSVersion1Dot9Dot0 || - cs.Properties.OrchestratorProfile.OrchestratorVersion == api.DCOSVersion1Dot9Dot8) - }, - "IsDCOS110": func() bool { - return cs.Properties.OrchestratorProfile.OrchestratorType == api.DCOS && - cs.Properties.OrchestratorProfile.OrchestratorVersion == api.DCOSVersion1Dot10Dot0 - }, - "IsDCOS111": func() bool { - return cs.Properties.OrchestratorProfile.OrchestratorType == api.DCOS && - cs.Properties.OrchestratorProfile.OrchestratorVersion == api.DCOSVersion1Dot11Dot0 + (cs.Properties.OrchestratorProfile.OrchestratorVersion == common.DCOSVersion1Dot9Dot0 || + cs.Properties.OrchestratorProfile.OrchestratorVersion == common.DCOSVersion1Dot9Dot8) }, "IsKubernetesVersionGe": func(version string) bool { orchestratorVersion, _ := semver.NewVersion(cs.Properties.OrchestratorProfile.OrchestratorVersion) @@ -2114,8 +2102,10 @@ func getDCOSWindowsAgentPreprovisionParameters(cs *api.ContainerService, profile func getDCOSDefaultBootstrapInstallerURL(profile *api.OrchestratorProfile) string { if profile.OrchestratorType == api.DCOS { switch profile.OrchestratorVersion { - case api.DCOSVersion1Dot11Dot0: - return "https://downloads.dcos.io/dcos/stable/1.11.0/dcos_generate_config.sh" + case common.DCOSVersion1Dot11Dot2: + return "https://dcos-mirror.azureedge.net/dcos-1-11-2/dcos_generate_config.sh" + case common.DCOSVersion1Dot11Dot0: + return "https://dcos-mirror.azureedge.net/dcos-1-11-0/dcos_generate_config.sh" } } return "" @@ -2124,16 +2114,7 @@ func getDCOSDefaultBootstrapInstallerURL(profile *api.OrchestratorProfile) strin func getDCOSDefaultProviderPackageGUID(orchestratorType string, orchestratorVersion string, masterCount int) string { if orchestratorType == api.DCOS { switch orchestratorVersion { - case api.DCOSVersion1Dot11Dot0: - switch masterCount { - case 1: - return "5a6b7b92820dc4a7825c84f0a96e012e0fcc8a6b" - case 3: - return "327392a609d77d411886216d431e00581a8612f7" - case 5: - return "fd24e32755e7868841a3fafd21b2d2cce0aa4154" - } - case api.DCOSVersion1Dot10Dot0: + case common.DCOSVersion1Dot10Dot0: switch masterCount { case 1: return "c4ec6210f396b8e435177b82e3280a2cef0ce721" @@ -2142,7 +2123,7 @@ func getDCOSDefaultProviderPackageGUID(orchestratorType string, orchestratorVers case 5: return "f286ad9d3641da5abb622e4a8781f73ecd8492fa" } - case api.DCOSVersion1Dot9Dot0: + case common.DCOSVersion1Dot9Dot0: switch masterCount { case 1: return "bcc883b7a3191412cf41824bdee06c1142187a0b" @@ -2151,7 +2132,7 @@ func getDCOSDefaultProviderPackageGUID(orchestratorType string, orchestratorVers case 5: return "b41bfa84137a6374b2ff5eb1655364d7302bd257" } - case api.DCOSVersion1Dot9Dot8: + case common.DCOSVersion1Dot9Dot8: switch masterCount { case 1: return "e8b0e3fc4a16394dc6dd5b19fc54bf1543bff429" @@ -2160,7 +2141,7 @@ func getDCOSDefaultProviderPackageGUID(orchestratorType string, orchestratorVers case 5: return "c03c9587f88929f310b80af4f448b7b51654f1c8" } - case api.DCOSVersion1Dot8Dot8: + case common.DCOSVersion1Dot8Dot8: switch masterCount { case 1: return "441385ce2f5942df7e29075c12fb38fa5e92cbba" @@ -2177,11 +2158,9 @@ func getDCOSDefaultProviderPackageGUID(orchestratorType string, orchestratorVers func getDCOSDefaultRepositoryURL(orchestratorType string, orchestratorVersion string) string { if orchestratorType == api.DCOS { switch orchestratorVersion { - case api.DCOSVersion1Dot11Dot0: - return "https://dcosio.azureedge.net/dcos/stable/1.11.0" - case api.DCOSVersion1Dot10Dot0: + case common.DCOSVersion1Dot10Dot0: return "https://dcosio.azureedge.net/dcos/stable/1.10.0" - case api.DCOSVersion1Dot9Dot8: + case common.DCOSVersion1Dot9Dot8: return "https://dcosio.azureedge.net/dcos/stable/1.9.8" default: return "https://dcosio.azureedge.net/dcos/stable" @@ -2190,25 +2169,6 @@ func getDCOSDefaultRepositoryURL(orchestratorType string, orchestratorVersion st return "" } -func getDCOSDefaultClusterPackageListGUID(orchestratorType string, orchestratorVersion string, masterCount int) string { - if orchestratorType == api.DCOS { - switch orchestratorVersion { - case api.DCOSVersion1Dot11Dot0: - switch masterCount { - case 1: - return "eee6337ea89c74ba58986406d24e373bdeae8012" - case 3: - return "248a66388bba1adbcb14a52fd3b7b424ab06fa76" - case 5: - return "302987609a34f07c206da1791c5a553141416ad8" - } - default: - break - } - } - return "" -} - func isNSeriesSKU(profile *api.AgentPoolProfile) bool { return strings.Contains(profile.VMSize, "Standard_N") } @@ -2625,13 +2585,8 @@ func getDCOSBootstrapProvisionScript() string { func getDCOSAgentProvisionScript(profile *api.AgentPoolProfile, orchProfile *api.OrchestratorProfile) string { // add the provision script - - var scriptname string - - switch orchProfile.OrchestratorVersion { - case api.DCOSVersion1Dot11Dot0: - scriptname = dcos2Provision - default: + scriptname := dcos2Provision + if orchProfile.DcosConfig == nil || orchProfile.DcosConfig.BootstrapProfile == nil { if profile.OSType == api.Windows { scriptname = dcosWindowsProvision } else { @@ -2639,9 +2594,9 @@ func getDCOSAgentProvisionScript(profile *api.AgentPoolProfile, orchProfile *api } } - bp, err1 := Asset(scriptname) - if err1 != nil { - panic(fmt.Sprintf("BUG: %s", err1.Error())) + bp, err := Asset(scriptname) + if err != nil { + panic(fmt.Sprintf("BUG: %s", err.Error())) } provisionScript := string(bp) @@ -2671,13 +2626,11 @@ func getDCOSAgentProvisionScript(profile *api.AgentPoolProfile, orchProfile *api } func getDCOSMasterProvisionScript(orchProfile *api.OrchestratorProfile) string { - var scriptname string - switch orchProfile.OrchestratorVersion { - case api.DCOSVersion1Dot11Dot0: - scriptname = dcos2Provision - default: + scriptname := dcos2Provision + if orchProfile.DcosConfig == nil || orchProfile.DcosConfig.BootstrapProfile == nil { scriptname = dcosProvision } + // add the provision script bp, err := Asset(scriptname) if err != nil { @@ -2705,16 +2658,18 @@ func getDCOSCustomDataTemplate(orchestratorType, orchestratorVersion string) str switch orchestratorType { case api.DCOS: switch orchestratorVersion { - case api.DCOSVersion1Dot8Dot8: + case common.DCOSVersion1Dot8Dot8: return dcosCustomData188 - case api.DCOSVersion1Dot9Dot0: + case common.DCOSVersion1Dot9Dot0: return dcosCustomData190 - case api.DCOSVersion1Dot9Dot8: + case common.DCOSVersion1Dot9Dot8: return dcosCustomData198 - case api.DCOSVersion1Dot10Dot0: + case common.DCOSVersion1Dot10Dot0: return dcosCustomData110 - case api.DCOSVersion1Dot11Dot0: - return dcos2CustomData111 + case common.DCOSVersion1Dot11Dot0: + return dcos2CustomData1110 + case common.DCOSVersion1Dot11Dot2: + return dcos2CustomData1112 } default: // it is a bug to get here diff --git a/pkg/api/common/const.go b/pkg/api/common/const.go index d388d4618c..e791f2e57d 100644 --- a/pkg/api/common/const.go +++ b/pkg/api/common/const.go @@ -60,6 +60,8 @@ const ( ) const ( + // DCOSVersion1Dot11Dot2 is the major.minor.patch string for 1.11.0 versions of DCOS + DCOSVersion1Dot11Dot2 string = "1.11.2" // DCOSVersion1Dot11Dot0 is the major.minor.patch string for 1.11.0 versions of DCOS DCOSVersion1Dot11Dot0 string = "1.11.0" // DCOSVersion1Dot10Dot0 is the major.minor.patch string for 1.10.0 versions of DCOS @@ -76,6 +78,7 @@ const ( // AllDCOSSupportedVersions maintain a list of available dcos versions in acs-engine var AllDCOSSupportedVersions = []string{ + DCOSVersion1Dot11Dot2, DCOSVersion1Dot11Dot0, DCOSVersion1Dot10Dot0, DCOSVersion1Dot9Dot8, diff --git a/pkg/api/const.go b/pkg/api/const.go index 4097111b9c..97ecc80e9f 100644 --- a/pkg/api/const.go +++ b/pkg/api/const.go @@ -73,21 +73,6 @@ const ( ManagedDisks = "ManagedDisks" ) -const ( - // DCOSVersion1Dot11Dot0 is the major.minor.patch string for 1.11.0 versions of DCOS - DCOSVersion1Dot11Dot0 string = "1.11.0" - // DCOSVersion1Dot10Dot0 is the major.minor.patch string for 1.10.0 versions of DCOS - DCOSVersion1Dot10Dot0 string = "1.10.0" - // DCOSVersion1Dot9Dot0 is the major.minor.patch string for 1.9.0 versions of DCOS - DCOSVersion1Dot9Dot0 string = "1.9.0" - // DCOSVersion1Dot9Dot8 is the major.minor.patch string for 1.9.8 versions of DCOS - DCOSVersion1Dot9Dot8 string = "1.9.8" - // DCOSVersion1Dot8Dot8 is the major.minor.patch string for 1.8.8 versions of DCOS - DCOSVersion1Dot8Dot8 string = "1.8.8" - // DCOSDefaultVersion is the default major.minor.patch version for DCOS - DCOSDefaultVersion string = DCOSVersion1Dot11Dot0 -) - // To identify programmatically generated public agent pools const publicAgentPoolSuffix = "-public" diff --git a/pkg/api/convertertoapi.go b/pkg/api/convertertoapi.go index 4f9da8bec1..3debb7a252 100644 --- a/pkg/api/convertertoapi.go +++ b/pkg/api/convertertoapi.go @@ -521,14 +521,14 @@ func convertV20160930OrchestratorProfile(v20160930 *v20160930.OrchestratorProfil if api.OrchestratorType == Kubernetes { api.OrchestratorVersion = "1.6.9" } else if api.OrchestratorType == DCOS { - api.OrchestratorVersion = DCOSVersion1Dot9Dot0 + api.OrchestratorVersion = common.DCOSVersion1Dot9Dot0 } } func convertV20160330OrchestratorProfile(v20160330 *v20160330.OrchestratorProfile, api *OrchestratorProfile) { api.OrchestratorType = v20160330.OrchestratorType if api.OrchestratorType == DCOS { - api.OrchestratorVersion = DCOSVersion1Dot9Dot0 + api.OrchestratorVersion = common.DCOSVersion1Dot9Dot0 } } @@ -537,7 +537,7 @@ func convertV20170131OrchestratorProfile(v20170131 *v20170131.OrchestratorProfil if api.OrchestratorType == Kubernetes { api.OrchestratorVersion = common.GetDefaultKubernetesVersion() } else if api.OrchestratorType == DCOS { - api.OrchestratorVersion = DCOSVersion1Dot9Dot0 + api.OrchestratorVersion = common.DCOSVersion1Dot9Dot0 } } @@ -553,10 +553,10 @@ func convertV20170701OrchestratorProfile(v20170701cs *v20170701.OrchestratorProf api.OrchestratorVersion = common.GetSupportedKubernetesVersion(v20170701cs.OrchestratorVersion) case DCOS: switch v20170701cs.OrchestratorVersion { - case DCOSVersion1Dot10Dot0, DCOSVersion1Dot9Dot0, DCOSVersion1Dot8Dot8: + case common.DCOSVersion1Dot10Dot0, common.DCOSVersion1Dot9Dot0, common.DCOSVersion1Dot8Dot8: api.OrchestratorVersion = v20170701cs.OrchestratorVersion default: - api.OrchestratorVersion = DCOSVersion1Dot9Dot0 + api.OrchestratorVersion = common.DCOSVersion1Dot9Dot0 } default: break