From: Srinivasan Date: Mon, 10 May 2021 04:24:51 +0000 (+0530) Subject: egallery version upgrade X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=a5026e14b3e58bbd19ac3ea294926e5e52ab5da0;p=ealt-edge.git egallery version upgrade Signed-off-by: Srinivasan Change-Id: I13c946d5a346a56a1e1ae61f7b03f4d8843d8b60 --- diff --git a/ocd/infra/playbooks/README-edgegallery-installation.md b/ocd/infra/playbooks/README-edgegallery-installation.md new file mode 100644 index 0000000..7d52ed3 --- /dev/null +++ b/ocd/infra/playbooks/README-edgegallery-installation.md @@ -0,0 +1,135 @@ +# EdgeGallery Ansible Offline Installation + +This Guide is for EdgeGallery (EG) installation + +The same as online installation, the offline installation is also based on Ubuntu OS and Kubernetes, supports x86_64 and ARM64 as well. + +## 1. The Dependencies and How to Set Nodes + + EdgeGallery supports Multi Node and All-In-One (AIO) deployment now. + +### 1.1 AIO Deployment + + +## Pre-requisites + + One node with below configs + + | Module | Version | Arch | + |------------|---------|-----------------| + | Ubuntu | 18.04 | ARM 64 & X86_64 | + | Python | 3.6.9 | ARM 64 & X86_64 | + | pip3 | 9.0.1 | ARM 64 & X86_64 | + | Ansible | 2.10.7 | ARM 64 & X86_64 | + | sshpass | 1.06-1 | ARM 64 & X86_64 | + + The Master Node should only install Ubuntu 18.04 and with the following hardware resources: + + - 4CPU + - 16G RAM + - 100G Storage + - Single or Multi NIC + + INFO: The Ansible controller node and the Master Node could be the same node. + + Download and install the pre-requisites mentioned above + +## 2. How to Config the Ansible Controller Node + + The commands in the following sections are all executed on **Ansible controller node** and there is **no commands** + that need to be executed on any other nodes. + +### 2.1 Login Ansible controller node + + The Ansible controller node should already install ubuntu 18.04, python3.6 and pip3 in advance. + +### 2.2 Install Ansible: (Can be skipped If installed) + + - Ansible Online Installation (Can be skipped If installed) + + ``` + # Recommend to install Ansible with python3 + apt install -y python3-pip + pip3 install ansible + ``` + +### Set password-less ssh from Ansible controller node to other nodes + + 2.1. sshpass required: + + ``` + # Install sshpass + + # Check whether sshpass installed + sshpass -V + + ``` + + 2.2 There should be id_rsa and id_rsa.pub under /root/.ssh/, if not, do the following to generate them: + + ``` + ssh-keygen -t rsa + ``` + + 2.3 Do the following to set the password-less ssh, execute the command several times for all master and worker nodes + one by one where `` is the private IP and `` is + the password of root user of that node. + + ``` + sshpass -p ssh-copy-id -o StrictHostKeyChecking=no root@ + ``` + 3. Set hosts-aio + Open hosts-aio in playbook directory ealt-edge/ocd/infra/playbook and provide master node ip in place of master-ip + + - AIO Inventory, replace the exactly master node IP in file `host-aio`: + + ``` + [master] + xxx.xxx.xxx.xxx + ``` + - If SSH port is not the default value 22, should add some more info about the ssh port + + ``` + [master] + xxx.xxx.xxx.xxx + [master:vars] + ansible_ssh_port=xx + +## 3. EdgeGallery Deployment + + ``` + # Install edgegallery + ansible-playbook --inventory hosts-aio ealt-eg-aio-latest.yml -e "ansible_user=root" --extra-vars "operation=install" + + ``` + +### 3.2. How to Set the Parameters + + All parameters that user could set are in file ealtedge/ocd/infra/playbooks/var.yml. + + ``` + # Set the Password of Harbor admin account + HARBOR_ADMIN_PASSWORD: Harbor@edge + + # ip for portals, will be set to private IP of master node default or reset it to be the public IP of master node here + # PORTAL_IP: xxx.xxx.xxx.xxx + + # NIC name of master node + # If master node is with single NIC, not need to set it here and will get the default NIC name during the run time + # If master node is with multiple NICs, should set it here to be 2 different NICs + # EG_NODE_EDGE_MP1: eth0 + # EG_NODE_EDGE_MM5: eth0 + ``` + + Note: No need to modify the above file. But credentials can be changed in var.yml + +## 5. Uninstall EdgeGallery + +AIO mode + +``` +# Uninstall AIO Deployment +cd ealt-edge/ocd/infra/playbooks +ansible-playbook --inventory hosts-aio ealt-eg-aio-unins-latest.yml -e "ansible_user=root" --extra-vars "operation=uninstall" + +``` \ No newline at end of file diff --git a/ocd/infra/playbooks/default-var.yml b/ocd/infra/playbooks/default-var.yml new file mode 100644 index 0000000..22d0dc7 --- /dev/null +++ b/ocd/infra/playbooks/default-var.yml @@ -0,0 +1,55 @@ +# +# Copyright 2021 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# The image tag here could only be latest, and helm tag could only be 1.1.0 +EG_IMAGE_TAG: latest +HELM_TAG: 1.1.0 + +# Mode for online or offline install, currently only support offline +NETWORK_MODE: offline + +# Absolute file path of source offline .tar.gz file on ansible host node +TARBALL_FILE: "{{ inventory_dir }}/../ansible-{{ EG_IMAGE_TAG }}.tar.gz" + +# Target path where offline tarball be decompossed into +TARBALL_PATH: /home/edgegallery-offline + +# Whether copy the offline package from the ansible host node to other node +COPY_TAR_TO_TARGET: yes + +# Whether clean the TARBALL_PATH before install and after uninstall +# true means clean and false means not clean +TARBALL_PATH_CLEANUP: true + +HELM_CHARTS_PATH: "{{ TARBALL_PATH }}/helm/helm-charts" + +APPSTORE_HELM_RELEASE_NAME: appstore-edgegallery +DEVELOPER_HELM_RELEASE_NAME: developer-edgegallery +MECM_FE_HELM_RELEASE_NAME: mecm-fe-edgegallery +ATP_HELM_RELEASE_NAME: atp-edgegallery + +APPSTORE_PORT: 30091 +DEVELOPER_PORT: 30092 +MECM_PORT: 30093 +ATP_PORT: 30094 +USER_MGMT_PORT: 30067 +LAB_PORT: 30096 + +# Could be true or false, currently only support false +ENABLE_PERSISTENCE: false + +# Should set the following 2 params if ENABLE_PERSISTENCE is true +# NFS_SERVER_IP: +# NFS_PATH: diff --git a/ocd/infra/playbooks/ealt-eg-aio-latest.yml b/ocd/infra/playbooks/ealt-eg-aio-latest.yml new file mode 100644 index 0000000..abd8dea --- /dev/null +++ b/ocd/infra/playbooks/ealt-eg-aio-latest.yml @@ -0,0 +1,25 @@ +# +# Copyright 2021 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +--- + +# Edgegallery installation + +- hosts: master + become: yes + roles: + - egallery-tar + - egallery-all-aiomode diff --git a/ocd/infra/playbooks/ealt-eg-aio-unins-latest.yml b/ocd/infra/playbooks/ealt-eg-aio-unins-latest.yml new file mode 100644 index 0000000..ec65f4a --- /dev/null +++ b/ocd/infra/playbooks/ealt-eg-aio-unins-latest.yml @@ -0,0 +1,25 @@ +# +# Copyright 2020 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +--- + +###Edge gallery try### + +- hosts: master + become: yes + roles: + - egallery-tar + - egallery-all-aiomode diff --git a/ocd/infra/playbooks/hosts-aio b/ocd/infra/playbooks/hosts-aio new file mode 100644 index 0000000..f11ff00 --- /dev/null +++ b/ocd/infra/playbooks/hosts-aio @@ -0,0 +1,17 @@ +# +# Copyright 2021 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[master] +master-ip diff --git a/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/install.yml b/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/install.yml new file mode 100644 index 0000000..d633069 --- /dev/null +++ b/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/install.yml @@ -0,0 +1,31 @@ +# Copyright 2021 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +# tasks file +- name: Install edgegallery + shell: + # yamllint disable rule:line-length + cmd: ansible-playbook --inventory hosts-aio -e "ansible_user=root" eg_all_aio_install.yml >> aio_log + # yamllint disable rule:line-length + chdir: /tmp/eg_download/deploy/ansible-all-arm-latest/install + when: ansible_architecture == 'aarch64' + +- name: Install edgegallery + shell: + # yamllint disable rule:line-length + cmd: ansible-playbook --inventory hosts-aio -e "ansible_user=root" eg_all_aio_install.yml >> aio_log + # yamllint disable rule:line-length + chdir: /tmp/eg_download/deploy/ansible-all-x86-latest/install + when: ansible_architecture == 'x86_64' diff --git a/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/main.yml b/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/main.yml new file mode 100644 index 0000000..063f2ac --- /dev/null +++ b/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/main.yml @@ -0,0 +1,23 @@ +# Copyright 2021 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +# tasks file for eg muno all +- include: "install.yml" + static: false + when: operation == 'install' + +- include: "uninstall.yml" + static: false + when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/uninstall.yml b/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/uninstall.yml new file mode 100644 index 0000000..81bb1a1 --- /dev/null +++ b/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/uninstall.yml @@ -0,0 +1,40 @@ +# Copyright 2021 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +- name: Uninstall edgegallery on arm + shell: + # yamllint disable rule:line-length + cmd: ansible-playbook --inventory hosts-aio eg_all_muno_uninstall.yml -e "ansible_user=root" >> aio_remove.log + # yamllint disable rule:line-length + chdir: /tmp/eg_download/deploy/ansible-all-arm-latest/install + when: ansible_architecture == 'aarch64' + +- name: Uninstall edgegallery on x86 + shell: + # yamllint disable rule:line-length + cmd: ansible-playbook --inventory hosts-aio eg_all_muno_uninstall.yml -e "ansible_user=root" >> aio_remove.log + # yamllint disable rule:line-length + chdir: /tmp/eg_download/deploy/ansible-all-x86-latest/install + when: ansible_architecture == 'x86_64' + +- name: Remove edgegallery tar + shell: + cmd: rm -rf ansible-all* + chdir: /tmp/eg_download/deploy/ + +- name: Remove aio log + shell: + cmd: rm -rf aio_log + chdir: /tmp/eg_download/deploy/ diff --git a/ocd/infra/playbooks/roles/egallery-tar/tasks/install.yml b/ocd/infra/playbooks/roles/egallery-tar/tasks/install.yml new file mode 100644 index 0000000..6e5713f --- /dev/null +++ b/ocd/infra/playbooks/roles/egallery-tar/tasks/install.yml @@ -0,0 +1,33 @@ +# Copyright 2021 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +- name: Download 1.1 edgegallery x86 +# yamllint disable rule:line-length + command: wget https://edgegallery.obs.cn-east-3.myhuaweicloud.com/releases/v1.1/x86/EdgeGallery-v1.1-all-x86.tar.gz +# yamllint disable rule:line-length + args: + chdir: /tmp/eg_download/deploy/ + when: ansible_architecture == 'x86_64' + +- name: Untar Edgegallery offline tarbal file + command: tar -xvf EdgeGallery-v1.1-all-x86.tar.gz + args: + chdir: /tmp/eg_download/deploy/ + when: ansible_architecture == 'x86_64' + +- name: Set inventory file + command: cp hosts-aio /tmp/eg_download/deploy/ansible-all-x86-latest/install + args: + chdir: "{{playbook_dir}}" diff --git a/ocd/infra/playbooks/roles/egallery-tar/tasks/main.yml b/ocd/infra/playbooks/roles/egallery-tar/tasks/main.yml new file mode 100644 index 0000000..9512030 --- /dev/null +++ b/ocd/infra/playbooks/roles/egallery-tar/tasks/main.yml @@ -0,0 +1,24 @@ +# Copyright 2021 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +# tasks file + +- include: "install.yml" + static: false + when: operation == 'install' + +- include: "uninstall.yml" + static: false + when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/egallery-tar/tasks/uninstall.yml b/ocd/infra/playbooks/roles/egallery-tar/tasks/uninstall.yml new file mode 100644 index 0000000..44a0f0c --- /dev/null +++ b/ocd/infra/playbooks/roles/egallery-tar/tasks/uninstall.yml @@ -0,0 +1,20 @@ +# Copyright 2020 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +- name: Remove edgegallery tar + shell: + cmd: ls + #cmd: rm -rf ansible-all* + chdir: /tmp/eg_download/deploy/ diff --git a/ocd/infra/playbooks/var.yml b/ocd/infra/playbooks/var.yml new file mode 100644 index 0000000..9cb47bd --- /dev/null +++ b/ocd/infra/playbooks/var.yml @@ -0,0 +1,25 @@ +# +# Copyright 2021 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Password of Harbor admin +HARBOR_ADMIN_PASSWORD: Harbor@edge + +# ip for portals,will be set to private +# iP of master node default or reset it here +# PORTAL_IP: 111.222.333.444 + +# If not set, will get the default one during the run time +# EG_NODE_EDGE_MP1: eth0 +# EG_NODE_EDGE_MM5: eth0