Skip to content

Commit

Permalink
Community website 0.1.GH Action
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Gutierrez committed Oct 16, 2024
1 parent 2e8b771 commit 5185a38
Show file tree
Hide file tree
Showing 109 changed files with 12,370 additions and 96 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/deploy_pages.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Build and Deploy


on:
push:
branches:
Expand All @@ -19,10 +18,13 @@ jobs:
node-version: "20"
cache: yarn
cache-dependency-path: website/yarn.lock

- name: Update events
run: |
echo "Updating"
make generate_event_json
- name: Install and Build 🔧
env:
PUBLIC_URL: https://kiali.github.io/community/
PUBLIC_URL: https://kiali.org/community/
run: make build

- name: Deploy 🚀
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Pull Metrics

on:
schedule:
# Every night at 04:00 (UTC)
- cron: "0 4 * * *"

jobs:
build:
runs-on: ubuntu-latest
env:
KIALI_API_TOKEN: '${{ secrets.KIALI_API_TOKEN }}'
steps:
- name: checkout repo content
uses: actions/checkout@v4 # checkout the repository content

- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10' # install the python version needed

- name: install python packages
run: |
python -m pip install --upgrade pip
pip install -r scripts/api_gh/requirements.txt
- name: execute py script # run main.py
run: make generate_metrics_json
- name: Configure git
run: |
git config user.email '[email protected]'
git config user.name 'kiali-bot'
- name: Update metrics file
run: |
if [[ `git status --porcelain` ]]; then
echo -e "\e[1;32mOK\e[0m \e[1;39mMetrics json change detected.\e[0m"
git add website/src/data/metrics.json
git commit -m "Update metrics.json"
git push origin
else
echo -e "\e[1;39mNo changes were detected.\e[0m"
fi
shell: bash
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ SHELL=/bin/bash
ROOTDIR=$(CURDIR)

build:
@cd ${ROOTDIR}/website && yarn install --frozen-lockfile && yarn run build
@cd ${ROOTDIR}/website && yarn install --frozen-lockfile && yarn run build

generate_event_json:
python scripts/create_event_json.py

generate_metrics_json:
python scripts/api_gh/pull_api_data.py
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Community

Repo with talks and workshops
This repo contains the Kiali community side !

To explore more about Kiali community visit the website [https://kiali.org/community/](https://kiali.org/community/)

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"date": "2024-06-21",
"place": "Brno, Czech Republic",
"eventName": "DevConf",
"description": "Microservices architecture has become a cornerstone in modern application development, offering scalability, agility, and flexibility. However, managing the complexity of microservices can be challenging, and that's where Kiali comes into play. In this talk, we'll explore the powerful capabilities of Kiali as an observability and management platform for Kubernetes applications.Microservices introduce a new set of challenges in terms of monitoring, tracing, and understanding the interactions between services. Kiali, an open-source project, simplifies these complexities by providing a visual representation of the microservices topology, along with advanced monitoring and troubleshooting features",
"talkName": "Kiali Beyond the Graph – Troubleshooting Istio",
"lang": "EN",
"type": "talk",
"presentation": {
"type" : "youtube",
"link": "https://www.youtube.com/embed/aM6fslVXbZc?si=BbvRinEiPQWfXU0S"
},
"folder_path": "https://www.youtube.com/watch?v=aM6fslVXbZc"
}
14 changes: 14 additions & 0 deletions events/2024_10_Setup_your_mesh_ES/event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"date": "2024-10-26",
"place": "Malaga, Spain",
"eventName": "BiznagaFest",
"talkName": "Setup your mesh with Istio and Kiali",
"description": "En este taller los asistentes aprenderan a configurar Istio con Kiali y a como convivir con este entorno, aprenderan que les aporta y los beneficios que se obtienen a nivel de seguridad y observabilidad.",
"lang": "ES",
"type": "workshop",
"presentation": {
"type" : "markdown",
"link": "https://raw.githubusercontent.com/kiali/community/refs/heads/main/2024_10_Setup_your_mesh_ES/Setup%20your%20mesh%20with%20Istio%20and%20Kiali.md"
},
"folder_path": "https://github.com/kiali/community/tree/main/2024_10_Setup_your_mesh_ES"
}
59 changes: 59 additions & 0 deletions scripts/api_gh/pull_api_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import os
import json
from github import Github

# Authentication is defined via github.Auth
from github import Auth

REPOS = ["kiali", "kiali-operator", "openshift-servicemesh-plugin"]


class KialiApi:
def __init__(self):
TOKEN = os.getenv('KIALI_API_TOKEN')
auth = Auth.Token(TOKEN)
self.client = Github(auth=auth)
self.organization = "kiali"
with open('./website/src/data/metrics.json') as f:
self.data = json.load(f)
def generate(self):
self.getRepositories()
self.write_json()
def getRepositories(self):
org = self.client.get_organization("kiali")
for repoName in REPOS:
repo = org.get_repo(repoName)
if "repositories" not in self.data:
self.data["repositories"] = {}
if repoName not in self.data["repositories"]:
self.generate_initial_data(repoName)
self.data["repositories"][repoName]["language"] = repo.get_languages()
keyDate = repo.updated_at.strftime("%Y-%m-%d")


if keyDate not in self.data["repositories"][repoName]["metrics"]:
self.data["repositories"][repoName]["metrics"][keyDate] = {
"forks": repo.forks_count,
"issues": repo.open_issues_count,
"stars": repo.stargazers_count,
"size": repo.size
}
def generate_initial_data(self, repoName):
repo = self.client.get_organization("kiali").get_repo(repoName)
self.data["repositories"][repoName] = {
"license": repo.get_license().license.name,
"description": repo.description,
"url": repo.html_url,
"created": repo.created_at.strftime("%Y-%m-%d"),
"topics": repo.topics,
"metrics": {}
}
def write_json(self):
with open('./website/src/data/metrics.json', 'w') as f:
json.dump(self.data, f, indent=4)
def __exit__(self):
if not self.client.closed:
self.client.close()

client = KialiApi()
client.generate()
1 change: 1 addition & 0 deletions scripts/api_gh/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PyGithub==2.4.0
17 changes: 17 additions & 0 deletions scripts/create_event_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import json
import hashlib
from pathlib import Path
p = Path('./events')
json_output = [
]
m = hashlib.md5()
for json_file in p.glob('**/event.json'):
with open(json_file) as input_file:
data = json.load(input_file)
data["path"] = "events/" + json_file.parent.name
m.update((data["date"] + "_" + data["eventName"] + data["talkName"]).encode('utf-8'))
data["id"] = str(int(m.hexdigest(), 16))[0:12]
json_output.append(data)

with open('./website/src/data/events.json', 'w') as f:
json.dump(json_output, f, indent=4)
9 changes: 9 additions & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@fortawesome/fontawesome-free": "5.15.2",
"@mui/material": "^6.1.4",
"@mui/styled-engine-sc": "^6.1.4",
"@mui/x-charts": "^7.20.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand All @@ -14,7 +20,10 @@
"react": "^18.3.1",
"react-bootstrap": "^2.10.5",
"react-dom": "^18.3.1",
"react-markdown": "^9.0.1",
"react-router-dom": "^6.27.0",
"react-scripts": "5.0.1",
"styled-components": "^6.1.13",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
},
Expand Down
2 changes: 1 addition & 1 deletion website/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Kiali Community</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
38 changes: 0 additions & 38 deletions website/src/App.css

This file was deleted.

9 changes: 0 additions & 9 deletions website/src/App.test.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions website/src/App.tsx

This file was deleted.

6 changes: 6 additions & 0 deletions website/src/assets/css/animate.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit 5185a38

Please sign in to comment.