Step #1: Run the Workflow
In this lab, all of the workflow components have already been deployed, but some work is still needed from the user to replicate a production use case. In reality, a user would not explicitly run these steps; they’d run as scheduled in production.
First, we’ll need to generate an access token to use for the client to authenticate with the cuOpt server. Open the SSH Console from the left pane and run the following command:
curl -k -L -X POST '{{ keycloak_token_endpoint }}' -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'client_id={{ keycloak_client_id }}' --data-urlencode 'grant_type=password' --data-urlencode 'client_secret={{ keycloak_client_secret }}' --data-urlencode 'scope=openid' --data-urlencode 'username={{ keycloak_realm_user }}' --data-urlencode 'password={{ keycloak_realm_user_password }}' | json_pp
If needed, the information below can be used to manually configure Keycloak and/or generate the curl request according to the template below. A link to Keycloak is also provided in the left pane.
curl -k -L -X POST 'TOKEN_ENDPOINT' -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'client_id=CLIENT_ID' --data-urlencode 'grant_type=password' --data-urlencode 'client_secret=CLIENT_SECRET' --data-urlencode 'scope=openid' --data-urlencode 'username=USERNAME' --data-urlencode 'password=PASSWORD' | json_pp
Admin User: admin
Admin Password: {{ keycloak_admin_password }}
Realm Name: {{ keycloak_realm }}
Realm User: {{ keycloak_realm_user }}
Realm Password: {{ keycloak_realm_user_password }}
Client ID: {{ keycloak_client_id }}
Client Secret: {{ keycloak_client_secret }}
Token Endpoint: {{ keycloak_token_endpoint }}
Once you’ve run the curl request, you should receive a JSON string like below
{"access_token":"eyJhbGc...","expires_in":54000,"refresh_expires_in":108000,"refresh_token":"eyJhbGci...","not-before-policy":0,"session_state":"e7e23016-2307-4290-af45-2c79ee79d0a1","scope":"openid email profile"}
Note down the
access_token
, this field will be required later on in the workflow, within the Jupyter notebook.Click the Client link from the left pane to open up Jupyter in your browser. Once Jupyter is open, open the
route-opt-workflow.ipynb
notebook from the left pane. You can then follow and execute the steps in the notebook to run through the workflow of preprocessings the data, sending it to the cuOpt solver, and parsing the routes. Make sure to note down the access token generated in the previous step.NoteYou can use the Shift + Enter key combination to execute a cell in the notebook.
After completing the notebook, we can check our monitoring dashboards to see the requests that were submitted. Click the Grafana link in the left pane, and log in using the credentials below.
Grafana:
User: admin
Password: {{ grafana_password }}
Select the Dashboards icon in the left navigation pane, select browse, expand the cuopt folder, and click Route Optimization NVIDIA DCGM Dashboard.
Review the metrics that are reported from the dashboard. Note the following metrics:
GPU Temperature (in C)
Average GPU temperature (in C)
GPU Power Usage (Power draw in W)
GPU Power Total (Power draw in W)
GPU SM Clocks (frequency in Hz)
GPU Utilization (in %)
Tensor Core Utilization (in %): Ratio of cycles the tensor (HMMA) pipe is active.
GPU Framebuffer Memory Used (in MiB)
Congrats! You’ve just completed running the Route Optimization AI Workflow. Feel free to explore the components deployed as a part of the solution, or proceed to the next section for next steps.