Skip to content

Commit

Permalink
Merge pull request #34 from enolfc/clean-dashboard
Browse files Browse the repository at this point in the history
Clean up
  • Loading branch information
enolfc authored Jul 28, 2022
2 parents 8412901 + f2acc83 commit 596722b
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 278 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Check the container can be built

on:
push:
branches:
- main
pull_request:

jobs:
builder:
name: Build images
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v3
with:
push: false
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
FROM python:3.10

# Get supervisor and cron
# Do not get picky on exact cron & supervisor versions
# Get cron
# Do not get picky on exact cron version so ignore DL3008
# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install --no-install-recommends -y supervisor cron \
&& apt-get install --no-install-recommends -y cron \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /var/log/supervisor \
&& rm /etc/cron.daily/*

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

COPY cron-update-endpoints /etc/cron.d/endpoints

COPY requirements.txt /fedcloud-dashboard/requirements.txt
Expand All @@ -22,6 +19,4 @@ COPY ./dashboard /fedcloud-dashboard/dashboard

WORKDIR /fedcloud-dashboard

EXPOSE 8000

CMD ["/usr/bin/supervisord"]
CMD ["cron", "-f"]
73 changes: 40 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,46 @@
# FedCloud dashboard

Proof of concept to gather all OpenStack Horizon endpoints published in the EGI GOCDB.
A web dashboard which shows all OpenStack Horizon endpoints published in
[EGI GOCDB](https://goc.egi.eu/)

## Installation

Clone this repository:
This code relies on docker-compose to run 3 containers:

- [traefik](https://traefik.io/traefik/) to provide HTTP proxy and cert
management
- [dashy](https://dashy.to/) for generating the dashboard
- some python code to generate the list of endpoints

The existing docker-compose file assumes you will run the code on a publicly
accessible host with a valid name. You can create a `.env` file with the
`DASHBOARD_HOSTNAME` variable defined with the hostname of your server and just
start the service:

```shell
cd /path/to/working/directory
git clone https://github.com/EGI-Federation/fedcloud-dashboard.git
echo "DASHBOARD_HOSTNAME="<your host name>"
docker-compose up --build
```
This will build the container that generates the list of endpoints and start all
the process to make the dashboard available.
## Running locally
If you don't have a publicly accessible host, the easiest is to manually run
dashy and the code to generate the list of endpoints:
First clone the repository:
```shell
cd /path/to/working/directory
git clone https://github.com/EGI-Federation/fedcloud-dashboard.git
```
Create a conda environment with requirements:
```shell
# Download and install conda
cd /path/to/conda/install/folder
Expand All @@ -24,44 +54,21 @@ conda env create -f environment.yml
conda activate horizon-aggregator
```
## Preview
Test whether the query script works:
```shell
cd /path/to/working/directory/fedcloud-dashboard/dashboard/
python find_endpoints.py
```
Test whether the flask app works:
```shell
cd /path/to/working/directory/fedcloud-dashboard/dashboard/
export FLASK_APP=main
flask run --host=0.0.0.0
```

## Use docker

First things first: make sure port 8000 is open on the target system!

### Build image

Here are the steps:
```shell
git clone https://github.com/EGI-Federation/fedcloud-dashboard.git
cd fedcloud-dashboard
sudo docker build --no-cache -t dashboard:1.0.0 .
python dashy_endpoints.py > conf.yml
```
### Run container
Use the generated `conf.yml` with dashy:
Here are the steps:
```shell
git clone https://github.com/EGI-Federation/fedcloud-dashboard.git
cd fedcloud-dashboard/dashboard
sudo docker run \
--name dashboard \
--detach \
--publish 8000:8000 \
dashboard:1.0.0
cd /path/to/working/directory/fedcloud-dashboard/dashboard/
docker run \
-p 8080:80 \
-v $PWD/conf.yml:/app/public/conf.yml \
lissy93/dashy:latest
```
The app should now return the list OpenStack Horizon endpoints published in the EGI GOCDB.
And point your browser to `http://localhost:8080` to see your dashboard running
85 changes: 0 additions & 85 deletions dashboard/find_endpoints.py

This file was deleted.

4 changes: 0 additions & 4 deletions dashboard/horizonaggregator.wsgi

This file was deleted.

19 changes: 0 additions & 19 deletions dashboard/main.py

This file was deleted.

12 changes: 0 additions & 12 deletions dashboard/static/css/style.css

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed dashboard/static/images/egi.png
Binary file not shown.
34 changes: 0 additions & 34 deletions dashboard/templates/dashboard.html

This file was deleted.

70 changes: 0 additions & 70 deletions dashboard/update_endpoints.py

This file was deleted.

2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ dependencies:
- python 3.10.*
- defusedxml
- requests
- flask
- pyyaml
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
gunicorn
flask
requests
defusedxml
pyyaml
Loading

0 comments on commit 596722b

Please sign in to comment.