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

docker/docker-compose.yml Outdated Show resolved Hide resolved
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

Copy link
Contributor Author

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 on svc 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.

@SamJUK SamJUK force-pushed the feature/sablier branch 2 times, most recently from b33e426 to 3469570 Compare October 20, 2024 21:57
@@ -23,3 +23,8 @@ log:
global:
checkNewVersion: false
sendAnonymousUsage: false
experimental:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If PR #813 is approved. This can be refactored into docker/docker-compose.sablier.yml as environment variables. Preventing the need to install the plugin even if Sablier is disabled.

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

Successfully merging this pull request may close these issues.

4 participants