This program has three pods with three diffrent services:
- 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;
- A NoSQL database (Couch DB) to store the server utilization log (JSON) retrieved above;
- A web app with a dashboard to display the daily average of the provider utilization such as CPU, GPU, Memory and Storage allocated;
These instructions will cover usage information the Cloudmos Deploy of this project.
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
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 nameCOUCHDB_DESIGN_DOC- The database design docCOUCHDB_CPU_VIEW- The database index for CPU dataCOUCHDB_GPU_VIEW- The database index for GPU dataCOUCHDB_MEMORY_VIEW- The database index for Memory dataCOUCHDB_STORAGE_VIEW- The database index for Storage dataPROVIDER_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
couchdb_data- This is where CouchDB persists its data.
-
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
-
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.
- 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.
The composition is configured with named volumes so your data will be persistent across container restarts.
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.