Skip to content

Commit

Permalink
feat(deploy,arch,arm64,centos7): add support for centos arm64 since 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang Dongliang committed Oct 29, 2021
1 parent ff9a0c3 commit 37d482b
Show file tree
Hide file tree
Showing 11 changed files with 171 additions and 14 deletions.
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 @@ -222,7 +223,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
67 changes: 67 additions & 0 deletions onecloud/roles/common/tasks/v3_8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
- name: Add yunion rpm repository
get_url:
url: https://iso.yunion.cn/yumrepo-3.8/yunion.repo
dest: /etc/yum.repos.d/yunion.repo
validate_certs: no
become: yes
when:
- is_centos_x86 is defined

- name: Install yunion common packages
yum:
state: latest
name:
- kernel-lt-5.4.130-1.yn20210710.el7
- yunion-executor
when:
- is_centos_x86 is defined
- non_iso_mode is defined

- name: init apt cache for debian
get_url:
url: https://iso.yunion.cn/uos/buster/{{ debian_based_arch }}/3.8/yunion.gpg-key.asc
dest: /tmp/yunion.gpg-key.asc
validate_certs: no
become: yes
when:
- is_debian_based is defined

- name: apply debian sig key
shell: |
echo "deb [trusted=yes] https://iso.yunion.cn/uos/buster/{{ debian_based_arch }}/3.8 ./" > /etc/apt/sources.list.d/yunion.list;
apt-key add /tmp/yunion.gpg-key.asc;
apt-get update -y;
rm -f /tmp/yunion.gpg-key.asc
args:
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_6-v3_7.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 @@ -44,4 +44,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 @@ -128,7 +128,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 @@ -237,7 +237,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
@@ -1,6 +1,6 @@
---
- name: Define kernel regex
set_fact: kernel_regex="el[0-9]+.yn[0-9]{8}."
set_fact: kernel_regex="\.yn[0-9]{8}\."

- name: Is yunion kernel running
shell: |
Expand Down

0 comments on commit 37d482b

Please sign in to comment.