Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test clean for resubmission pipeline #1292

Open
wants to merge 93 commits into
base: master
Choose a base branch
from

Conversation

maximenoel8
Copy link
Contributor

@maximenoel8 maximenoel8 commented Aug 9, 2024

What does this PR ?

This PR gives the possibility to automatically handle the tools resubmission in the context of a release testing using BV.
In this PR there are two parts :

New cleanup pipeline ( for now 4.3 NUE and PRV )

What does this pipeline

Create a pipeline able to clean the server artifacts created during a BV run.
This pipeline will also redeploy the current clients using the new terracumber functionalities to modify a main.tf file.

What does NOT this pipeline

Adding or removing clients from the current deployment.
Redeploying monitoring and proxy.

New python scripts

SUSEManagerCleaner.py

Organize the modules and arguments.

suse_manager_api.py

Call the API ( from controller ) to clean the server artifacts.

suse_manager_ssh.py

Unfortunately, we require a ssh connection to server to remove the know hosts because the clients are fresh deployment.
Could be manage directly in groovy step if we don't want to add this python script.

Testing

Currently tested for debugging BV 4.3 NUE and PRV
Pipeline url : https://ci.suse.de/view/Manager/view/Manager-4.3/job/manager-4.3-qe-build-validation-NUE-cleaning/

What is missing ?

  • Unit tests for the python script
  • Improve the generic pipeline to seamlessly handle all the BV pipelines. We will still require two descriptions to point either on PRV or NUE.
  • Improvement to also redeploy monitoring and proxy, will be possible once all the BV hostnames are aligned to the testsuite names.

Issues

Related to:

@maximenoel8 maximenoel8 force-pushed the cleanup_pipeline branch 5 times, most recently from d64e530 to cc2d8d4 Compare November 4, 2024 02:45
@maximenoel8 maximenoel8 force-pushed the cleanup_pipeline branch 11 times, most recently from b6c62a8 to 86ac92e Compare November 11, 2024 00:30
@maximenoel8 maximenoel8 marked this pull request as ready for review November 13, 2024 02:34
stage('Delete client VMs') {

// Construct the --tf-resources-to-delete argument dynamically
ArrayList tfResourcesToDelete = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can reuse the lists at line 20 and 31.


## Prerequisites

- **Python 3**: Ensure Python 3 is installed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we use Python 3.11 in CI.
Do we specifically need at least that version or will any (reasonably recent) Python 3.X be fine ?

class ResourceManager:
def __init__(self, manager_url, resources_to_delete, product_version):
self.manager_url = manager_url
self.resources_to_delete = {"proxy", "monitoring", "build"} - set(resources_to_delete)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the naming off and the set difference are actually resources to protect ?

if self.product_version == "uyuni":
channels = self.client.channel.listMyChannels(self.session_key)
for channel in channels:
if "custom" in channel['label'] and not any(protected in channel['label'] for protected in self.resources_to_delete):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly necessary and can always be done later on, as refactor/improvement.

We can probably have a private function to delete channels that takes a few parameters and replaces this code blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants