Skip to content

Commit

Permalink
Merge pull request #569 from anvithks/delfin-ui
Browse files Browse the repository at this point in the history
Added Delfin UI installer and clean up
  • Loading branch information
sushanthakumar authored Jul 10, 2023
2 parents bebdf88 + 88f5121 commit e578d3e
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 0 deletions.
1 change: 1 addition & 0 deletions ansible/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- group_vars/orchestration.yml
- group_vars/delfin.yml
- group_vars/srm-toolchain.yml
- group_vars/delfin-ui.yml
gather_facts: false
become: True
tasks:
Expand Down
40 changes: 40 additions & 0 deletions ansible/group_vars/delfin-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2023 The SODA Authors.
#
# 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.

---
# Dummy variable to avoid error because ansible does not recognize the
# file as a good configuration file when no variable in it.
dummy:


###########
# GENERAL #
###########

enable_delfin_ui: false

delfin_ui_port: 9001

delfin_ui_release_version: v1.7.1

#Dashboard Console Login Address
delfin_ui_login_url: "{{ host_ip }}:{{ delfin_ui_port }}"

##########
# DOCKER #
##########

delfin_ui_docker_image: sodafoundation/delfin-ui:{{ delfin_ui_release_version }}


33 changes: 33 additions & 0 deletions ansible/roles/cleaner/scenarios/delfin-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2022 The SODA Authors.
#
# 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: stop container where Delfin UI is located
docker_container:
name: delfin-ui
image: "{{ delfin_ui_docker_image }}"
state: absent
ignore_errors: true
tags: delfin_ui

- name: Remove Delfin UI docker image
docker_image:
state: absent
name: sodafoundation/delfin-ui
tag: "{{ delfin_ui_release_version }}"
when:
- enable_delfin_ui == true
- source_purge == true
tags: delfin_ui
5 changes: 5 additions & 0 deletions ansible/roles/cleaner/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
when: enable_dashboard == true
tags: dashboard

- name: Uninstall and cleanup Delfin UI
include_tasks: scenarios/delfin-ui.yml
when: enable_delfin_ui == true
tags: delfin_ui

- name: Uninstall and cleanup Hotpot
include_tasks: scenarios/hotpot.yml
when: enable_hotpot == true
Expand Down
33 changes: 33 additions & 0 deletions ansible/roles/delfin-ui-installer/scenarios/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2018 The OpenSDS Authors.
#
# 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: install docker-py package with pip when enabling containerized deployment
pip:
name: docker-py

- name: run Delfin UI containerized service
docker_container:
name: delfin-ui
image: "{{ delfin_ui_docker_image }}"
state: started
network_mode: host
restart_policy: always
env:
SODA_HOST_IP: "{{ host_ip }}"
SODA_DELFIN_URL: "{{ soda_delfin_url }}"
SODA_PROMETHEUS_PORT: "{{ prometheus_port | quote }}"
SODA_ALERTMANAGER_PORT: "{{ alertmanager_port | quote }}"
SODA_ALERTMANAGER_URL: "http://{{ host_ip }}:{{ alertmanager_port }}"
SODA_GRAFANA_PORT: "{{ grafana_port | quote }}"
24 changes: 24 additions & 0 deletions ansible/roles/delfin-ui-installer/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2023 The SODA Authors.
#
# 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: use container to install Delfin UI
include_tasks: scenarios/container.yml
when:
- enable_delfin_ui == true

- name: Delfin UI console
debug: msg="please use '{{ delfin_ui_login_url }}' console"
when:
- enable_delfin_ui == true
16 changes: 16 additions & 0 deletions ansible/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,22 @@
- enable_dashboard == true
tags: dashboard

- name: Deploy Delfin UI
hosts: controllers
remote_user: root
vars_files:
- group_vars/common.yml
- group_vars/srm-toolchain.yml
- group_vars/delfin-ui.yml
gather_facts: false
become: True
tasks:
- include_role:
name: delfin-ui-installer
when:
- enable_delfin_ui == true
tags: delfin_ui

- name: deploy tools for telemetry
hosts: controllers
remote_user: root
Expand Down

0 comments on commit e578d3e

Please sign in to comment.