Skip to content

Commit

Permalink
Merge pull request #1058 from gursewak1997/containers-add-gc
Browse files Browse the repository at this point in the history
Add containers Garbage Collection.
  • Loading branch information
gursewak1997 authored Nov 18, 2024
2 parents 3e79eab + 3b50fd2 commit 06f205b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions gc-policy.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
testing-devel:
cloud-uploads: 2y
containers: 2w
next-devel:
cloud-uploads: 2y
containers: 2w
branched:
cloud-uploads: 1y
containers: 2w
rawhide:
cloud-uploads: 1y
containers: 2w
bodhi-updates:
cloud-uploads: 1y
images: 58m
Expand Down
13 changes: 9 additions & 4 deletions jobs/garbage-collection.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,18 @@ lock(resource: "gc-${params.STREAM}") {
def originalTimestamp = originalBuildsJson.timestamp
def acl = pipecfg.s3.acl ?: 'public-read'

withCredentials([file(variable: 'GCP_KOLA_TESTS_CONFIG', credentialsId: 'gcp-image-upload-config')]) {
withCredentials([
file(variable: 'GCP_KOLA_TESTS_CONFIG', credentialsId: 'gcp-image-upload-config'),
file(variable: 'REGISTRY_SECRET', credentialsId: 'oscontainer-push-registry-secret'),
file(variable: 'AWS_BUILD_UPLOAD_CONFIG', credentialsId: 'aws-build-upload-config')
]) {
stage('Garbage Collection') {
pipeutils.shwrapWithAWSBuildUploadCredentials("""
cosa cloud-prune --policy ${new_gc_policy_path} \
shwrap("""
cosa coreos-prune --policy ${new_gc_policy_path} \
--stream ${params.STREAM} ${dry_run} \
--gcp-json-key=\${GCP_KOLA_TESTS_CONFIG} \
--acl=${acl} \
--registry-auth-file=\${REGISTRY_SECRET} \
--aws-config-file \${AWS_BUILD_UPLOAD_CONFIG}
""")
}
Expand All @@ -79,7 +84,7 @@ lock(resource: "gc-${params.STREAM}") {
lock(resource: "builds-json-${params.STREAM}") {
stage('Upload Builds JSON') {
pipeutils.shwrapWithAWSBuildUploadCredentials("""
cosa cloud-prune --policy ${new_gc_policy_path} \
cosa coreos-prune --policy ${new_gc_policy_path} \
--stream ${params.STREAM} \
--upload-builds-json ${dry_run} \
--acl=${acl} \
Expand Down

0 comments on commit 06f205b

Please sign in to comment.