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

[WIP] Added the dashboard installer script with Keystone. Updated the Makefile to create a installer dist #676

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
30 changes: 24 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,43 @@

IMAGE = sodafoundation/dashboard
VERSION := latest
BASE_DIR := $(shell pwd)
BUILD_DIR := $(BASE_DIR)/build
DIST_DIR := $(BASE_DIR)/build/dist
BUILD_TGT := soda-dashboard-$(VERSION)


.PHONY: all build dashboard docker clean

all:build
.PHONY: all

build:dashboard
.PHONY: build
build:dist docker

dashboard:
chmod +x ./image_builder.sh \
&& ./image_builder.sh
.PHONY: dashboard

docker: dashboard
docker build . -t $(IMAGE):$(VERSION)
.PHONY: docker

clean:
sudo rm -Rf ./build
service nginx stop
sudo rm -rf /etc/nginx/sites-available/default /var/www/html/* ./dist warn=False
npm uninstall --unsafe-perm
npm uninstall --unsafe-perm -g @angular/[email protected]
.PHONY: clean

version:
@echo ${VERSION}

.PHONY: dist
dist:
rm -fr $(DIST_DIR) && mkdir -p $(DIST_DIR)/$(BUILD_TGT)/
cd $(DIST_DIR) && \
cp ../../install/install.sh $(BUILD_TGT)/ && \
cp ../../install/ministone.py $(BUILD_TGT)/ && \
cp -R ../../install/conf $(BUILD_TGT)/ && \
cp $(BASE_DIR)/LICENSE.md $(BUILD_TGT) && \
zip -r $(DIST_DIR)/$(BUILD_TGT).zip $(BUILD_TGT) && \
tar zcvf $(DIST_DIR)/$(BUILD_TGT).tar.gz $(BUILD_TGT)
tree $(DIST_DIR)
260 changes: 260 additions & 0 deletions install/conf/keystone.policy.json

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions install/conf/policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"admin_or_owner": "is_admin:True or (role:admin and is_admin_project:True) or tenant_id:%(tenant_id)s",
"default": "rule:admin_or_owner",
"admin_api": "is_admin:True or (role:admin and is_admin_project:True)",


"profile:create":"rule:admin_api",
"profile:list":"",
"profile:get":"",
"profile:update":"rule:admin_api",
"profile:delete":"rule:admin_api",
"profile:add_custom_property": "rule:admin_api",
"profile:list_custom_properties": "",
"profile:remove_custom_property": "rule:admin_api",
"volume:create": "rule:admin_or_owner",
"volume:list": "rule:admin_or_owner",
"volume:get": "rule:admin_or_owner",
"volume:update": "rule:admin_or_owner",
"volume:extend": "rule:admin_or_owner",
"volume:delete": "rule:admin_or_owner",
"volume:create_attachment": "rule:admin_or_owner",
"volume:list_attachments": "rule:admin_or_owner",
"volume:get_attachment": "rule:admin_or_owner",
"volume:update_attachment": "rule:admin_or_owner",
"volume:delete_attachment": "rule:admin_or_owner",
"snapshot:create": "rule:admin_or_owner",
"snapshot:list": "rule:admin_or_owner",
"snapshot:get": "rule:admin_or_owner",
"snapshot:update": "rule:admin_or_owner",
"snapshot:delete": "rule:admin_or_owner",
"dock:list": "rule:admin_api",
"dock:get": "rule:admin_api",
"pool:list": "rule:admin_api",
"pool:get": "rule:admin_api",
"replication:create": "rule:admin_or_owner",
"replication:list": "rule:admin_or_owner",
"replication:list_detail": "rule:admin_or_owner",
"replication:get": "rule:admin_or_owner",
"replication:update": "rule:admin_or_owner",
"replication:delete": "rule:admin_or_owner",
"replication:enable": "rule:admin_or_owner",
"replication:disable": "rule:admin_or_owner",
"replication:failover": "rule:admin_or_owner",
"volume_group:create": "rule:admin_or_owner",
"volume_group:list": "rule:admin_or_owner",
"volume_group:get": "rule:admin_or_owner",
"volume_group:update": "rule:admin_or_owner",
"volume_group:delete": "rule:admin_or_owner",
"availability_zone:list":"",
"metrics:get": "rule:admin_or_owner",
"metrics:collect": "rule:admin_or_owner",
"metrics:uploadconf": "rule:admin_api",
"metrics:downloadconf": "rule:admin_api",
"metrics:urls": "rule:admin_or_owner",
"fileshare:create": "rule:admin_or_owner",
"fileshare:delete": "rule:admin_or_owner",
"fileshare:list": "rule:admin_or_owner",
"fileshare:get": "rule:admin_or_owner",
"fileshare:update": "rule:admin_or_owner",
"fileshareacl:create": "rule:admin_or_owner",
"fileshareacl:delete": "rule:admin_or_owner",
"fileshareacl:list": "rule:admin_or_owner",
"fileshareacl:get": "rule:admin_or_owner",
"fileshareacl:update": "rule:admin_or_owner",
"host:create": "rule:admin_or_owner",
"host:delete": "rule:admin_or_owner",
"host:list": "rule:admin_or_owner",
"host:get": "rule:admin_or_owner",
"host:update": "rule:admin_or_owner"
}
6 changes: 6 additions & 0 deletions install/conf/srm-toolchain/alertmanager/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
route:
receiver: 'delfin'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why dont we keep the project specific configuration files with separate folders? Same for related files below as well.

like ....dashboard/install/conf/delfin/.......
.......conf/strato/....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done.
currently the structure is changed to

conf/
     - keystone/
         ...
     - delfin
         ... 

group_by: [severity]

receivers:
- name: 'delfin'
7 changes: 7 additions & 0 deletions install/conf/srm-toolchain/config.grafana
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
GF_USERS_DEFAULT_THEME=light
GF_AUTH_DISABLE_LOGIN_FORM=true
GF_AUTH_ANONYMOUS_ENABLED=true
GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
GF_SECURITY_ALLOW_EMBEDDING=true


56 changes: 56 additions & 0 deletions install/conf/srm-toolchain/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: '3.1'

volumes:
prometheus_data: {}
grafana_data: {}

services:
prometheus:
image: prom/prometheus: { prometheus_docker_version }
container_name: monitoring_prometheus
volumes:
- ./prometheus/:/etc/prometheus/
- prometheus_data:/prometheus
- ./prometheus/alerts.rules:/alertmanager/alerts.rules
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
ports:
- SODA_PROMETHEUS_PORT:SODA_PROMETHEUS_PORT
links:
- alertmanager:alertmanager
restart: always
deploy:
mode: global
environment:
- HOST_IP="HOST_IP"

alertmanager:
image: prom/alertmanager: { alertmanager_docker_version }
container_name: monitoring_alertmanager
ports:
- SODA_ALERTMANAGER_PORT:SODA_ALERTMANAGER_PORT
volumes:
- ./alertmanager/:/etc/alertmanager/
restart: always
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
deploy:
mode: global

grafana:
image: grafana/grafana: { grafana_docker_version }
container_name: monitoring_grafana
depends_on:
- prometheus
ports:
- SODA_GRAFANA_PORT:SODA_GRAFANA_PORT
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/dashboards:/var/lib/grafana/dashboards
- ./grafana/provisioning:/etc/grafana/provisioning
restart: always
env_file:
- config.grafana

Loading