OCP Diag Result Viewer can be used as a
- Local web server
- CLI tool
- Web service with customized hosting (currently supporting Google Cloud Storage)
- Make sure you have both
npm
andpdm
installed - Run
pdm install
to install dependencies - Run
pdm run server
- Open the link shown in the terminal (should be http://127.0.0.1:5000)
Local web server uses local storage to save files. To upload your data to a permanent remote storage, see How to integrate with your own Google Cloud Storage
- On the home page, you will see a form to directly upload a local file. If the file is of valid OCP format, the view will redirect to the HTML page presenting the test results
- To upload a remote file using absolute URL
Append the absolute encoded URL of the remote file to the parameter
file
in the GET requesthttp://127.0.0.1:5000/upload?file=[encoded_url_to_file]
- Make sure you have both
npm
andpdm
installed - Run
pdm install
to install dependencies - Run
pdm run frontend-build
- Run
pdm run client-build
- The binary should be compiled at ./bin/ocp-diag-result-viewer
- Save a result as an html file
$ ./bin/ocp-diag-result-viewer html test.output -o test.html
- Display logs in table format
$ ./bin/ocp-diag-result-viewer log test.output
Seq Num | Timestamp | Severity | Stage | Name | Category | Message
--------+--------------------------------+------------+---------+---------------+-------------+----------------------------------
0 | 2021-11-29T05:52:21.879371116Z | INFO | Run | | Start | text
1 | 2021-11-29T05:52:21.881564737Z | INFO | Step 1 | Step 1 | Measurement | text
2 | 2021-11-29T05:52:21.881880783Z | INFO | Step 2 | Step 2 | Diagnosis | [PASS] test passed
You can uncomment the contents in the config.toml
file and add your own GCS bucket names and other variables like source location maps and allowed domains.
Using Google Cloud Storage Secret Manager
The same contents in the config.toml
file can be put into a secret file. This abstracts out your organization's internal details from the public.
To fetch the secret, you need to set 2 environment variables: your GCS project name and the name of your secret.
Note: To make sure OCP Diag Result Viewer uses your GCS configurations, make sure to delete the config.toml
file.
GOOGLE_CLOUD_PROJECT="project-ABC" GOOGLE_CLOUD_SECRET_NAME="secret_name" pdm run server
Note: You need to run gcloud auth application-default login
first for this method to work
- Support more storage options eg. AWS
For bug reports/feedback/future request, please send an email to [email protected]