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

Tox command added for readiness #8828

Merged
merged 11 commits into from
May 30, 2024
Merged

Tox command added for readiness #8828

merged 11 commits into from
May 30, 2024

Conversation

snwagh
Copy link
Contributor

@snwagh snwagh commented May 16, 2024

Description

  • Adding a new tox command called dev.k8s.ready that will check a k8s deployment for readiness of various services.
    • Run the command as tox -e dev.k8s.ready -- frontend backend proxy to check if frontend, backend, proxy are ready. The full set of posargs is {frontend backend proxy mongo seaweedfs registry} (order is immaterial).
    • Also checks curl http://localhost:${CLUSTER_HTTP_PORT}/api/v2/metadata
  • Updating the existing end-to-end testing tox environment -- syft.test.helm
    • to use dev.k8s.ready
    • additionally check the health of seaweedfs and registry services (missing previously)
    • add an override posarg that will allow syft to be deployed in resource constrained environments (more notes below)

Affected Dependencies

NA

How has this been tested?

  • Run tox -e syft.test.helm
  • Or manually deploy using this notebook and run CLUSTER_NAME=<CLUSTER_NAME> tox -e dev.k8s.ready -- frontend seaweedfs registry to check health of frontend, seaweedfs, and registry

Resource constraint testing

Testing succeeded all the way down till a single CPU and 2GB of RAM (Hypothesis is that things should work till about 1.5GB give or take; 1CPU, 1GB unfortunately gets all but the backend pod running)! Follow these instructions to witness this incredible feat of achievement by the Syft team!

  • Go to Docker Desktop --> Settings --> Resources and set the CPU to 1, RAM to 2GB.
  • Run tox -e syft.test.helm -- override (this will run all the notebook tests). Except notebooks/api/0.8/11-container-images-k8s.ipynb all other tests should pass (if you set about 4GB of RAM, this test should pass as well).

Set resource constraints
Screenshot 2024-05-17 at 2 42 53 PM

Check for successful deployment using k9s
Screenshot 2024-05-17 at 2 18 33 PM

Notebook tests
Screenshot 2024-05-17 at 2 26 38 PM

Docker resource usage
Screenshot 2024-05-17 at 2 18 53 PM

11th Test (notebooks/api/0.8/11-container-images-k8s.ipynb) with 4GB RAM.
Screenshot 2024-05-22 at 10 16 08 PM

Checklist

@snwagh snwagh changed the title WIP: Tox command added for readiness but has bugs Tox command added for readiness but has bugs May 17, 2024
@snwagh snwagh changed the title Tox command added for readiness but has bugs Tox command added for readiness May 22, 2024
Copy link
Member

@itstauq itstauq left a comment

Choose a reason for hiding this comment

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

Great job @snwagh 🚀. Left some minor comments.

tox.ini Outdated Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
tox.ini Show resolved Hide resolved
@snwagh snwagh enabled auto-merge May 30, 2024 11:50
@snwagh snwagh merged commit 37855b3 into dev May 30, 2024
26 checks passed
@snwagh snwagh deleted the snwagh/tox-for-k8s-readiness branch May 30, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants