-
-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Sablier Traefik Plugin for Workload Management #751
Open
SamJUK
wants to merge
2
commits into
wardenenv:main
Choose a base branch
from
SamJUK:feature/sablier
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,20 @@ | ||
provider: | ||
name: docker | ||
server: | ||
port: 10000 | ||
base-path: / | ||
storage: | ||
file: | ||
sessions: | ||
default-duration: 5m | ||
expiration-interval: 20s | ||
logging: | ||
level: info | ||
strategy: | ||
dynamic: | ||
custom-themes-path: | ||
show-details-by-default: true | ||
default-theme: warden | ||
default-refresh-frequency: 5s | ||
blocking: | ||
default-timeout: 1m |
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,65 @@ | ||
<html lang="en"><head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<meta name="robots" content="noindex, nofollow"> | ||
<title>Warden</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<meta http-equiv="refresh" content="{{ .RefreshFrequency }}"> | ||
<link rel="preconnect" href="https://fonts.bunny.net" crossorigin=""> | ||
<link rel="dns-prefetch" href="https://fonts.bunny.net"> | ||
<link href="https://fonts.bunny.net/css2?family=Open+Sans:wght@400;700&display=swap" rel="stylesheet"> | ||
<style> | ||
html,body {background-color:black;color:#fff;font-family:'Open Sans',sans-serif;height:100vh;margin:0;font-size:0} | ||
.container {height:100vh;align-items:center;display:flex;justify-content:center;position:relative} | ||
.wrap {text-align:center} | ||
.ghost {animation:float 3s ease-out infinite} | ||
@keyframes float { 50% {transform:translate(0,20px)}} | ||
.shadowFrame {width:130px;margin: 10px auto 0 auto} | ||
.shadow {animation:shrink 3s ease-out infinite;transform-origin:center center} | ||
@keyframes shrink {0%{width:90%;margin:0 5%} 50% {width:60%;margin:0 18%} 100% {width:90%;margin:0 5%}} | ||
h3 {font-size:17px;text-transform: uppercase;margin:0.3em auto} | ||
.description {font-size:13px;color:#feb8c5} | ||
.details {color:#999;width:100%} | ||
.details table {width:100%} | ||
.details td {white-space:nowrap;font-size:11px} | ||
.details .name {text-align:right;padding-right:.6em;width:50%} | ||
.details .value {text-align:left;padding-left:.6em;font-family:'Lucida Console','Courier New',monospace} | ||
.details .value.error {color: rgb(231, 89, 82)} | ||
.details .value.success {color: rgb(82, 231, 142)} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="wrap"> | ||
|
||
<pre class="warden-mark" style=" | ||
color: green; | ||
font-size: 22px; | ||
line-height: 1em; | ||
font-weight: 600; | ||
text-shadow: 2px 2px 3px #005003; | ||
"> _ __ __ | ||
| | / /___ __________/ /__ ____ | ||
| | /| / / __ `/ ___/ __ / _ \/ __ \ | ||
| |/ |/ / /_/ / / / /_/ / __/ / / / | ||
|__/|__/\__,_/_/ \__,_/\___/_/ /_/ | ||
</pre> | ||
<h3><span>Starting</span> {{ .DisplayName }}</h3> | ||
<p class="description">Your instance(s) will stop after {{ .SessionDuration }} of inactivity</p> | ||
<div class="details"> | ||
<table> | ||
{{- range $i, $instance := .InstanceStates }} | ||
<tr> | ||
<td class="name">{{ $instance.Name }}</td> | ||
{{- if $instance.Error }} | ||
<td class="value error">{{ $instance.Error }}</td> | ||
{{- else }} | ||
<td class="value success">{{ $instance.Status }} ({{ $instance.CurrentReplicas }}/{{ $instance.DesiredReplicas }})</td> | ||
{{- end}} | ||
</tr> | ||
{{ end -}} | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</body></html> |
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 |
---|---|---|
|
@@ -23,3 +23,8 @@ log: | |
global: | ||
checkNewVersion: false | ||
sendAnonymousUsage: false | ||
experimental: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If PR #813 is approved. This can be refactored into |
||
plugins: | ||
sablier: | ||
moduleName: github.com/acouvreur/sablier | ||
version: v${SABLIER_VERSION:-1.5.0} |
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 @@ | ||
services: | ||
sablier: | ||
container_name: sablier | ||
image: acouvreur/sablier:${SABLIER_VERSION:-1.5.0} | ||
restart: ${WARDEN_RESTART_POLICY:-always} | ||
command: | ||
- start | ||
- --provider.name=docker | ||
volumes: | ||
- '/var/run/docker.sock:/var/run/docker.sock' | ||
- ${WARDEN_HOME_DIR}/etc/sablier/sablier.yml:/etc/sablier/sablier.yml | ||
- ${WARDEN_HOME_DIR}/etc/sablier/theme:/etc/sablier/themes |
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
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
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
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
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,15 @@ | ||
services: | ||
nginx: | ||
labels: | ||
- traefik.enable=false | ||
|
||
varnish: | ||
labels: | ||
- traefik.enable=true | ||
- traefik.http.routers.${WARDEN_ENV_NAME}-varnish.middlewares=sablier-${WARDEN_ENV_NAME}@docker | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.sablierUrl=http://sablier:10000 | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.sessionDuration=${TRAEFIK_SABLIER_DURATION:-30m} | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.group=${WARDEN_ENV_NAME} | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.dynamic.name=${WARDEN_ENV_NAME} | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.dynamic.displayName=${WARDEN_ENV_NAME} | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.dynamic.theme=${TRAEFIK_SABLIER_THEME} |
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,14 @@ | ||
services: | ||
nginx: | ||
networks: | ||
- default | ||
labels: | ||
- traefik.enable=true | ||
- sablier.enable=false | ||
- traefik.http.routers.${WARDEN_ENV_NAME}-nginx.middlewares=sablier-${WARDEN_ENV_NAME}@docker | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.sablierUrl=http://sablier:10000 | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.sessionDuration=${TRAEFIK_SABLIER_DURATION:-30m} | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.group=${WARDEN_ENV_NAME} | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.dynamic.name=${WARDEN_ENV_NAME} | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.dynamic.displayName=${WARDEN_ENV_NAME} | ||
- traefik.http.middlewares.sablier-${WARDEN_ENV_NAME}.plugin.sablier.dynamic.theme=${TRAEFIK_SABLIER_THEME} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that this config should be configurable, because you could work on the code and don't use env much more time. You will lose console history if it will be closed by stoping environment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, implemented the same way as
traefik.yml
for consistency. It can be configured via${WARDEN_HOME_DIR}/etc/sablier/sablier.yml
, Although it will be overwritten onsvc up
calls.Opened PR #813 which looks to migrate the Traefik config to environment variables. Where users can override / expand the configuration via the
~/.warden/docker-compose.yml
file. Sablier can be refactored to the same approach if approved.