egallery version upgrade 38/4238/7
authorSrinivasan <srinivasan.s.n@huawei.com>
Mon, 10 May 2021 04:24:51 +0000 (09:54 +0530)
committerSrinivasan <srinivasan.s.n@huawei.com>
Mon, 10 May 2021 14:09:28 +0000 (19:39 +0530)
Signed-off-by: Srinivasan <srinivasan.s.n@huawei.com>
Change-Id: I13c946d5a346a56a1e1ae61f7b03f4d8843d8b60

12 files changed:
ocd/infra/playbooks/README-edgegallery-installation.md [new file with mode: 0644]
ocd/infra/playbooks/default-var.yml [new file with mode: 0644]
ocd/infra/playbooks/ealt-eg-aio-latest.yml [new file with mode: 0644]
ocd/infra/playbooks/ealt-eg-aio-unins-latest.yml [new file with mode: 0644]
ocd/infra/playbooks/hosts-aio [new file with mode: 0644]
ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/install.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/main.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/uninstall.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/egallery-tar/tasks/install.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/egallery-tar/tasks/main.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/egallery-tar/tasks/uninstall.yml [new file with mode: 0644]
ocd/infra/playbooks/var.yml [new file with mode: 0644]

diff --git a/ocd/infra/playbooks/README-edgegallery-installation.md b/ocd/infra/playbooks/README-edgegallery-installation.md
new file mode 100644 (file)
index 0000000..7d52ed3
--- /dev/null
@@ -0,0 +1,135 @@
+# EdgeGallery Ansible Offline Installation\r
+\r
+This Guide is for EdgeGallery (EG) installation\r
+\r
+The same as online installation, the offline installation is also based on Ubuntu OS and Kubernetes, supports x86_64 and ARM64 as well.\r
+\r
+## 1. The Dependencies and How to Set Nodes\r
+\r
+  EdgeGallery supports Multi Node and All-In-One (AIO) deployment now.\r
+\r
+### 1.1 AIO Deployment\r
+\r
+\r
+##  Pre-requisites\r
+\r
+   One node with below configs\r
+\r
+  | Module     | Version | Arch            |\r
+  |------------|---------|-----------------|\r
+  | Ubuntu     | 18.04   | ARM 64 & X86_64 |\r
+  | Python     | 3.6.9   | ARM 64 & X86_64 |\r
+  | pip3       | 9.0.1   | ARM 64 & X86_64 |\r
+  | Ansible    | 2.10.7  | ARM 64 & X86_64 |\r
+  | sshpass    | 1.06-1  | ARM 64 & X86_64 |\r
+\r
+  The Master Node should only install Ubuntu 18.04 and with the following hardware resources:\r
+\r
+  - 4CPU\r
+  - 16G RAM\r
+  - 100G Storage\r
+  - Single or Multi NIC\r
+\r
+  INFO: The Ansible controller node and the Master Node could be the same node.\r
+\r
+  Download and install the pre-requisites mentioned above\r
+\r
+## 2. How to Config the Ansible Controller Node\r
+\r
+  The commands in the following sections are all executed on  **Ansible controller node**  and there is  **no commands** \r
+  that need to be executed on any other nodes.\r
+\r
+### 2.1 Login Ansible controller node\r
+\r
+  The Ansible controller node should already install ubuntu 18.04, python3.6 and pip3 in advance.\r
+\r
+### 2.2 Install Ansible: (Can be skipped If installed)\r
+\r
+  - Ansible Online Installation (Can be skipped If installed)\r
+\r
+      ```\r
+      # Recommend to install Ansible with python3\r
+      apt install -y python3-pip\r
+      pip3 install ansible\r
+      ```\r
+\r
+### Set password-less ssh from Ansible controller node to other nodes\r
+\r
+    2.1. sshpass required:\r
+\r
+    ```\r
+    # Install sshpass\r
+\r
+    # Check whether sshpass installed\r
+    sshpass -V\r
+\r
+    ```\r
+\r
+    2.2 There should be id_rsa and id_rsa.pub under /root/.ssh/, if not, do the following to generate them:\r
+\r
+    ```\r
+    ssh-keygen -t rsa\r
+    ```\r
+\r
+    2.3 Do the following to set the password-less ssh, execute the command several times for all master and worker nodes\r
+        one by one where `<master-or-worker-node-ip>` is the private IP and `<master-or-worker-node-root-password>` is\r
+        the password of root user of that node.\r
+\r
+    ```\r
+    sshpass -p <master-or-worker-node-root-password> ssh-copy-id -o StrictHostKeyChecking=no root@<master-or-worker-node-ip>\r
+    ```\r
+  3. Set hosts-aio\r
+  Open hosts-aio in playbook directory ealt-edge/ocd/infra/playbook and provide master node ip in place of master-ip\r
+\r
+  - AIO Inventory, replace the exactly master node IP in file `host-aio`:\r
+\r
+    ```\r
+    [master]\r
+    xxx.xxx.xxx.xxx\r
+    ```\r
+  - If SSH port is not the default value 22, should add some more info about the ssh port\r
+\r
+    ```\r
+    [master]\r
+    xxx.xxx.xxx.xxx\r
+    [master:vars]\r
+    ansible_ssh_port=xx\r
+\r
+## 3. EdgeGallery Deployment\r
+   \r
+   ```\r
+   # Install edgegallery\r
+   ansible-playbook --inventory hosts-aio ealt-eg-aio-latest.yml -e "ansible_user=root" --extra-vars "operation=install"\r
+\r
+   ```\r
+\r
+### 3.2. How to Set the Parameters\r
+\r
+  All parameters that user could set are in file ealtedge/ocd/infra/playbooks/var.yml.\r
+\r
+  ```\r
+  # Set the Password of Harbor admin account\r
+  HARBOR_ADMIN_PASSWORD: Harbor@edge\r
+\r
+  # 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\r
+  # PORTAL_IP: xxx.xxx.xxx.xxx\r
+\r
+  # NIC name of master node\r
+  # If master node is with single NIC, not need to set it here and will get the default NIC name during the run time\r
+  # If master node is with multiple NICs, should set it here to be 2 different NICs\r
+  # EG_NODE_EDGE_MP1: eth0\r
+  # EG_NODE_EDGE_MM5: eth0\r
+  ```\r
+\r
+  Note: No need to modify the above file.  But credentials can be changed in var.yml\r
+\r
+## 5. Uninstall EdgeGallery\r
+\r
+AIO mode\r
+\r
+```\r
+# Uninstall AIO Deployment\r
+cd ealt-edge/ocd/infra/playbooks\r
+ansible-playbook --inventory hosts-aio ealt-eg-aio-unins-latest.yml -e "ansible_user=root" --extra-vars "operation=uninstall"\r
+\r
+```
\ 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 (file)
index 0000000..22d0dc7
--- /dev/null
@@ -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 (file)
index 0000000..abd8dea
--- /dev/null
@@ -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 (file)
index 0000000..ec65f4a
--- /dev/null
@@ -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 (file)
index 0000000..f11ff00
--- /dev/null
@@ -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 (file)
index 0000000..d633069
--- /dev/null
@@ -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 (file)
index 0000000..063f2ac
--- /dev/null
@@ -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 (file)
index 0000000..81bb1a1
--- /dev/null
@@ -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 (file)
index 0000000..6e5713f
--- /dev/null
@@ -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 (file)
index 0000000..9512030
--- /dev/null
@@ -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 (file)
index 0000000..44a0f0c
--- /dev/null
@@ -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 (file)
index 0000000..9cb47bd
--- /dev/null
@@ -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