Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
release-4.0: support arm (#1204)
Browse files Browse the repository at this point in the history
  • Loading branch information
liubo0127 authored Mar 12, 2020
1 parent 9237c54 commit bfcf2bf
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 11 deletions.
2 changes: 1 addition & 1 deletion deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
tags:
- tiflash
roles:
- tiflash
- { role: tiflash, when: cpu_architecture == 'amd64' }

- name: deploying pump cluster
hosts: pump_servers
Expand Down
3 changes: 3 additions & 0 deletions inventory.ini
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ ansible_user = tidb

cluster_name = test-cluster

# CPU architecture: amd64, arm64
cpu_architecture = amd64

tidb_version = v4.0.0-beta.1

# process supervision, [systemd, supervise]
Expand Down
6 changes: 3 additions & 3 deletions roles/check_system_static/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
- systemd_version[0] < '219' or (systemd_version[0] == '219' and systemd_release[0] < '52.el7')

- name: Deploy epollexclusive script
copy: src="{{ script_dir }}/check/epollexclusive" dest="{{ deploy_dir }}/epollexclusive" mode=0755
copy: src="{{ script_dir }}/check/epollexclusive-{{ cpu_architecture }}" dest="{{ deploy_dir }}/epollexclusive-{{ cpu_architecture }}" mode=0755

- name: Preflight check - Check if the operating system supports EPOLLEXCLUSIVE
shell: "{{ deploy_dir }}/epollexclusive"
shell: "{{ deploy_dir }}/epollexclusive-{{ cpu_architecture }}"
register: epollexclusive_check

- name: Clean epollexclusive script
file: path={{ deploy_dir }}/epollexclusive state=absent
file: path={{ deploy_dir }}/epollexclusive-{{ cpu_architecture }} state=absent

- name: Preflight check - Fail when epollexclusive is unavailable
fail:
Expand Down
5 changes: 5 additions & 0 deletions roles/local/tasks/binary_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
# with_items: "{{ tiflash_packages }}"
# when:
# - has_outbound_network
# - cpu_architecture == 'amd64'

- name: unarchive third party binary
shell: ls -1 {{ item.name }}-{{ item.version }}.tar.gz | xargs -n1 tar xzf
Expand Down Expand Up @@ -90,6 +91,8 @@
# chdir: "{{ downloads_dir }}"
# warn: no
# with_items: "{{ tiflash_packages }}"
# when:
# - cpu_architecture == 'amd64'

- name: cp monitoring binary
shell: >
Expand All @@ -115,3 +118,5 @@
# shell: >
# cp -rfv {{ downloads_dir }}/{{ item.name }}-{{ item.version }}-linux-amd64 "{{ resources_dir }}/bin/tiflash"
# with_items: "{{ tiflash_packages }}"
# when:
# - cpu_architecture == 'amd64'
58 changes: 58 additions & 0 deletions roles/local/templates/binary_packages.yml.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---

{% if cpu_architecture == 'amd64' -%}
third_party_packages:
- name: prometheus
version: 2.8.1
Expand Down Expand Up @@ -73,3 +74,60 @@ tiflash_packages:
- name: tiflash
version: {{ tidb_version }}
url: http://download.pingcap.org/tiflash-{{ tidb_version }}-linux-amd64.tar.gz
{% elif cpu_architecture == 'arm64' -%}
third_party_packages:
- name: prometheus
version: 2.8.1
url: "https://github.com/prometheus/prometheus/releases/download/v2.8.1/prometheus-2.8.1.linux-arm64.tar.gz"
- name: alertmanager
version: 0.17.0
url: "https://github.com/prometheus/alertmanager/releases/download/v0.17.0/alertmanager-0.17.0.linux-arm64.tar.gz"
- name: node_exporter
version: 0.17.0
url: "https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-arm64.tar.gz"
- name: blackbox_exporter
version: 0.12.0
url: "https://github.com/prometheus/blackbox_exporter/releases/download/v0.12.0/blackbox_exporter-0.12.0.linux-arm64.tar.gz"
- name: pushgateway
version: 0.7.0
url: "https://github.com/prometheus/pushgateway/releases/download/v0.7.0/pushgateway-0.7.0.linux-arm64.tar.gz"
- name: grafana
version: 6.1.6
url: "https://dl.grafana.com/oss/release/grafana-6.1.6.linux-arm64.tar.gz"


third_party_packages_under_gfw:
- name: prometheus
version: 2.8.1
url: "https://download.pingcap.org/prometheus-2.8.1.linux-arm64.tar.gz"
- name: alertmanager
version: 0.17.0
url: "http://download.pingcap.org/alertmanager-0.17.0.linux-arm64.tar.gz"
- name: node_exporter
version: 0.17.0
url: "http://download.pingcap.org/node_exporter-0.17.0.linux-arm64.tar.gz"
- name: pushgateway
version: 0.7.0
url: "http://download.pingcap.org/pushgateway-0.7.0.linux-arm64.tar.gz"
- name: grafana
version: 6.1.6
url: "https://download.pingcap.org/grafana-6.1.6.linux-arm64.tar.gz"
- name: blackbox_exporter
version: 0.12.0
url: "http://download.pingcap.org/blackbox_exporter-0.12.0.linux-arm64.tar.gz"


{% if not deploy_without_tidb|default(false) %}
tispark_packages:
- name: spark-2.4.3-bin-hadoop2.7.tgz
version: 2.4.3
url: http://download.pingcap.org/spark-2.4.3-bin-hadoop2.7.tgz
checksum: "sha256:80a4c564ceff0d9aff82b7df610b1d34e777b45042e21e2d41f3e497bb1fa5d8"
- name: tispark-latest.tar.gz
version: latest
url: http://download.pingcap.org/tispark-assembly-latest-linux-amd64.tar.gz
- name: tispark-sample-data.tar.gz
version: latest
url: http://download.pingcap.org/tispark-sample-data.tar.gz
{% endif %}
{% endif -%}
36 changes: 35 additions & 1 deletion roles/local/templates/common_packages.yml.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---

{% if cpu_architecture == 'amd64' -%}
tidb_packages:
- name: tidb
version: {{ tidb_version }}
Expand All @@ -22,7 +23,7 @@ common_packages:
{% if process_supervision == 'supervise' %}
- name: daemontools
version: 0.53
url: http://download.pingcap.org/daemontools-0.53.tar.gz
url: http://download.pingcap.org/daemontools-0.53-linux-amd64.tar.gz
checksum: "sha256:a4abd491cf185aef5644be5a4e1ed52c8f458802178d4c0efcc8178a5ca67fb7"
{% endif %}

Expand All @@ -31,3 +32,36 @@ diagnosis_packages:
version: v0.2.5-1-g99b8fea
url: http://download.pingcap.org/tidb-insight-v0.2.5-1-g99b8fea.tar.gz
checksum: "sha256:26034435d1b088529c300d5a8145758e68a6ef8000e3eeb6ce027a3ce56ebe45"

{% elif cpu_architecture == 'arm64' -%}
tidb_packages:
- name: tidb
version: {{ tidb_version }}
url: http://download.pingcap.org/tidb-{{ tidb_version }}-linux-arm64.tar.gz

tidb_toolkit_packages:
- name: tidb-toolkit
version: {{ tidb_version }}
url: http://download.pingcap.org/tidb-toolkit-{{ tidb_version }}-linux-arm64.tar.gz

common_packages:
- name: fio
version: 3.8
url: "http://download.pingcap.org/fio-3.8-linux-arm64.tar.gz"
checksum: "sha256:8d086512b26d19229d6b1631db749880ed5a581c42e3bbb7e8d6a2f7155f4c9c"
- name: kafka_exporter
version: 1.1.0
url: http://download.pingcap.org/kafka_exporter-1.1.0.linux-arm64.tar.gz
checksum: "sha256:68a130c00dbd13a530b1ea6b7661427b6af32716ee12c02bab52fdd9e280aec0"
{% if process_supervision == 'supervise' %}
- name: daemontools
version: 0.53
url: http://download.pingcap.org/daemontools-0.53-linux-arm64.tar.gz
checksum: "sha256:39884c7b714b1eff52e2acce0378c8200eb221174796fa54af6a1567f582938b"
{% endif %}

diagnosis_packages:
- name: tidb-insight
version: v0.2.5-1-g99b8fea
url: http://download.pingcap.org/tidb-insight-v0.2.5-4-linux-arm64.tar.gz
{% endif -%}
21 changes: 15 additions & 6 deletions rolling_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -559,39 +559,41 @@
pre_tasks:
- name: stop TiFlash by supervise
shell: cd {{ deploy_dir }}/scripts && ./stop_tiflash.sh
when: process_supervision == 'supervise'
when: process_supervision == 'supervise' and cpu_architecture == 'amd64'

- name: stop TiFlash by systemd
systemd: name=tiflash-{{ tcp_port }}.service state=stopped
become: true
when: process_supervision == 'systemd'
when: process_supervision == 'systemd' and cpu_architecture == 'amd64'

- name: wait until the TiFlash port is down
wait_for:
host: "{{ ansible_host }}"
port: "{{ http_port }}"
state: stopped
msg: "the TiFlash port {{ http_port }} is not down"
when: cpu_architecture == 'amd64'

roles:
- tiflash
- { role: tiflash, when: cpu_architecture == 'amd64' }

post_tasks:
- name: start TiFlash by supervise
shell: cd {{ deploy_dir }}/scripts && ./start_tiflash.sh
when: process_supervision == 'supervise'
when: process_supervision == 'supervise' and cpu_architecture == 'amd64'

- name: start TiFlash by systemd
systemd: name=tiflash-{{ tcp_port }}.service state=started
become: true
when: process_supervision == 'systemd'
when: process_supervision == 'systemd' and cpu_architecture == 'amd64'

- name: wait until the TiFlash port is up
wait_for:
host: "{{ ansible_host }}"
port: "{{ http_port }}"
state: started
msg: "the TiFlash port {{ http_port }} is not up"
when: cpu_architecture == 'amd64'

- name: wait until the TiFlash status page is available
uri:
Expand All @@ -601,4 +603,11 @@
until: tiflash_http_result.status == 200
retries: 12
delay: 5
when: not enable_tls|default(false)
when: not enable_tls|default(false) and cpu_architecture == 'amd64'

- hosts: localhost
tags:
- always
tasks:
- name: init pd topo
shell: "cd {{ playbook_dir }}/scripts && ./dashboard_topo.sh"
File renamed without changes.
Binary file added scripts/check/epollexclusive-arm64
Binary file not shown.

0 comments on commit bfcf2bf

Please sign in to comment.