- Notifications
You must be signed in to change notification settings - Fork165
Classic workflow retention policy#698
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
7 commits Select commitHold shift + click to select a range
b9ab869 Create build-retention-policy.md
NimRegev31b631c Add new TTL build retention policy
NimRegeva3a056a Update build-retention-policy.md
NimRegev1e5645d Update new build retention policy
NimRegevd85379d Update delete policy content
NimRegev9411111 Update ttl retention policy
NimRegev935a897 Update codefresh-on-prem.md
NimRegevFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,50 @@ | ||
| --- | ||
| title: "Configure build retention policy for pipelines" | ||
| description: "Define workflow retention" | ||
| group: pipelines | ||
| sub_group: configuration | ||
| toc: true | ||
| --- | ||
| Define the retention policy for pipeline builds in your environments. | ||
| For existing environments, save storage space by deleting older builds. Fewer pipeline builds to manage, make it easy to navigate to and find relevant builds for monitoring and troubleshooting. | ||
| For new environments, defining a retention policy to better control build environments and optimize storage space. | ||
| Retention settings are controlled through environment variables in `cf-api`. By default, when enabled, Codefresh implements a Cron job that deletes removes data from the `workflowproccesses` collection. | ||
| >**NOTE**: | ||
| >Build logs are _not_deleted. | ||
| ## Pipeline build retention settings | ||
| {: .table .table-bordered .table-hover} | ||
| | Env Variable | Description | Default | | ||
| |---------------|--------------------------- |---------------------- | | ||
| |`TTL_RETENTION_POLICY_IS_ENABLED` | Determines if automatic build deletion through the Cron job is enabled. | `false` | | ||
| |`TTL_RETENTION_POLICY_IN_DAYS` | The number of days for which to retain builds, and can be between `30`(minimum) and `365` (maximum). Builds older than the defined retention period are deleted. | `365` | | ||
| ## (Optional) Drop MongoDB index for existing environments | ||
| For existing environments, for the retention mechanism to work, you must first drop the existing index in MongoDB. | ||
| This action requires a maintenance window that depends on the number of workflows to delete, approximately three hours per MongoDB node. | ||
| 1. In MongoDB, drop the index for `created` field in `workflowprocesses` collection. | ||
| 1. Continue with _Configure build retention policy_. | ||
| ## Configure build retention policy | ||
| If you have more than one `cf-api`, you must configure _all_ of them. | ||
| 1. In `cf-api`, add `env.TTL_RETENTION_POLICY_IS_ENABLED`, and set it to `true`. | ||
| 1. Add `TTL_RETENTION_POLICY_IN_DAYS` and set to the required value. If not set, uses the default of `365` days. | ||
| 1. Verify that the `created` field in the `workflowprocesses` collection has a new index. | ||
| 1. Restart `cf-api`. | ||
| ## Related articles | ||
| [Creating pipelines]({{site.baseurl}}/docs/pipelines/pipelines/) | ||
| [Monitoring pipelines]({{site.baseurl}}/docs/pipelines/monitoring-pipelines/) | ||
| [Pipeline integrations with Codefresh API]({{site.baseurl}}/docs/integrations/codefresh-api/) |
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.