You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by al...@apache.org on 2020/08/11 19:40:29 UTC

[beam] branch master updated: Moving /tmp directory cleanup of CI workers to Inventory Jenkins job

This is an automated email from the ASF dual-hosted git repository.

altay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 50366ba  Moving /tmp directory cleanup of CI workers to Inventory Jenkins job
     new aadda9f  Merge pull request #12529 from damgad/damgad_inventory_tmp_cleanup
50366ba is described below

commit 50366bae1c86136331be097f0f0250bd619dc7f8
Author: Damian Gadomski <da...@polidea.com>
AuthorDate: Tue Aug 11 16:59:26 2020 +0200

    Moving /tmp directory cleanup of CI workers to Inventory Jenkins job
---
 .test-infra/jenkins/job_Clean_tmp_directory.groovy | 47 ----------------------
 .test-infra/jenkins/job_Inventory.groovy           | 10 +++++
 2 files changed, 10 insertions(+), 47 deletions(-)

diff --git a/.test-infra/jenkins/job_Clean_tmp_directory.groovy b/.test-infra/jenkins/job_Clean_tmp_directory.groovy
deleted file mode 100644
index 3cc0425..0000000
--- a/.test-infra/jenkins/job_Clean_tmp_directory.groovy
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-job('beam_Clean_tmp_directory') {
-  description('Cleans /tmp directory on the node machine by removing files that were not accessed for long (configurable) time.')
-
-  logRotator {
-    daysToKeep(14)
-  }
-
-  concurrentBuild()
-
-  parameters {
-    labelParam('machine_label') {
-      description("Label of the machine to be cleaned. Could be either a specific machine name or `beam` if you want to cleanup all the machines.")
-      allNodes('allCases','AllNodeEligibility')
-    }
-    stringParam {
-      name("unaccessed_for")
-      defaultValue("10")
-      description("Only files that were not accessed for last `unaccessed_for` hours will be deleted. Default value should be right in most cases. Modify it only if know what you're doing :)")
-      trim(true)
-    }
-  }
-
-  steps {
-    shell('echo "Current size of /tmp dir is \$(sudo du -sh /tmp)"')
-    shell('echo "Deleting files accessed later than \${unaccessed_for} hours ago"')
-    shell('sudo find /tmp -type f -amin +\$((60*\${unaccessed_for})) -print -delete')
-    shell('echo "Size of /tmp dir after cleanup is \$(sudo du -sh /tmp)"')
-  }
-}
diff --git a/.test-infra/jenkins/job_Inventory.groovy b/.test-infra/jenkins/job_Inventory.groovy
index 82e58a3..07d9e0a 100644
--- a/.test-infra/jenkins/job_Inventory.groovy
+++ b/.test-infra/jenkins/job_Inventory.groovy
@@ -46,6 +46,12 @@ nums.each {
         trigger('multiSelectionDisallowed')
         eligibility('IgnoreOfflineNodeEligibility')
       }
+      stringParam {
+        name("tmp_unaccessed_for")
+        defaultValue("48")
+        description("Files from /tmp dir that were not accessed for last `tmp_unaccessed_for` hours will be deleted.")
+        trim(true)
+      }
     }
 
     steps {
@@ -67,6 +73,10 @@ nums.each {
       shell('echo "Maven home $MAVEN_HOME"')
       shell('env')
       shell('docker system prune --all --filter until=24h --force')
+      shell('echo "Current size of /tmp dir is \$(sudo du -sh /tmp)"')
+      shell('echo "Deleting files accessed later than \${tmp_unaccessed_for} hours ago"')
+      shell('sudo find /tmp -type f -amin +\$((60*\${tmp_unaccessed_for})) -print -delete')
+      shell('echo "Size of /tmp dir after cleanup is \$(sudo du -sh /tmp)"')
     }
   }
 }