Skip to content

Zblocker64/provider-stats

Repository files navigation

Provider Utilization Dashboard

This program has three pods with three diffrent services:

  1. A shell script that runs periodically (the frequency is configurable) making a gRPCurl request to a server with reflection enabled to retrieve the current provider utilization data and store the JSON response in a database;
  2. A NoSQL database (Couch DB) to store the server utilization log (JSON) retrieved above;
  3. A web app with a dashboard to display the daily average of the provider utilization such as CPU, GPU, Memory and Storage allocated;

Getting Started

These instructions will cover usage information the Cloudmos Deploy of this project.

Deploying

You'll need an Akash wallet with at least 0.5 AKT. You can use any deploy tool that you would like to. I will use Cloudmos but you and use the Akash Console or the Akash CLI

Environment Variables

  • COUCHDB_USER - The admin user for CouchDB.
  • COUCHDB_PASSWORD - The password for the CouchDB admin user.
  • COUCHDB_URL - The Couch DB URL, like: "http://admin:password@couchdb:5984"
  • COUCHDB_DB_NAME - The database name
  • COUCHDB_DESIGN_DOC - The database design doc
  • COUCHDB_CPU_VIEW - The database index for CPU data
  • COUCHDB_GPU_VIEW - The database index for GPU data
  • COUCHDB_MEMORY_VIEW - The database index for Memory data
  • COUCHDB_STORAGE_VIEW - The database index for Storage data
  • PROVIDER_URL - The provider URL the service will pull from

Be aware that when changing the COUCHDB_USER and COUCHDB_PASSWORD values, it's necessary to change in both containers environment variables

Volumes

  • couchdb_data - This is where CouchDB persists its data.

Accessing the Applications

  • CouchDB: To access CouchDB UI, navigate to URL that Cloudmos gives you in your web browser. Login with the COUCHDB_USER and COUCHDB_PASSWORD configured in your environment variables. You will need to add /_utils/ to the end of your URL

    Screenshot 2024-05-17 at 10 48 07 AM
  • Flask App: Your Flask application will be available at the url Cloudmos gives you. You can also set a custom domain specified in the SDL like I have.

Screenshot 2024-05-17 at 10 48 38 AM
  • gRPC Poller: This service depends on the CouchDB and performs periodic polling, you can adjust the interval by setting the REQUEST_INTERVAL environment variable. No need to access this after deployment.

Persistent Data

The composition is configured with named volumes so your data will be persistent across container restarts.

Troubleshooting

While there should be no issue deploying, sometimes the Database doesnt intizaliaze correctly. If you dont see any data on your web dashboard, log into the database using the DB URL. Login using your username and password you set. Go to the set up tab. Select single node and re enter your username and password. This will fix the issue and you should see data within 15 minutes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published