Skip to content
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
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SamJUK
Copy link
Contributor

@SamJUK SamJUK commented Feb 20, 2024

Overview

Implement the Sablier Traefik Plugin, allowing Warden to dynamic start and stop project containers on request rather than having to manage them with env up/down saving system resources for us forgetful people. Especially useful if your working on multiple large projects simultaneously, or for certain edge use cases (we run Warden also as a Ephemeral/Feature hosts deployment with a lot of projects for example).

Implementation Notes

  • Disabled by default, can be enabled via setting WARDEN_SABLIER_ENABLE =1 in the service .env
  • With stop all containers except the ingress (varnish/nginx depending on project configuration)
  • Session lifetime can be set per project via TRAEFIK_SABLIER_DURATION=2h (How long before Sablier sleeps the containers)
  • Custom warden theme (Good PR opportunity for someone to make it look decent)
  • Requires updating TRAEFIK, which can be done through the service configTRAEFIK_VERSION=2.9

Configuration

Service Config:
WARDEN_SABLIER_ENABLE=0 - Enables Sablier globally for the installation (Unable to think of a good use case of enablement on project basis)

Project :
TRAEFIK_SABLIER_DURATION=30m - How long Sablier waits to sleep containers
TRAEFIK_SABLIER_THEME=ghost - Sablier theme to use List of Default Themes

Advanced:
${WARDEN_HOME_DIR}/etc/sablier/theme - Directory if you want to declare any custom Sablier Themes
${WARDEN_HOME_DIR}/etc/sablier/sablier.yml - Sablier Service Configuration Overrides

@@ -9,7 +9,7 @@ services:
volumes:
- ${WARDEN_HOME_DIR}/etc/traefik/traefik.yml:/etc/traefik/traefik.yml
- ${WARDEN_HOME_DIR}/etc/traefik/dynamic.yml:/etc/traefik/dynamic.yml
- ${WARDEN_HOME_DIR}/ssl/certs:/etc/ssl/certs
- ${WARDEN_HOME_DIR}/ssl/certs:/etc/ssl/certs/warden
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SSL certificate location change is outside the scope of your PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original mount ends up clobbering all the default system certificates. Preventing Traefik from downloading plugins due to SSL verification errors.
Could be split to a seperate PR, as it should affecting install any Traefik plugin

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SamJUK To @navarr 's point, then there should be a separate PR that fixes the clobbering issue, and this one requires that one to be fixed first. The PR should do a single thing (add Sablier) not multiple (add Sablier, change SSL dirs, etc.)

storage:
file:
sessions:
default-duration: 5m
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants