ppc64le-cloud / test-infra

Apache License 2.0
6 stars 20 forks source link

Clean up stale Hypershift VMs #442

Closed Neha-dot-Yadav closed 7 months ago

Neha-dot-Yadav commented 7 months ago

This PR has a periodic job which cleans up all stale VMs present in Hypershift rh-upstream-hypershift-agent-ci , rh-upstream-hypershift-cluster-bot-pvs , rh-upstream-hypershift-powervs-ci-e2e-pvs service instances which are older than 24h(1 day).

mkumatag commented 7 months ago

/cc @Rajalakshmi-Girish

please review this PR when its ready

Rajalakshmi-Girish commented 7 months ago

Also, have you tried testing this job by running test-pj like it is mentioned here? Let me know if you want me to run it before merging

Neha-dot-Yadav commented 7 months ago

@Neha-dot-Yadav I see the last line #28 commented out. But, you have mentioned the ID's related service instance name rh-upstream-hypershift-agent-ci in the description of this change. Would like like to uncomment last line?

Have commented it just for testing, as with the current purge condition, the bastian VM is also getting deleted(as it was created before 24h). So, looking at, how we can make it conditional to exclude that VM.

Neha-dot-Yadav commented 7 months ago

Also, have you tried testing this job by running test-pj like it is mentioned here? Let me know if you want me to run it before merging

@Rajalakshmi-Girish have not tested it yet, as still working on adding that condition. Let's hold the merge till then.

Rajalakshmi-Girish commented 7 months ago

Have commented it just for testing, as with the current purge condition, the bastian VM is also getting deleted(as it was created before 24h). So, looking at, how we can make it conditional to exclude that VM.

I see pvsadm having a flag --regexp string Regular Expressions for filtering the selection If your VMs from CI have a common name to filter out, you many use this regexp flag and delete only those. (I haven't tried using this flag earlier :| )

Neha-dot-Yadav commented 7 months ago

Have commented it just for testing, as with the current purge condition, the bastian VM is also getting deleted(as it was created before 24h). So, looking at, how we can make it conditional to exclude that VM.

I see pvsadm having a flag --regexp string Regular Expressions for filtering the selection If your VMs from CI have a common name to filter out, you many use this regexp flag and delete only those. (I haven't tried using this flag earlier :| )

Thanks, using that approach, and testing it. Let's see!

Rajalakshmi-Girish commented 7 months ago

Was tested by running test-pj https://prow.ppc64le-cloud.cis.ibm.net/job-history/s3/ppc64le-prow-logs/logs/test-periodic-hypershift-powervs-cleanup

Rajalakshmi-Girish commented 7 months ago

/approve

ppc64le-cloud-bot commented 7 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mkumatag, Neha-dot-Yadav, Rajalakshmi-Girish

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/ppc64le-cloud/test-infra/blob/master/OWNERS)~~ [mkumatag] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
ppc64le-cloud-bot commented 7 months ago

@Neha-dot-Yadav: Updated the job-config configmap in namespace prow at cluster default using the following files:

In response to [this](https://github.com/ppc64le-cloud/test-infra/pull/442): >This PR has a periodic job which cleans up all stale VMs present in Hypershift `rh-upstream-hypershift-agent-ci` , `rh-upstream-hypershift-cluster-bot-pvs` , `rh-upstream-hypershift-powervs-ci-e2e-pvs` service instances which are older than 24h(1 day). Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.