Skip to content

Commit

Permalink
Merge pull request #43 from NexClipper/dev
Browse files Browse the repository at this point in the history
update for version 3 from Dev branch
  • Loading branch information
ralfyang authored Apr 6, 2021
2 parents 3715d54 + 6cf86b7 commit 44e59f0
Show file tree
Hide file tree
Showing 77 changed files with 3,386 additions and 363,965 deletions.
3 changes: 0 additions & 3 deletions .env

This file was deleted.

9 changes: 9 additions & 0 deletions .env.SAMPLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
REACT_APP_API_URL="http://192.168.1.1"
REACT_APP_API_STATUS="y"

SERVICE_URL="http://192.168.1.1"
CLIENT_ID="90oasnkljfh021nksd"
CLIENT_SECRETS="9j0oaosdlfjlsklkkkkkk"
ORGANIZATION="Exporterhubv3"
SECRET_KEY="asdfasdfa"
ALGORITHM="HS256"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ db_data
.vscode
.env

my_settings.py
Miniconda3-latest-Linux-x86_64.sh
my_settings.py
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM node:12.18.3

## It is just Label when it has build automation.
LABEL version=0.2.3
LABEL version=release-fe0.3.2

## OS command for create a directory
RUN mkdir /data
Expand All @@ -16,6 +16,9 @@ COPY ./src /data/src
COPY ./public /data/public
COPY ./entrypoint.sh /data
COPY ./dotenv /data/.env
COPY ./.eslintrc.json /data
COPY ./.prettierrc.json /data


## Build of node runs
RUN npm i -s dotenv
Expand Down
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
docker_version="latest"
front_tag="release-fe0.3.3"
api_tag="release-api0.2.9"


hello:
#
# You can use - build / run / push / all
#
build:
sudo docker build -t nexclipper/exporterhub:${front_tag} ./ --no-cache
sudo docker tag nexclipper/exporterhub:${front_tag} nexclipper/exporterhub:${docker_version}
cd api && sudo docker build -t nexclipper/exporterhub-api:${api_tag} ./ --no-cache && cd ..
sudo docker tag nexclipper/exporterhub-api:${api_tag} nexclipper/exporterhub-api:${docker_version}
run:
sudo docker-compose up
login:
sudo docker login
push: login build
sudo docker push nexclipper/exporterhub:${front_tag}
sudo docker push nexclipper/exporterhub:${docker_version}
sudo docker push nexclipper/exporterhub-api:${api_tag}
sudo docker push nexclipper/exporterhub-api:${docker_version}

start:
sudo docker-compose down
sudo docker-compose -f ../docker-compose.yml up -d
all: build push run
362,741 changes: 0 additions & 362,741 deletions Miniconda3-latest-Linux-x86_64.sh

This file was deleted.

76 changes: 65 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,45 @@
# [Exporterhub.io](https://exporterhub.io/) [![Awesome](https://awesome.re/badge.svg)](https://awesome.re)
<!--lint disable awesome-badge-->
<!--lint disable awesome-heading-->
> ### A Curated List of Prometheus Exporters
> ### A Curated List of Prometheus Exporters
> #### Powered by <a href="https://nexclipper.io"><img src="https://raw.githubusercontent.com/NexClipper/exporterhub.io/master/assets/NexCloud_en.png" width= 120></a>
> Come and join us!: https://app.slack.com/client/TC3DP3HPG/C01RTA59G66



![exporterhub](https://raw.githubusercontent.com/NexClipper/exporterhub.io/master/assets/ExporterHub_Logo_H.png)
<!--lint disable awesome-github-->
<!--lint disable awesome-toc-->
## Contents
* [What is ExporterHub.io](https://github.com/NexClipper/exporterhub.io#what-is-exporterhubio)
* [Definition of ExporterHub.io](https://github.com/NexClipper/exporterhub.io#Definition-of-exporterhubio)
* [Roadmap](https://github.com/NexClipper/exporterhub.io#roadmap)
* [See Demo](https://github.com/NexClipper/exporterhub.io#Demo)
* [Diagram Overview](https://github.com/NexClipper/exporterhub.io#diagram-overview)
* [Kickstart](https://github.com/NexClipper/exporterhub.io#kickstart)
* [Contribute](https://github.com/NexClipper/exporterhub.io#contribute)
* [References](https://github.com/NexClipper/exporterhub.io#references)
* [License](https://github.com/NexClipper/exporterhub.io#license)

## See Demo
* Image click to Youtube:
[![Demo](https://raw.githubusercontent.com/NexClipper/exporterhub.io/master/assets/demo_01.png)](https://youtu.be/wa4dknZk7Kk)

## What is [ExporterHub.io](https://exporterhub.io/)
![landingpage](https://raw.githubusercontent.com/NexClipper/exporterhub.io/master/assets/screen_02.png)

### ExporterHub.io is a front-end(React) & API(python) application for the Prometheus Exporters community
## Definition of [ExporterHub.io](https://exporterhub.io/)
![](https://images.velog.io/images/dvkim202550/post/795be79c-80c6-4b62-96ff-17247885b00c/image.png)

### ExporterHub.io is an application for the Prometheus Exporters community.
ExporterHub.io is not just a curated list, but also provides exporter installation guide, alert rule configuration, and dashboard configuration.
Each exporter's page contains the followings:
* Official GitHub (Origin Repository)
* Resource (Install, Exported Metrics)
* Alert-rule (Recommended)
* Dashboard (Grafana)
* Star (linked to Github Origin Repository)
* Bucket (able to manage personal Github Repository as well)
* Edit Dashboard and Alert-rule by Admin

## See Demo
* Image click to Youtube for the full examples and guides:
[![Demo](https://raw.githubusercontent.com/NexClipper/exporterhub.io/master/assets/demo_01.png)](https://youtu.be/wa4dknZk7Kk)

## Roadmap
To help and ease you with best-practice Prometheus, ExporterHub.io discovers and recommends the best-fit exporter(s) available to expose metrics data from your specific systems and services being monitored.
Expand All @@ -48,29 +55,75 @@ ExporterHub.io recommends the best-fit exporter(s) to support Prometheus monitor
<!--lint disable no-undefined-references-->
* [x] Installation Guide, Metric Collection Flags, Recommended Alert-rule
* [x] Card Style GitHub Page
* [x] Admin Authorizaion
* [x] Register exporters, edit Dashboard and Alert by Admin
* [x] Easy search of Exporters
* [x] Personalization (Add, Delete)
* [ ] NexClipper Cloud Integration (coming soon)
* [ ] Install exporters automatically
* [ ] Generate Alert Rules
* [ ] Recommend best-fit exporter(s)


## Diagram Overview
<!--lint disable awesome-list-item-->
* Image click to Youtube:
* [![Diagram Overview](https://img.youtube.com/vi/pPZfNi6qms4/0.jpg)](https://youtu.be/pPZfNi6qms4)

## Kickstart
### Ready: Token Requires for GitHub infomation crawling
### Ready: Token is required for GitHub infomation crawling
<!--lint disable awesome-list-item-->
* ___Create Token 1st before the App runs as below.___
* ___Create Token before the App runs as below.___
* https://github.com/settings/tokens/new
![Token Generator](https://raw.githubusercontent.com/NexClipper/exporterhub.io/master/assets/create_a_token_first_N.png)

### ※ Github env settings below must be done under _<u>organization account settings</u>_, not in personal.

### 1. Create organization
* ___This must be done before authorizing and managing admins.___
* ___Github link:___
* https://github.com/settings/organizations
![](https://images.velog.io/images/dvkim202550/post/6b5b5bfd-b757-4c8e-89af-f06dcfc0df4c/image.png)

### 2. `Fork` NexClipper/exporterhub.io to organization, not to personal account.
![](https://images.velog.io/images/dvkim202550/post/836ab379-2d34-4669-b884-fd912709d460/image.png)

### 3. Create and register an OAuth app under your organization.
* ___1) Click developer settings tab of organization. While you create OAuth Apps, please take note of redirect url of authentication.___

![](https://images.velog.io/images/dvkim202550/post/a81cec66-cfba-424e-bc07-c54052deb22b/image.png)
![](https://images.velog.io/images/dvkim202550/post/c49ff46d-39de-4ed5-8d66-9a8b6aeb5544/image.png)

* ___2) Client ID, Client Secrets, and callback url(Service URL) are required for authentication.___



![](https://images.velog.io/images/dvkim202550/post/168d8232-2951-4a77-ab8f-881fdb85b457/image.png)


### 4. Write docker-compose.yml accordingly.
* ___"NEED_TO_SET_UP" parts are to be revised in ```./.env```file: ___
```yml
REACT_APP_API_URL="NEED_TO_SET_UP"
REACT_APP_API_STATUS="y"

CLIENT_ID="NEED_TO_SET_UP"
CLIENT_SECRETS="NEED_TO_SET_UP"
SECRET_KEY="NEED_TO_SET_UP"
ALGORITHM="NEED_TO_SET_UP"
ORGANIZATION="NEED_TO_SET_UP"
```
* ___"NEED_TO_SET_UP" parts are to be linked to docker-compose.yml as below: ___
<img src="https://images.velog.io/images/dvkim202550/post/1033e78b-1800-4a01-9614-e24cc569b64f/image.png" width="300">





### Run by default(in localhost)
* Run the docker-compose as below
```
docker-compose up -d
docker-compose up -d
```

### Or, Run for external network
Expand Down Expand Up @@ -116,6 +169,7 @@ services:
* [SLOs with Prometheus](https://promtools.dev/)
* [Awesome Prometheus](https://github.com/roaldnefs/awesome-prometheus)
* [Promcat](https://promcat.io/)
* [Github Documentation](https://docs.github.com/en)

## Contribute
Contributions are welcome!
Expand Down
13 changes: 7 additions & 6 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM python:3.8

## It is just Label when it has build automation.
LABEL version=0.1
LABEL version=release-api0.2.9

RUN apt-get update && apt-get install -y --no-install-recommends \
netcat \
Expand All @@ -17,15 +17,19 @@ WORKDIR /data
## File & Directory copy to WORKDIR
COPY requirements.txt /data/
COPY manage.py /data/
COPY exporterhub_schema.sql /data/
#COPY exporterhub_schema.sql /data/
COPY entrypoint.sh /data/
COPY my_settings.py /data/
#COPY my_settings.py /data/

## Initializing for run
RUN pip install -r requirements.txt

COPY exporterhub /data/exporterhub
COPY hub /data/hub
COPY exporter /data/exporter
COPY user /data/user
COPY headtoken /data/headtoken
COPY exporter_list.csv /data

## For test run
##ENTRYPOINT ["tail","-f","/data/package.json"]
Expand All @@ -42,6 +46,3 @@ EXPOSE 8000
## ENTRYPOINT will be runs at the end of container attached
ENTRYPOINT /data/entrypoint.sh




Empty file removed api/db.sqlite
Empty file.
5 changes: 3 additions & 2 deletions api/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ case $parm in
server)
Check_db
python manage.py migrate
cp -fv ./exporterhub/urls_back.py ./exporterhub/urls.py
echo "Modify the file: ./exporterhub/urls_back.py -> ./exporterhub/urls.py"
#cp -fv ./exporterhub/urls_back.py ./exporterhub/urls.py
#echo "Modify the file: ./exporterhub/urls_back.py -> ./exporterhub/urls.py"
python manage.py runserver 0.0.0.0:$port
python ./db_uploader.py
;;
scheduler)
Check_api
Expand Down
18 changes: 18 additions & 0 deletions api/exporter/migrations/0003_exporter_view_count.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.6 on 2021-03-29 11:46

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('exporter', '0002_exporter_app_name'),
]

operations = [
migrations.AddField(
model_name='exporter',
name='view_count',
field=models.PositiveIntegerField(default=0),
),
]
18 changes: 18 additions & 0 deletions api/exporter/migrations/0004_auto_20210329_2329.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.3 on 2021-03-29 14:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('exporter', '0003_exporter_view_count'),
]

operations = [
migrations.AlterField(
model_name='exporter',
name='description',
field=models.TextField(null=True),
),
]
5 changes: 3 additions & 2 deletions api/exporter/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ class Exporter(models.Model):
logo_url = models.URLField(max_length=2000)
stars = models.IntegerField()
repository_url = models.URLField(max_length=2000)
description = models.TextField()
description = models.TextField(null=True)
readme_url = models.URLField(max_length=2000)
readme = models.BinaryField()
comment = models.TextField(null=True)
view_count = models.PositiveIntegerField(default=0)
created_at = models.DateTimeField(auto_now_add=True)
modified_at = models.DateTimeField(auto_now=True)

Expand All @@ -48,4 +49,4 @@ class Log(models.Model):
created_at = models.DateTimeField(auto_now_add=True)

class Meta:
db_table = 'logs'
db_table = 'logs'
5 changes: 3 additions & 2 deletions api/exporter/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django.urls import path
from .views import CategoryView, ExporterView, ExporterDetailView
from .views import CategoryView, ExporterView, ExporterDetailView, ExporterTabView

urlpatterns = [
path('/categories', CategoryView.as_view()),
path('', ExporterView.as_view()),
path('/<int:exporter_id>', ExporterDetailView.as_view()),
]
path('/<int:exporter_id>/tab', ExporterTabView.as_view()),
]
Loading

0 comments on commit 44e59f0

Please sign in to comment.