Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(deploy,arch,arm64,centos7): add support for centos arm64 since 3.7 #255

Merged
merged 1 commit into from
Oct 29, 2021
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
5 changes: 3 additions & 2 deletions onecloud/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
- bash-completion
- epel-release
- ca-certificates
state: latest
when:
- is_centos_x86 is defined
- is_centos_based is defined
- non_iso_mode is defined

- name: Set facts
Expand Down Expand Up @@ -213,7 +214,7 @@
- docker-ce-cli
- containerd.io
when:
- is_centos_x86 is defined
- is_centos_based is defined
- non_iso_mode is defined

- name: Make /etc/docker dir
Expand Down
24 changes: 23 additions & 1 deletion onecloud/roles/common/tasks/v3_7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- is_centos_x86 is defined
- non_iso_mode is defined

- name: Install yunion common packages
- name: Install yunion common packages for centos x86
yum:
state: latest
name:
Expand All @@ -32,3 +32,25 @@
executable: /bin/bash
when:
- is_debian_based is defined

- name: Add yunion rpm repository for arm64 centos
get_url:
url: https://iso.yunion.cn/centos-7-aarch/yunion.repo
dest: /etc/yum.repos.d/yunion.repo
validate_certs: no
become: yes
when:
- is_centos_aarch64 is defined
- non_iso_mode is defined

- name: Install yunion common packages for arm64
yum:
state: latest
name:
- kernel-4.14.0-115.8.2.el7a.yn20210924
- kernel-devel-4.14.0-115.8.2.el7a.yn20210924
- kernel-headers-4.14.0-115.8.2.el7a.yn20210924
- yunion-executor-server
when:
- is_centos_aarch64 is defined
- non_iso_mode is defined
28 changes: 28 additions & 0 deletions onecloud/roles/common/tasks/v3_8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,31 @@
executable: /bin/bash
when:
- is_debian_based is defined

- name: install libselinux-python for arm64 centos
yum:
name: libselinux-python
when:
- is_centos_aarch64 is defined

- name: Add yunion rpm repository for arm64 centos
get_url:
url: https://iso.yunion.cn/centos-7-aarch/yunion.repo
dest: /etc/yum.repos.d/yunion.repo
validate_certs: no
become: yes
when:
- is_centos_aarch64 is defined
- non_iso_mode is defined

- name: Install yunion common packages for arm64
yum:
state: latest
name:
- kernel-4.14.0-115.8.2.el7a.yn20210924
- kernel-devel-4.14.0-115.8.2.el7a.yn20210924
- kernel-headers-4.14.0-115.8.2.el7a.yn20210924
- yunion-executor-server
when:
- is_centos_aarch64 is defined
- non_iso_mode is defined
5 changes: 2 additions & 3 deletions onecloud/roles/pre-install-common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
args:
warn: no
when:
- is_centos_x86 is defined
- is_centos_based is defined

- name: make cache for debian like os
shell: "apt-get update"
Expand Down Expand Up @@ -80,9 +80,8 @@
- yunion-fetcherfs
- yunion-ocadm
- yunion-qemu-2.12.1
- yunion-registry
when:
- is_centos_x86 is defined
- is_centos_based is defined
- non_iso_mode is defined

- name: config ntpd service
Expand Down
2 changes: 1 addition & 1 deletion onecloud/roles/registry/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
with_items:
- yunion-registry
when:
- is_centos_x86 is defined
- is_centos_based is defined
- non_iso_mode is defined

- name: Config registry
Expand Down
6 changes: 3 additions & 3 deletions onecloud/roles/upgrade/common/tasks/v3_7-v3_8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
yum clean all
yum --disablerepo='*' --enablerepo='yunion*' makecache fast
when:
- is_centos_x86 is defined
- is_centos_based is defined

- name: "uninstall old rpms"
shell: |
Expand All @@ -27,7 +27,7 @@
yum remove -y $rpms
fi
when:
- is_centos_x86 is defined
- is_centos_based is defined
args:
executable: /bin/bash

Expand All @@ -41,4 +41,4 @@
enablerepo: "yunion-*"
state: latest
when:
- is_centos_x86 is defined
- is_centos_based is defined
67 changes: 67 additions & 0 deletions onecloud/roles/utils/detect-os/vars/centos-aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---

is_centos_based: true
is_centos_aarch64: true

common_packages:
- boost-iostreams
- boost-random
- boost-system
- boost-thread
- celt051
- fuse
- fuse-devel
- fuse-libs
- gssproxy
- jq
- ipvsadm
- ipset
- conntrack-tools
- bridge-utils
- keyutils
- kmod
- kmod-openvswitch
- kubeadm
- kubectl
- kubelet
- libbasicobjects
- libcollection
- libini_config
- libjpeg-turbo
- libnfsidmap
- libogg
- libpath_utils
- libpcap
- librados2
- librbd1
- libref_array
- libtirpc
- libusb
- libusbx
- libverto-libevent
- lm_sensors-libs
- nfs-utils
- nmap-ncat
- openvswitch
- pixman
- quota
- quota-nls
- rpcbind
- spice
- spice-protocol
- sysstat
- tcp_wrappers
- tcpdump
- unbound
- unbound-libs
- usbredir
- yunion-climc
- yunion-executor
- yunion-ocadm
- yunion-ovmfrpm
- yunion-qemu-2.12.1
- yunion-fetcherfs

common_services:
- ntpd
- yunion-executor
1 change: 1 addition & 0 deletions onecloud/roles/utils/detect-os/vars/centos-x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---

is_centos_based: true
is_centos_x86: true

common_packages:
Expand Down
4 changes: 2 additions & 2 deletions onecloud/roles/utils/gpu-init/files/gpu_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ grub_setup() {
# 以便解决重启后因未加载 lvm 驱动而卡住的问题
sed -i -e 's#rd.lvm.lv=[^ ]*##gi' $grub_cfg

idx=$(awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg |grep -P '\.yn\d{8}\.'|awk '{print $1}' |head -1)
idx=$(awk -F\' '$1=="menuentry " {print i++ " : " $2}' $(find /etc/ -name 'grub2*cfg' |head -1 ) |grep -P '\.yn\d{8}\.'|awk '{print $1}' |head -1)
if grep -q '^GRUB_DEFAULT' $grub_cfg; then
sudo sed -i -e "s#^GRUB_DEFAULT=.*#GRUB_DEFAULT=$idx#" $grub_cfg
else
Expand Down Expand Up @@ -238,7 +238,7 @@ dracut_ramfs() {
cat <<EOF >"$dracut_vfio_file"
add_drivers+=" vfio vfio_iommu_type1 vfio_pci"
EOF
local yn_kernel=$(ls /boot/vmlinuz-* | grep yn.*x86_64 | sort -r | head -n 1)
local yn_kernel=$(ls /boot/vmlinuz-* | grep yn | sort -r | head -n 1)
if [ -z "$yn_kernel" ]; then
error_exit "Not found yunion customize kernel"
fi
Expand Down
2 changes: 1 addition & 1 deletion onecloud/roles/utils/gpu-init/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
executable: /bin/bash
chdir: /usr/local/gpu-init/
when:
- is_centos_x86 is defined
- is_centos_based is defined
2 changes: 1 addition & 1 deletion onecloud/roles/utils/kernel-check/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- is_yunion_kernel_running.rc != 0
- ansible_connection == "ssh"
- k8s_node_as_oc_host|default(false)|bool == true
- is_centos_x86 is defined
- is_centos_based is defined

- name: Define kernel regex
set_fact: kernel_regex_debian_510="5\.10\.0"
Expand Down