From: Thanh Ha Date: Mon, 22 Jan 2018 01:20:43 +0000 (-0500) Subject: Move cleanup stale nodes script to openstack-cron X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=d04b45d3f16fc02758f9c5bb2aa128f23013b90e;p=releng%2Fbuilder.git Move cleanup stale nodes script to openstack-cron Consolidate job into openstack-cron job to save cloud resources as these tasks do not take very long to run. Change-Id: I2bc66c7f567145f217c3e4df254173bc565670e9 Signed-off-by: Thanh Ha --- diff --git a/jjb/opendaylight-infra-cleanup-stale-nodes.sh b/jjb/odl-openstack-cleanup-stale-nodes.sh similarity index 72% rename from jjb/opendaylight-infra-cleanup-stale-nodes.sh rename to jjb/odl-openstack-cleanup-stale-nodes.sh index 2ec19ee8e..ddd104180 100644 --- a/jjb/opendaylight-infra-cleanup-stale-nodes.sh +++ b/jjb/odl-openstack-cleanup-stale-nodes.sh @@ -1,13 +1,14 @@ #!/bin/bash # SPDX-License-Identifier: EPL-1.0 ############################################################################## -# Copyright (c) 2017 The Linux Foundation and others. +# Copyright (c) 2017 - 2018 The Linux Foundation and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## +echo "---> Cleanup stale nodes" # Todo: As a safe check we could obtain the list of active jobs from Jenkins and # compute the checksum from $JOB_NAME to check if any active nodes exist and @@ -15,7 +16,7 @@ # 24H timeout in place for all jobs therefore all jobs are expected to complete # within the timeout. -lftools openstack --os-cloud vex \ - server list --days=1 -lftools openstack --os-cloud vex \ - server cleanup --days=1 +# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 +source "/tmp/v/lftools/bin/activate" +lftools openstack --os-cloud vex server list --days=1 +lftools openstack --os-cloud vex server cleanup --days=1 diff --git a/jjb/releng-jobs.yaml b/jjb/releng-jobs.yaml index b4462739b..9e2b8d30a 100644 --- a/jjb/releng-jobs.yaml +++ b/jjb/releng-jobs.yaml @@ -10,7 +10,6 @@ - gerrit-tox-verify # OpenStack Related - 'builder-delete-orphaned-nodes' - - 'builder-delete-stale-nodes' # Automation for docs and jobs - 'builder-update-image-list' @@ -212,6 +211,7 @@ - shell: !include-raw-escape: global-jjb/shell/lftools-install.sh # Servers - odl-openstack-cleanup-stale-stacks + - odl-openstack-cleanup-stale-nodes # Images - odl-openstack-check-image-protection - odl-openstack-cleanup-old-images @@ -258,43 +258,6 @@ email-prefix: '[releng]' - lf-infra-publish - -- job-template: - name: 'builder-delete-stale-nodes' - project-type: freestyle - node: centos7-builder-2c-1g - - properties: - - opendaylight-infra-properties: - build-days-to-keep: 7 - - parameters: - - opendaylight-infra-parameters: - os-cloud: '{os-cloud}' - project: '{project}' - branch: '{branch}' - refspec: 'refs/heads/{branch}' - artifacts: '{archive-artifacts}' - - wrappers: - - opendaylight-infra-wrappers: - build-timeout: '{build-timeout}' - - triggers: - # Attempt to clear up stacks every 30 mins in case we have orphaned stacks - - timed: '0,30 * * * *' - - builders: - - shell: !include-raw-escape: - - global-jjb/shell/lftools-install.sh - - opendaylight-infra-cleanup-stale-nodes.sh - - publishers: - - email-notification: - email-recipients: '{email-recipients}' - email-prefix: '[releng]' - - lf-infra-publish - - job-template: name: 'builder-update-image-list' project-type: freestyle diff --git a/jjb/releng-macros.yaml b/jjb/releng-macros.yaml index 3ea477cc3..3c824fb11 100644 --- a/jjb/releng-macros.yaml +++ b/jjb/releng-macros.yaml @@ -299,6 +299,11 @@ builders: - shell: !include-raw: odl-openstack-cleanup-old-images.sh +- builder: + name: odl-openstack-cleanup-stale-nodes + builders: + - shell: !include-raw: odl-openstack-cleanup-stale-nodes.sh + - builder: name: odl-openstack-cleanup-stale-stacks builders: