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

Add script to clean-up unused AWS EC2 Instances and VPCs #244

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

Conversation

shivakunv
Copy link
Contributor

No description provided.

@shivakunv shivakunv force-pushed the awsresourcecleanup branch 3 times, most recently from 2f8369e to 348e3c1 Compare December 17, 2024 08:13
@shivakunv shivakunv self-assigned this Dec 17, 2024
@shivakunv shivakunv marked this pull request as ready for review December 17, 2024 08:13
scripts/awsvpcscleanup.sh Outdated Show resolved Hide resolved
scripts/awsvpcscleanup.sh Outdated Show resolved Hide resolved
Copy link

copy-pr-bot bot commented Dec 18, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@shivakunv shivakunv force-pushed the awsresourcecleanup branch 11 times, most recently from bd378e0 to 5a06340 Compare December 19, 2024 06:08
@tariq1890
Copy link
Contributor

@shivakunv It'd be better if the cleanup bot follows the same sequence of operations as laid out in the holodeck delete.go file

@shivakunv
Copy link
Contributor Author

shivakunv commented Dec 19, 2024

@shivakunv
Copy link
Contributor Author

@shivakunv It'd be better if the cleanup bot follows the same sequence of operations as laid out in the holodeck delete.go file

followed delete.go sequence:-

terminateInstancesInput
deleteSecurityGroup
Delete the subnet
Delete the route tables
Delete the Internet Gateway
Delete the VPC

scripts/awscleanup.sh Outdated Show resolved Hide resolved
@tariq1890
Copy link
Contributor

@shivakunv Please amend the commit and retitle the PR as follows

Add script to clean-up unused AWS EC2 Instances and VPCs"

@shivakunv shivakunv changed the title unused aws instace and vpcs cleanup Add script to clean-up unused AWS EC2 Instances and VPCs Dec 20, 2024
@shivakunv
Copy link
Contributor Author

Thanks @tariq1890 for reviewing.
incorporated the review comments. PTAL

passed pipeline:-
https://github.com/NVIDIA/holodeck/actions/runs/12427716870/job/34698013023


on:
schedule:
- cron: '0 8 * * *' # Runs daily at 8AM UTC
Copy link
Contributor Author

@shivakunv shivakunv Dec 20, 2024

Choose a reason for hiding this comment

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

@cdesiniotis @tariq1890
suggestion :-
**- cron: "0 /4 * * "

Since we are deleting only e2e job resources (ci-*), shouldn’t we run this job every 4 hours?
with tag based change, Our cleanup bot will destroy only those resources that are completed.
Instead of running it daily at 8 AM UTC, we should schedule it to run every 4 hours.

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