Skip to content

Conversation

@zhaoqizqwang
Copy link
Collaborator

@zhaoqizqwang zhaoqizqwang commented Mar 27, 2025

Description
When executing get-logs function, after printing all the logs, we also provide the cloudwatch link to container insight logs (if the CW observability add-on is enabled)

Testing Done
Tested in my personal account and verified the link, and added unit test

image

PR Approval Steps

For Requester

  1. Description
    • [ x] Check the PR title and description for clarity. It should describe the changes made and the reason behind them.
    • [x ] Ensure that the PR follows the contribution guidelines, if applicable.
  2. Security requirements
    • [ x] Ensure that a Pull Request (PR) does not expose passwords and other sensitive information by using git-secrets and upload relevant evidence: https://github.com/awslabs/git-secrets
    • [ x] Ensure commit has GitHub Commit Signature
  3. Manual review
    1. Click on the Files changed tab to see the code changes. Review the changes thoroughly:
      • [x ] Code Quality: Check for coding standards, naming conventions, and readability.
      • [ x] Functionality: Ensure that the changes meet the requirements and that all necessary code paths are tested.
      • [ x] Security: Check for any security issues or vulnerabilities.
      • [ x] Documentation: Confirm that any necessary documentation (code comments, README updates, etc.) has been updated.
  4. Check for Merge Conflicts:
    • [ x] Verify if there are any merge conflicts with the base branch. GitHub will usually highlight this. If there are conflicts, you should resolve them.

For Reviewer

  1. Go through For Requester section to double check each item.
  2. Request Changes or Approve the PR:
    1. If the PR is ready to be merged, click Review changes and select Approve.
    2. If changes are required, select Request changes and provide feedback. Be constructive and clear in your feedback.
  3. Merging the PR
    1. Check the Merge Method:
      1. Decide on the appropriate merge method based on your repository's guidelines (e.g., Squash and merge, Rebase and merge, or Merge).
    2. Merge the PR:
      1. Click the Merge pull request button.
      2. Confirm the merge by clicking Confirm merge.

**Description**
When executing get-logs function, after printing all the logs, we also provide the cloudwatch link to container insight logs (if the CW observability add-on is enabled)

**Testing Done**
Tested in my personal account and verified the link, and added unit test
@zhaoqizqwang zhaoqizqwang requested a review from a team as a code owner March 27, 2025 16:42

return cloudwatch_link

def get_log_url(self, eks_cluster_name, region, node_name, pod_name, namespace, container_name, container_id):
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added validation in new commit

@zhaoqizqwang
Copy link
Collaborator Author

Per review from security guardian, failure in generating cloudwatch link would lead to system exit

sys.exit(
    f"Unexpected error happens when trying to get logs for training job {job_name} : {e}"
)

I'm adding a new try-except block for CW link creation. If there's any failure we skip and continue

@zhaoqizqwang
Copy link
Collaborator Author

Added try except for CW link creation. Manually raised error in the creation process and error message can be loaded correctly

Copy link
Contributor

@adheshgarg adheshgarg left a comment

Choose a reason for hiding this comment

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

LGTM

@zhaoqizqwang zhaoqizqwang merged commit 16734e0 into aws:main Mar 27, 2025
10 checks passed
@zhaoqizqwang zhaoqizqwang deleted the add-cw-link-2 branch March 27, 2025 21:17
nargokul pushed a commit that referenced this pull request Jul 10, 2025
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.

3 participants