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

ci(db): clean up database container after test run #222

Merged
merged 3 commits into from
Jan 19, 2024

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Dec 21, 2023

Welcome to Cryostat3! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed all commits using a GPG signature

To recreate commits with GPG signature git fetch upstream && git rebase --force --gpg-sign upstream/main


Fixes: #221

Description of the change:

Update configuration to allow ryuk container to run, which is responsible for cleaning up leftover containers (like cryostat-db or other postgres) after test runs.

How to manually test:

  1. Make the environment setup changes as listed in the updated README
  2. ./mvnw clean verify ; podman image prune -f ; podman ps -a. There may be some containers running at this point:
CONTAINER ID  IMAGE                                COMMAND               CREATED             STATUS             PORTS                    NAMES
56b3e0c3d6b6  docker.io/testcontainers/ryuk:0.5.1  /bin/ryuk             About a minute ago  Up About a minute  0.0.0.0:38897->8080/tcp  testcontainers-ryuk-f1b8be74-163c-43aa-954a-22f4d64950db
4cbf23b40104  quay.io/cryostat/cryostat-db:latest  postgres -c fsync...  About a minute ago  Up About a minute  0.0.0.0:36511->5432/tcp  condescending_sutherland
8a61aaadfef1  docker.io/testcontainers/ryuk:0.5.1  /bin/ryuk             55 seconds ago      Up 55 seconds      0.0.0.0:36247->8080/tcp  testcontainers-ryuk-3ba85f20-bfe2-40df-813c-72e7407b8ff0

Wait a few seconds, then check podman ps -a again. After a short time, no containers should be left running.

@github-actions github-actions bot added the needs-triage Needs thorough attention from code reviewers label Dec 21, 2023
@andrewazores andrewazores added ci and removed needs-triage Needs thorough attention from code reviewers docs labels Dec 21, 2023
@andrewazores andrewazores changed the title docs(testing): update local development test docs for container cleanup ci(db): clean up database container after test run Dec 21, 2023
@andrewazores andrewazores marked this pull request as ready for review January 18, 2024 19:17
@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 1/18/2024, 4:20:54 PM. View Actions Run.

Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7576112712

1 similar comment
Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat3/actions/runs/7576112712

Copy link
Member

@mwangggg mwangggg left a comment

Choose a reason for hiding this comment

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

lgtm

@andrewazores andrewazores merged commit 0e3fedb into cryostatio:main Jan 19, 2024
14 checks passed
@andrewazores andrewazores deleted the test-db-cleanup branch January 19, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Task] Test runs leave dangling database containers
2 participants