Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit99ba376

Browse files
authored
Classic workflow retention policy (#698)
* Create build-retention-policy.mdFirst draft of new build retention policy for sass customers* Add new TTL build retention policyAdded content for new build retention for SaaS and on-prem* Update build-retention-policy.mdContent edits* Update new build retention policycontent edits after review with Dev and added entry to nav yaml* Update delete policy content* Update ttl retention policyImplemented review comments* Update codefresh-on-prem.md
1 parente8b39e2 commit99ba376

File tree

3 files changed

+97
-15
lines changed

3 files changed

+97
-15
lines changed

‎_data/nav.yml‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,19 @@
370370
url:"/introduction-to-codefresh-pipelines"
371371
-title:Creating pipelines
372372
url:"/pipelines"
373+
-title:Configuration for pipelines
374+
url:"/configuration"
375+
sub-pages:
376+
-title:Global pipeline settings
377+
url:"/pipeline-settings"
378+
-title:Shared configuration
379+
url:"/shared-configuration"
380+
-title:Secrets for pipelines
381+
url:"/secrets-store"
382+
-title:Public logs and status badges
383+
url:"/build-status"
384+
-title:Build retention policy
385+
url:"/build-retention-policy"
373386
-title:Steps in pipelines
374387
url:"/steps"
375388
sub-pages:
@@ -430,17 +443,6 @@
430443
url:"/deployment-environments"
431444
-title:Running pipelines locally
432445
url:"/running-pipelines-locally"
433-
-title:Configuration for pipelines
434-
url:"/configuration"
435-
sub-pages:
436-
-title:Global pipeline settings
437-
url:"/pipeline-settings"
438-
-title:Shared configuration
439-
url:"/shared-configuration"
440-
-title:Secrets for pipelines
441-
url:"/secrets-store"
442-
-title:Public logs and status badges
443-
url:"/build-status"
444446
-title:Service containers
445447
url:"/service-containers"
446448
-title:Docker image metadata

‎_docs/installation/codefresh-on-prem.md‎

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,20 @@ Codefresh installation supports automatic storage provisioning based on the stan
520520

521521

522522
### Retention policy for Codefresh builds
523-
Define a retention policy to manage Codefresh builds. The retention settings are controlled through `cf-api` deployment environment variables, all of which have default settings which you can retain or customize. By default, Codefresh deletes builds older than six months, including offline logs.
523+
Define a retention policy to manage Codefresh builds. The retention settings are controlled through `cf-api` deployment environment variables, all of which have default settings which you can retain or customize.
524+
525+
There are two mechanisms to define the retention policy. Both mechanisms are implemented as Cron jobs.
526+
1. Legacy retention mechanism:Allows you to delete builds in chunks, and also, optionally, delete offline logs from the database.
527+
1. New retention mechanism:Allows you delete builds by days, and does not delete offline logs.
528+
529+
530+
#### Configure retention policy for builds and logs
531+
With this method, Codefresh by default deletes builds older than six months, including offline logs for these builds.
524532

525533
The retention mechanism, implemented as a Cron Job, removes data from collections such as:
526-
* workflowproccesses
527-
* workflowrequests
528-
* workflowrevisions
534+
*`workflowproccesses`
535+
*`workflowrequests`
536+
*`workflowrevisions`
529537

530538
{: .table .table-bordered .table-hover}
531539
| Env Variable | Description | Default |
@@ -535,6 +543,28 @@ The retention mechanism, implemented as a Cron Job, removes data from collection
535543
|`RETENTION_POLICY_DAYS` | The number of days for which to retain builds. Builds older than the defined retention period are deleted. | `180` |
536544
|`RUNTIME_MONGO_URI` | Optional. The URI of the Mongo database from which to remove MongoDB logs (in addition to the builds). | |
537545

546+
#### Configure TTL-based retention policy
547+
548+
The TTL-based retention mechanism is implemented as a Cron job, and deletes data from the `workflowprocesses` collection. Build logs are not deleted.
549+
550+
>**IMPORTANT**:
551+
> * For existing environments, for the retention mechanism to work, you must first drop the index in MongoDB. This requires a maintenance window that depends on the number of builds to be deleted, approximately three hours per MongoDB node.
552+
>* If you have more than one `cf-api`, you must update the configuration for all of them.
553+
554+
{: .table .table-bordered .table-hover}
555+
| Env Variable | Description | Default |
556+
|---------------|--------------------------- |---------------------- |
557+
|`TTL_RETENTION_POLICY_IS_ENABLED` | Determines if automatic build deletion through the Cron job is enabled. | `false` |
558+
|`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` |
559+
560+
561+
1. (Optional) For existing environments:
562+
1. In MongoDB, drop the index on `created` field in `workflowprocesses` collection.
563+
1. In `cf-api`, add to `env`:
564+
1. `TTL_RETENTION_POLICY_IS_ENABLED` set to `true`.
565+
1. `TTL_RETENTION_POLICY_IN_DAYS`.
566+
1. Verify that the `created` field in the `workflowprocesses` collection has a new index.
567+
1. Restart `cf-api`.
538568

539569
### Managing Codefresh backups
540570

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title:"Configure build retention policy for pipelines"
3+
description:"Define workflow retention"
4+
group:pipelines
5+
sub_group:configuration
6+
toc:true
7+
---
8+
9+
Define the retention policy for pipeline builds in your environments.
10+
11+
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.
12+
For new environments, defining a retention policy to better control build environments and optimize storage space.
13+
14+
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.
15+
16+
>**NOTE**:
17+
>Build logs are_not_deleted.
18+
19+
20+
##Pipeline build retention settings
21+
22+
23+
{: .table .table-bordered .table-hover}
24+
| Env Variable| Description| Default|
25+
|---------------|---------------------------|----------------------|
26+
|`TTL_RETENTION_POLICY_IS_ENABLED`| Determines if automatic build deletion through the Cron job is enabled.|`false`|
27+
|`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`|
28+
29+
30+
31+
##(Optional) Drop MongoDB index for existing environments
32+
33+
For existing environments, for the retention mechanism to work, you must first drop the existing index in MongoDB.
34+
This action requires a maintenance window that depends on the number of workflows to delete, approximately three hours per MongoDB node.
35+
36+
1. In MongoDB, drop the index for`created` field in`workflowprocesses` collection.
37+
1. Continue with_Configure build retention policy_.
38+
39+
##Configure build retention policy
40+
If you have more than one`cf-api`, you must configure_all_ of them.
41+
42+
1. In`cf-api`, add`env.TTL_RETENTION_POLICY_IS_ENABLED`, and set it to`true`.
43+
1. Add`TTL_RETENTION_POLICY_IN_DAYS` and set to the required value. If not set, uses the default of`365` days.
44+
1. Verify that the`created` field in the`workflowprocesses` collection has a new index.
45+
1. Restart`cf-api`.
46+
47+
##Related articles
48+
[Creating pipelines]({{site.baseurl}}/docs/pipelines/pipelines/)
49+
[Monitoring pipelines]({{site.baseurl}}/docs/pipelines/monitoring-pipelines/)
50+
[Pipeline integrations with Codefresh API]({{site.baseurl}}/docs/integrations/codefresh-api/)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp