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

simplified DCOS bootstrap deployment #2864

Merged
merged 2 commits into from
May 4, 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
41 changes: 1 addition & 40 deletions parts/dcos/bstrap/bootstrapcustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,48 +37,8 @@ runcmd: PREPROVISION_EXTENSION
- [ systemctl, disable, --now, unscd.service ]
- [ systemctl, stop, --now, unscd.service ]
- /opt/azure/containers/provision.sh
- [ systemctl, start, dcos-docker-install.service ]
- [ systemctl, restart, systemd-journald.service ]
- [ systemctl, restart, docker.service ]
- /opt/azure/dcos/init_bootstrap.sh
write_files:
- content: |
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
Environment=DEBIAN_FRONTEND=noninteractive
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/curl -fLsSv --retry 20 -Y 100000 -y 60 -o /var/tmp/d.deb https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_17.09.0~ce-0~ubuntu_amd64.deb
ExecStart=/usr/bin/bash -c "try=1;until dpkg -D3 -i /var/tmp/d.deb || ((try>9));do echo retry $((try++));sleep $((try*try));done;systemctl --now start docker;systemctl restart docker.socket"
path: /etc/systemd/system/dcos-docker-install.service
permissions: '0644'
- 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
Expand Down Expand Up @@ -107,6 +67,7 @@ MASTER_IP_LIST
permissions: '0644'
- content: |
#!/bin/bash

cd /opt/azure/dcos
curl -O {{{dcosBootstrapURL}}}

Expand Down
30 changes: 6 additions & 24 deletions parts/dcos/bstrap/bootstrapprovision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,11 @@ retrycmd_if_failure() { retries=$1; wait=$2; timeout=$3; shift && shift && shift
TMPDIR="/tmp/dcos"
mkdir -p $TMPDIR

# default dc/os component download address (Azure CDN)
DOCKER_ENGINE_DOWNLOAD_URL=https://mesosphere.blob.core.windows.net/dcos-deps/docker-engine_1.13.1-0-ubuntu-xenial_amd64.deb
LIBIPSET_DOWNLOAD_URL=https://az837203.vo.msecnd.net/dcos-deps/libipset3_6.29-1_amd64.deb
IPSET_DOWNLOAD_URL=https://az837203.vo.msecnd.net/dcos-deps/ipset_6.29-1_amd64.deb
UNZIP_DOWNLOAD_URL=https://az837203.vo.msecnd.net/dcos-deps/unzip_6.0-20ubuntu1_amd64.deb
LIBLTDL_DOWNLOAD_URL=https://az837203.vo.msecnd.net/dcos-deps/libltdl7_2.4.6-0.1_amd64.deb

case $DCOS_ENVIRONMENT in
# because of Chinese GreatWall Firewall, the default packages on Azure CDN is blocked. So the following Chinese local mirror url should be used instead.
AzureChinaCloud)
DOCKER_ENGINE_DOWNLOAD_URL=http://acsengine.blob.core.chinacloudapi.cn/dcos/docker-engine_1.11.2-0~xenial_amd64.deb
LIBIPSET_DOWNLOAD_URL=http://acsengine.blob.core.chinacloudapi.cn/dcos/libipset3_6.29-1_amd64.deb
IPSET_DOWNLOAD_URL=http://acsengine.blob.core.chinacloudapi.cn/dcos/ipset_6.29-1_amd64.deb
UNZIP_DOWNLOAD_URL=http://acsengine.blob.core.chinacloudapi.cn/dcos/unzip_6.0-20ubuntu1_amd64.deb
LIBLTDL_DOWNLOAD_URL=http://acsengine.blob.core.chinacloudapi.cn/dcos/libltdl7_2.4.6-0.1_amd64.deb
;;
esac

curl -fLsSv --retry 20 -Y 100000 -y 60 -o $TMPDIR/d.deb $DOCKER_ENGINE_DOWNLOAD_URL &
curl -fLsSv --retry 20 -Y 100000 -y 60 -o $TMPDIR/1.deb $LIBIPSET_DOWNLOAD_URL &
curl -fLsSv --retry 20 -Y 100000 -y 60 -o $TMPDIR/2.deb $IPSET_DOWNLOAD_URL &
curl -fLsSv --retry 20 -Y 100000 -y 60 -o $TMPDIR/3.deb $UNZIP_DOWNLOAD_URL &
curl -fLsSv --retry 20 -Y 100000 -y 60 -o $TMPDIR/4.deb $LIBLTDL_DOWNLOAD_URL &
curl -fLsSv --retry 20 -Y 100000 -y 60 -o $TMPDIR/key https://download.docker.com/linux/ubuntu/gpg &
wait

retrycmd_if_failure 10 10 120 dpkg -i $TMPDIR/{1,2,3,4}.deb
apt-key add $TMPDIR/key
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
retrycmd_if_failure 10 10 120 apt-get update
retrycmd_if_failure 10 10 120 apt-get install docker-ce=17.06.2~ce-0~ubuntu -y