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

feat: add ability to delete all stacks in happy environment #275

Merged
merged 3 commits into from
Jul 3, 2024

Conversation

shitchcock
Copy link
Contributor

@shitchcock shitchcock commented Jun 27, 2024

We have a bunch of stacks that don't belong to apps with automated happy cleanup jobs.

We want the ability to delete any stale stacks in the whole edu environment

https://czi-tech.atlassian.net/jira/software/c/projects/EFI/boards/209?selectedIssue=EFI-1888

Test details. Open up bash and run commands

ENV="rdev"
list="happy list --all --output json --env $ENV"
force=""
for i in $($(echo $list) | jq -r --arg date "$date" '.[] | select(.last_updated < $date) | .stack'); do
          echo "Deleting stack: $i"
done

The following fails

happy delete smp-shitchcock --env $ENV "$force"

The following succeeds

force="--force"
happy delete smp-shitchcock --env $ENV "$force"

Copy link

@timzchang timzchang left a comment

Choose a reason for hiding this comment

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

Where do we plan to run this action with all: true?

Also check for understanding, does this mean running this action in edu-platform-observability with all: true will remove all stale stacks for different apps?

@shitchcock
Copy link
Contributor Author

Where do we plan to run this action with all: true?

I plan on writing a Github action that runs once every couple weeks and deletes any stacks in edu platform that have been running for longer than 30 days.

Also check for understanding, does this mean running this action in edu-platform-observability with all: true will remove all stale stacks for different apps?

Yes for all stale stacks in the edu platform happy environment

@shitchcock shitchcock merged commit 9e055ea into main Jul 3, 2024
9 checks passed
@shitchcock shitchcock deleted the shitchcock-force-all branch July 3, 2024 23:11
@czi-github-helper czi-github-helper bot mentioned this pull request Jul 3, 2024
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