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

[WIP] Prune stale environments. #1621

Closed
wants to merge 2 commits into from

Conversation

steveworley
Copy link
Contributor

  • Adds a new service that will make a Lagoon API request to remove the environment.

Closing issues

Closes #1555

- Adds a new service that will make a Lagoon API request to remove the environment.
@seanhamlin
Copy link
Contributor

Love this @steveworley ! I salute you.

@seanhamlin seanhamlin added the 8-automation-helpers Automation, Services & Helpers subsystem label Jan 30, 2020
Copy link
Contributor

@Schnitzel Schnitzel left a comment

Choose a reason for hiding this comment

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

a nice start, thanks @steveworley for this.

Just a question overall: Can we somehow make sure that this is not enabled by default? Such a service might makes sense for some usecases, but it could also lead into very very confused users of Lagoon.

Also I think we need to create a system to disable this pruning on a project/environment base, like we do for the autoIdle, see https://github.com/amazeeio/lagoon/search?q=autoidle&type=Code

JWTAUDIENCE=api.dev \
PROJECT_REGEX=".+" \
ROUTER_LOG_INTERVAL=4h \
POD_RUN_INTERVAL=14400 \
Copy link
Contributor

Choose a reason for hiding this comment

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

this environment variable is never used?

PROJECT_REGEX=".+" \
ROUTER_LOG_INTERVAL=4h \
POD_RUN_INTERVAL=14400 \
ELASTICSEARCH_URL="http://logs-db-service:9200"
Copy link
Contributor

Choose a reason for hiding this comment

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

is never used

services/environment-pruner/.lagoon.yml Outdated Show resolved Hide resolved
services/environment-pruner/.lagoon.yml Outdated Show resolved Hide resolved
@steveworley
Copy link
Contributor Author

Thanks! I just wanted to get a commit up and a starting point validated to make sure it was a direction everyone was happy with :)

Also I think we need to create a system to disable this pruning on a project/environment base, like we do for the autoIdle, see https://github.com/amazeeio/lagoon/search?q=autoidle&type=Code

Agreed - I have some local changes that looks to update the Lagoon schema definition for projects/environments to allow pruning.

- Change cutoff date to a variable.
- Use `==` as style for base string comparison.
@tobybellwood
Copy link
Member

There are two angles for consideration here - the management of environments might be better managed by the Lagoon administrator, and this task shouldn't require a dedicated service. Going to close here whilst we rethink

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

Successfully merging this pull request may close these issues.

Prune unused non-production environments (codename 'Arnie')
4 participants