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

Enabling DCOS 1.11.2 #2964

Merged
merged 2 commits into from
May 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions parts/dcos/bstrap/dcos1.11.2.customdata.t
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion pkg/acsengine/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
125 changes: 40 additions & 85 deletions pkg/acsengine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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...)
Expand Down Expand Up @@ -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)
}
}
Expand All @@ -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 != "" {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 ""
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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")
}
Expand Down Expand Up @@ -2625,23 +2585,18 @@ 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 {
scriptname = dcosProvision
}
}

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)
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -76,6 +78,7 @@ const (

// AllDCOSSupportedVersions maintain a list of available dcos versions in acs-engine
var AllDCOSSupportedVersions = []string{
DCOSVersion1Dot11Dot2,
DCOSVersion1Dot11Dot0,
DCOSVersion1Dot10Dot0,
DCOSVersion1Dot9Dot8,
Expand Down
15 changes: 0 additions & 15 deletions pkg/api/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Loading