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

VM verification and Logs #896

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ebattat
Copy link
Collaborator

@ebattat ebattat commented Sep 19, 2024

Type of change

Note: Fill x in []

  • bug
  • enhancement
  • documentation
  • dependencies

Description

  1. Add VM verification during the OpenShift upgrade process.
  2. Collect logs in case of VM errors and update the error and log path in ElasticSearch
  3. Generate must-gather logs for ODF and CNV in case of errors.
  4. Upload logs to Google Drive using a timestamped hierarchy like '2024/09/19'.
  5. The second option for log storage is S3, default being local storage.

For security reasons, all pull requests need to be approved first before running any automated CI

@ebattat ebattat added the enhancement New feature or request label Sep 19, 2024
@ebattat ebattat self-assigned this Sep 19, 2024
@ebattat ebattat added the ok-to-test PR ok to test label Sep 19, 2024
self.creds = self.authenticate()
self.service = build('drive', 'v3', credentials=self.creds)

def authenticate(self):
"""
Authenticates and returns credentials using token.json or interactive login.
Authenticates and returns credentials.json using token.json.json or interactive login.
Copy link
Member

Choose a reason for hiding this comment

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

Duplicate ".json" (in token.json).

Comment on lines +11 to +19
if os.path.exists('token.json.json'):
creds = Credentials.from_authorized_user_file('token.json.json', SCOPES)
else:
flow = InstalledAppFlow.from_client_secrets_file('credentials.json.json', SCOPES)
creds = flow.run_local_server(port=0)

# Save the credentials.json for future runs
with open('token.json.json', 'w') as token:
token.write(creds.to_json())
Copy link
Member

Choose a reason for hiding this comment

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

token.json.json should be token.json (likewise credentials)

command = f"oc adm must-gather --image=registry.redhat.io/odf4/odf-must-gather-rhel9:v{odf_version} --dest-dir={destination_path}/odf-must-gather-rhel9-v{odf_version}"
self.run(command)
except Exception as e:
raise RuntimeError(f"Failed to generate ODF must-gather logs: {e}")
Copy link
Member

Choose a reason for hiding this comment

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

Do you need to clean up anything if this fails?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ok-to-test PR ok to test
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

2 participants