-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧑💻(project:nex·rpi): Configure Tilt to quickly iterate on Glance con…
…figuration Signed-off-by: Alexandre Nicolaie <xunleii@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
280 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Welcome to nr-dashboard Tilt! | ||
# This Tiltfile is used to play with the Glance (the application | ||
# that powers the nr-dashboard) and configure it as quickly as | ||
# possible. | ||
print(""" | ||
----------------------------------------------------------------- | ||
Welcome to nex·rpi Tilt! | ||
This Tiltfile is used to play with the nex·rpi project and | ||
configure it in a easy way. | ||
It uses Kustomize to manage Kubernetes resources through the | ||
`apps/*/live/dev` configurations. | ||
----------------------------------------------------------------- | ||
""".strip()) | ||
|
||
# Deploy Kubernetes resources using Kustomize | ||
# nex·rpi uses Kustomize to manage Kubernetes resources through the | ||
# `apps/*/live/dev` configurations. | ||
# | ||
# In order to avoid deploying the whole project, Tilt will only | ||
# deploy what the end-user is working on. | ||
load('ext://uibutton', 'cmd_button') | ||
|
||
# `nr-dashboard` namespace | ||
def nr_dashboard(): | ||
app_dir = '{tiltfile_dir}/apps/nr-dashboard'.format(tiltfile_dir=config.main_dir) | ||
|
||
nr_dashboard_yaml = kustomize('{app_dir}/live/dev'.format(app_dir=app_dir)) | ||
nr_glance_configmaps = ['{}:configmap'.format(r["metadata"]["name"]) for r in decode_yaml_stream(nr_dashboard_yaml) if r["kind"] == "ConfigMap" and r["metadata"]["name"].startswith("glance-configuration")] | ||
if len(nr_glance_configmaps) == 0: | ||
fail('⚠️ No glance configuration found. Please make sure to create one in the `configurations/glance.yaml` file.') | ||
|
||
watch_file('{app_dir}/live/dev'.format(app_dir=app_dir)) | ||
k8s_yaml(nr_dashboard_yaml) | ||
k8s_resource('glance', | ||
port_forwards=[8080], | ||
auto_init=False, | ||
objects=nr_glance_configmaps, | ||
trigger_mode=TRIGGER_MODE_MANUAL) | ||
|
||
# Customise Tilt UI to syncronize Glance development configuration to the | ||
# production one | ||
cmd_button('sync_configuration', | ||
argv=[ | ||
'cp', | ||
'{app_dir}/live/dev/configurations/glance.yaml'.format(app_dir=app_dir), | ||
'{app_dir}/live/production/configurations/glance.yaml'.format(app_dir=app_dir) | ||
], | ||
icon_name='sync_alt', | ||
resource='glance', | ||
text='Sync configuration to production', | ||
) | ||
nr_dashboard() |
191 changes: 191 additions & 0 deletions
191
projects/nex.rpi/src/apps/nr-dashboard/live/dev/configurations/glance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
--- | ||
pages: | ||
- name: Startpage | ||
width: slim | ||
hide-desktop-navigation: true | ||
center-vertically: true | ||
columns: | ||
- size: full | ||
widgets: | ||
- type: search | ||
autofocus: true | ||
bangs: | ||
- title: Google | ||
shortcut: "!g" | ||
url: https://www.google.com/search?q=%s | ||
|
||
|
||
- type: monitor | ||
cache: 1m | ||
title: Services | ||
sites: | ||
- title: Jellyfin | ||
url: https://yourdomain.com/ | ||
icon: si:jellyfin | ||
- title: Gitea | ||
url: https://yourdomain.com/ | ||
icon: si:gitea | ||
- title: qBittorrent # only for Linux ISOs, of course | ||
url: https://yourdomain.com/ | ||
icon: si:qbittorrent | ||
- title: Immich | ||
url: https://yourdomain.com/ | ||
icon: si:immich | ||
- title: AdGuard Home | ||
url: https://yourdomain.com/ | ||
icon: si:adguard | ||
- title: Vaultwarden | ||
url: https://yourdomain.com/ | ||
icon: si:vaultwarden | ||
|
||
- type: bookmarks | ||
groups: | ||
- title: General | ||
links: | ||
- title: Gmail | ||
url: https://mail.google.com/mail/u/0/ | ||
- title: Amazon | ||
url: https://www.amazon.com/ | ||
- title: Github | ||
url: https://github.com/ | ||
- title: Entertainment | ||
links: | ||
- title: YouTube | ||
url: https://www.youtube.com/ | ||
- title: Prime Video | ||
url: https://www.primevideo.com/ | ||
- title: Disney+ | ||
url: https://www.disneyplus.com/ | ||
- title: Social | ||
links: | ||
- title: Reddit | ||
url: https://www.reddit.com/ | ||
- title: Twitter | ||
url: https://twitter.com/ | ||
- title: Instagram | ||
url: https://www.instagram.com/ | ||
- name: Markets | ||
columns: | ||
- size: small | ||
widgets: | ||
- type: markets | ||
title: Indices | ||
markets: | ||
- symbol: SPY | ||
name: S&P 500 | ||
- symbol: DX-Y.NYB | ||
name: Dollar Index | ||
|
||
- type: markets | ||
title: Crypto | ||
markets: | ||
- symbol: BTC-USD | ||
name: Bitcoin | ||
- symbol: ETH-USD | ||
name: Ethereum | ||
|
||
- type: markets | ||
title: Stocks | ||
sort-by: absolute-change | ||
markets: | ||
- symbol: NVDA | ||
name: NVIDIA | ||
- symbol: AAPL | ||
name: Apple | ||
- symbol: MSFT | ||
name: Microsoft | ||
- symbol: GOOGL | ||
name: Google | ||
- symbol: AMD | ||
name: AMD | ||
- symbol: RDDT | ||
name: Reddit | ||
- symbol: AMZN | ||
name: Amazon | ||
- symbol: TSLA | ||
name: Tesla | ||
- symbol: INTC | ||
name: Intel | ||
- symbol: META | ||
name: Meta | ||
|
||
- size: full | ||
widgets: | ||
- type: rss | ||
title: News | ||
style: horizontal-cards | ||
feeds: | ||
- url: https://feeds.bloomberg.com/markets/news.rss | ||
title: Bloomberg | ||
- url: https://moxie.foxbusiness.com/google-publisher/markets.xml | ||
title: Fox Business | ||
- url: https://moxie.foxbusiness.com/google-publisher/technology.xml | ||
title: Fox Business | ||
|
||
- type: group | ||
widgets: | ||
- type: reddit | ||
show-thumbnails: true | ||
subreddit: technology | ||
- type: reddit | ||
show-thumbnails: true | ||
subreddit: wallstreetbets | ||
|
||
- type: videos | ||
style: grid-cards | ||
collapse-after-rows: 3 | ||
channels: | ||
- UCvSXMi2LebwJEM1s4bz5IBA # New Money | ||
- UCV6KDgJskWaEckne5aPA0aQ # Graham Stephan | ||
- UCAzhpt9DmG6PnHXjmJTvRGQ # Federal Reserve | ||
|
||
- size: small | ||
widgets: | ||
- type: rss | ||
title: News | ||
limit: 30 | ||
collapse-after: 13 | ||
feeds: | ||
- url: https://www.ft.com/technology?format=rss | ||
title: Financial Times | ||
- url: https://feeds.a.dj.com/rss/RSSMarketsMain.xml | ||
title: Wall Street Journal | ||
- name: Gaming | ||
columns: | ||
- size: small | ||
widgets: | ||
- type: twitch-top-games | ||
limit: 20 | ||
collapse-after: 13 | ||
exclude: | ||
- just-chatting | ||
- pools-hot-tubs-and-beaches | ||
- music | ||
- art | ||
- asmr | ||
|
||
- size: full | ||
widgets: | ||
- type: group | ||
widgets: | ||
- type: reddit | ||
show-thumbnails: true | ||
subreddit: pcgaming | ||
- type: reddit | ||
subreddit: games | ||
|
||
- type: videos | ||
style: grid-cards | ||
collapse-after-rows: 3 | ||
channels: | ||
- UCNvzD7Z-g64bPXxGzaQaa4g # gameranx | ||
- UCZ7AeeVbyslLM_8-nVy2B8Q # Skill Up | ||
- UCHDxYLv8iovIbhrfl16CNyg # GameLinked | ||
- UC9PBzalIcEQCsiIkq36PyUA # Digital Foundry | ||
|
||
- size: small | ||
widgets: | ||
- type: reddit | ||
subreddit: gamingnews | ||
limit: 7 | ||
style: vertical-cards |
12 changes: 12 additions & 0 deletions
12
projects/nex.rpi/src/apps/nr-dashboard/live/dev/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: default | ||
|
||
resources: | ||
- ../../base/glance | ||
|
||
configMapGenerator: | ||
- name: glance-configuration | ||
files: | ||
- glance.yml=configurations/glance.yaml |