Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
7f52839877
|
@@ -4,15 +4,15 @@ steps:
|
||||
settings:
|
||||
repo: ${FORGE_NAME}/${CI_REPO}
|
||||
registry:
|
||||
from_secret: container_registry
|
||||
tags: latest,${CI_COMMIT_SHA},${CI_COMMIT_TAG}
|
||||
from_secret: local_registry
|
||||
tags: latest,${CI_COMMIT_TAG}
|
||||
username:
|
||||
from_secret: container_registry_username
|
||||
from_secret: local_username
|
||||
password:
|
||||
from_secret: container_registry_password
|
||||
from_secret: local_password
|
||||
dockerfile: Dockerfile
|
||||
when:
|
||||
- event: [push, tag]
|
||||
- event: tag
|
||||
|
||||
scan:
|
||||
image: quay.io/wollud1969/woodpecker-helper:0.5.1
|
||||
@@ -27,7 +27,7 @@ steps:
|
||||
from_secret: dtrack_api_url
|
||||
commands:
|
||||
- HOME=/home/`id -nu`
|
||||
- TAG="${CI_COMMIT_TAG:-$CI_COMMIT_SHA}"
|
||||
- TAG="${CI_COMMIT_TAG}"
|
||||
- |
|
||||
trivy image \
|
||||
--server $TRIVY_URL \
|
||||
@@ -50,7 +50,7 @@ steps:
|
||||
- event: [push, tag]
|
||||
|
||||
deploy:
|
||||
image: quay.io/wollud1969/k8s-admin-helper:0.2.1
|
||||
image: quay.io/wollud1969/k8s-admin-helper:0.4.1
|
||||
environment:
|
||||
KUBE_CONFIG_CONTENT:
|
||||
from_secret: kube_config
|
||||
|
||||
@@ -12,7 +12,7 @@ from app import app
|
||||
from app import oidc
|
||||
|
||||
|
||||
@app.route('/pvstats')
|
||||
@app.route('/')
|
||||
@oidc.require_login
|
||||
def pvstats():
|
||||
try:
|
||||
@@ -43,43 +43,6 @@ def pvstats():
|
||||
)
|
||||
graph_html_1 = fig_1.to_html(full_html=False, default_height='30%')
|
||||
|
||||
step3_time = time.time()
|
||||
df = pd.read_sql("SELECT time_bucket('5 minutes', time) AS bucket, AVG(power) AS avg_power FROM pv_power_v WHERE time >= date_trunc('day', now()) - '1 day'::interval AND time < date_trunc('day', now()) GROUP BY bucket ORDER BY bucket", con=engine)
|
||||
step4_time = time.time()
|
||||
duration3 = step4_time - step3_time
|
||||
logger.info(f"{duration3=}")
|
||||
fig_2 = px.line(df, x='bucket', y='avg_power')
|
||||
step5_time = time.time()
|
||||
duration4 = step5_time - step4_time
|
||||
logger.info(f"{duration4=}")
|
||||
fig_2.update_layout(
|
||||
xaxis_title="",
|
||||
yaxis_title="",
|
||||
title=f"Export gestern {duration3:.3f}, {duration4:.3f}",
|
||||
yaxis=dict(ticksuffix=" W")
|
||||
)
|
||||
graph_html_2 = fig_2.to_html(full_html=False, default_height='30%')
|
||||
|
||||
step6_time = time.time()
|
||||
df = pd.read_sql("SELECT time_bucket('5 minutes', time) AS bucket, AVG(power) AS avg_power FROM pv_power_v WHERE time >= date_trunc('day', now()) AND time < date_trunc('day', now()) + '1 day'::interval GROUP BY bucket ORDER BY bucket", con=engine)
|
||||
step7_time = time.time()
|
||||
duration5 = step7_time - step6_time
|
||||
logger.info(f"{duration5=}")
|
||||
fig_3 = px.line(df, x='bucket', y='avg_power')
|
||||
step8_time = time.time()
|
||||
duration6 = step8_time - step7_time
|
||||
logger.info(f"{duration6=}")
|
||||
fig_3.update_layout(
|
||||
xaxis_title="",
|
||||
yaxis_title="",
|
||||
title=f"Export heute {duration5:.3f}, {duration6:.3f}",
|
||||
yaxis=dict(ticksuffix=" W")
|
||||
)
|
||||
graph_html_3 = fig_3.to_html(full_html=False, default_height='30%')
|
||||
stepZ_time = time.time()
|
||||
duration7 = stepZ_time - stepX_time
|
||||
logger.info(f"{duration7=}")
|
||||
|
||||
return render_template_string(f"""
|
||||
<html>
|
||||
<head>
|
||||
@@ -87,25 +50,6 @@ def pvstats():
|
||||
</head>
|
||||
<body>
|
||||
{graph_html_1}
|
||||
{graph_html_2}
|
||||
{graph_html_3}
|
||||
<div style="height:9vh; background-color:lightgrey; font-family: Courier, Consolas, monospace;">
|
||||
<table style="border-collapse: collapse;">
|
||||
<style>
|
||||
td.smallsep {{ padding-right: 10px }}
|
||||
td.largesep {{ padding-right: 30px }}
|
||||
</style>
|
||||
<tr>
|
||||
<td class="smallsep">Query 1:</td><td class="largesep"> {duration1:.3f} s</td><td class="smallsep">Graph 1:</td><td> {duration2:.3f} s</td>
|
||||
</tr><tr>
|
||||
<td class="smallsep">Query 2:</td><td class="largesep"> {duration3:.3f} s</td><td class="smallsep">Graph 2:</td><td> {duration4:.3f} s</td>
|
||||
</tr><tr>
|
||||
<td class="smallsep">Query 3:</td><td class="largesep"> {duration5:.3f} s</td><td class="smallsep">Graph 3:</td><td> {duration6:.3f} s</td>
|
||||
</tr><tr>
|
||||
<td class="smallsep">Total:</td><td> {duration7:.3f} s</td><td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
""")
|
||||
|
||||
@@ -5,10 +5,6 @@ from app import app
|
||||
from app import oidc
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
abort(404)
|
||||
|
||||
@app.route('/generate_image')
|
||||
def generate_image():
|
||||
img = Image.new('RGB', (200, 100), color=(255, 255, 255))
|
||||
|
||||
Reference in New Issue
Block a user