From 781f3cb93f6f463d6f4e10a133463c49e7b5b111 Mon Sep 17 00:00:00 2001 From: Rodney Osodo Date: Mon, 26 Aug 2024 16:10:47 +0300 Subject: [PATCH 1/2] chore(ci): Add markdown linter --- .github/workflows/linter.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..24b6713 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,28 @@ +name: Linter + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + ci: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: latest + + - name: Install markdownlint-cli + run: npm install -g markdownlint-cli + + - name: run markdownlint + run: markdownlint --disable MD013 -- docs From 325991336f6f6d76e811bae33f759b235b92d624 Mon Sep 17 00:00:00 2001 From: Rodney Osodo Date: Mon, 26 Aug 2024 16:11:18 +0300 Subject: [PATCH 2/2] chore(linter): fix linting errors on markdown files Signed-off-by: Rodney Osodo --- .github/workflows/publish.yml | 3 +-- README.md | 1 - docs/architecture.md | 16 +++++++++------- docs/backends.md | 16 +++++++++++++++- docs/billing.md | 2 +- docs/certs.md | 17 ++++++++++++++--- docs/computations.md | 6 +++--- docs/getting-started.md | 17 +++++++++++++++-- docs/index.md | 2 +- docs/policies.md | 4 +--- docs/projects.md | 13 +++++++++---- docs/ui.md | 1 - docs/users.md | 18 +++++++++++------- 13 files changed, 80 insertions(+), 36 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fbbbcba..2536637 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,11 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout master - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CUSTOM_DOMAIN: docs.prism.ultraviolet.rs diff --git a/README.md b/README.md index a5afd01..30d1617 100644 --- a/README.md +++ b/README.md @@ -39,5 +39,4 @@ mkdocs serve Then just point the browser to [http://127.0.0.1:8000](http://127.0.0.1:8000). - [docs]: https://docs.prism.ultraviolet.rs diff --git a/docs/architecture.md b/docs/architecture.md index 7a43a33..c5008aa 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,5 +1,6 @@ # Architecture -Prism provides a computation management service for [CoCos AI](https://docs.cocos.ultraviolet.rs/). + +Prism provides a computation management service for [CoCos AI](https://docs.cocos.ultraviolet.rs/). ## Components @@ -14,23 +15,24 @@ Prism provides a computation management service for [CoCos AI](https://docs.coco | Invitations | Manages user inivations to access projects. | | User Interface | Provides an web interface to provide platform access over a visual interface. | - - - ![Architecture](img/arch.drawio.png) ### Users -The users service provides users access to the plaform and the user identities are used to provide authorization for the platform. Prism uses [magistrala users](https://docs.magistrala.abstractmachines.fr/architecture/#domain-model) service to achieve this. + +The users service provides users access to the plaform and the user identities are used to provide authorization for the platform. Prism uses [magistrala users](https://docs.magistrala.abstractmachines.fr/architecture/#domain-model) service to achieve this. ### Computations + The computations service give users with the appropriate authorization, the ability to create, update, delete and run computations. ### Backends + The backends service connects to the computations service and receives run requests from computations service which it forwards to manager service. Backends are identified by their ip addresses and have certificates assigned to them for mutual TLS connections with manager. ### Certs -This a certificate authority service that offers the ability to issue, revoke, renew certificates. It also offers an online certificate status protocal `OCSP` endpoint which is used to verify certificates used in backends service. + +This a certificate authority service that offers the ability to issue, revoke, renew certificates. It also offers an online certificate status protocal `OCSP` endpoint which is used to verify certificates used in backends service. ### User Interface -This provides users with a web interface to visually access the platform. It connects to the other services using the sdk. +This provides users with a web interface to visually access the platform. It connects to the other services using the sdk. diff --git a/docs/backends.md b/docs/backends.md index 67609bf..ba7130d 100644 --- a/docs/backends.md +++ b/docs/backends.md @@ -1,4 +1,5 @@ # Backends Service + The backends service provides a means to manage backends which is where computations run. The service allows the creation, update, viewing and deletion of a backend. The service also manages connections to different backends and monitors them as well as securing the connection with mutual TLS. The service also enables the termination of the manager service running on the backend. A backend can be described as consisting on manager running on the host, along with agent in a virtual machine in a Trusted Execution Environment. @@ -6,11 +7,13 @@ A backend can be described as consisting on manager running on the host, along w ![Backend](img/backend.drawio.png) ## Creating a Backend + This can be done on the user interface as below: ![New backend](img/ui/new%20backend.png) or by running: + ```bash curl -sSiX POST https://prism.ultraviolet.rs/backends -H "Content-Type: application/json" -H "Authorization: Bearer " -d @- << EOF { @@ -32,11 +35,13 @@ Content-Length: 0 ``` ## Updating backend + This can be done on the user interface: ![Update Backend](img/ui/update%20backend.png) or on curl: + ```bash curl -sSiX PUT https://prism.ultraviolet.rs/backends/ -H "Content-Type: application/json" -H "Authorization: Bearer " -d @- << EOF { @@ -48,6 +53,7 @@ EOF ``` response: + ```bash HTTP/1.1 200 OK Content-Type: application/json @@ -56,6 +62,7 @@ Content-Length: 0 ``` ## Listing Backends + List of backends is viewable on the ui: ![list_backends](img/backends_page.png) @@ -78,6 +85,7 @@ Content-Length: 165 ``` ## View Backend + An individual backend can be viewed on ui where it's details such as address, status, ID, certs and information can be acquired. Certs management is also carried out on this page. ![backend](img/backend.png) @@ -100,6 +108,7 @@ Content-Length: 129 ``` ## View Backend Information + For a SEV enabled backend, the backend information can be viewed using prism. This information is measured by a Rust script found [here](https://github.com/ultravioletrs/cocos/blob/main/scripts/backend_info/src/main.rs). Once compiled and the binary is stored in `/build`, the backend information can be measured by Prism as shown below. On the backend page, click the Backend Information button: @@ -142,10 +151,10 @@ The backend_info.json file is useful in cocos for [attested TLS](https://docs.co "disallow_network": false } } - ``` ## Terminate Backend + This is used to disconnect and close the associated backend connection. This is usually triggered when a certificate is revoked while the backend is connected using this certificate or user initiated for any reason. Please note that this action will stop all ongoing computations and stop manager and any running agent. @@ -156,10 +165,12 @@ curl -sSiX GET https://prism.ultraviolet.rs/backends/terminate// -H "Authori ``` Response: + ```bash HTTP/1.1 204 No Content Content-Type: application/json diff --git a/docs/billing.md b/docs/billing.md index 92c3820..07862f1 100644 --- a/docs/billing.md +++ b/docs/billing.md @@ -48,4 +48,4 @@ If the payment is successful, you will be redirected to the projects page to pro The payment details of the current session are stored, and these can be changed by clicking the update payment details button as shown below: -![Update Payment Details](img/update_payment_details.png) \ No newline at end of file +![Update Payment Details](img/update_payment_details.png) diff --git a/docs/certs.md b/docs/certs.md index f73af7e..02a6388 100644 --- a/docs/certs.md +++ b/docs/certs.md @@ -1,13 +1,16 @@ # Certs Service + The certs service is a certificate authority used to issue certs related to backends service for mutual TLS purposes. The certs service provides the ability to issue, renew, revoke and download certificates. ## Issue a Certificate + This is the creation of a certificate associated with a specific backend. This can be done on the UI on the specific backend page, by clicking on issue cert button. ![Issue Certificate](img/ui/issue%20cert.png) This can be done on curl using: + ```bash curl -sSiX POST https://prism.ultraviolet.rs/certs/issue/backend/ -H "Content-Type: application/json" -H "Authorization: Bearer " -d @- << EOF { @@ -17,6 +20,7 @@ EOF ``` example: + ```bash curl -sSiX POST https://prism.ultraviolet.rs/certs/issue/backend/fde3263e-70b8-4ce9-9f3c-4a203a0dcdf5 -H "Content-Type: application/json" -H "Authorization: Bearer " -d @- << EOF { @@ -26,6 +30,7 @@ EOF ``` response: + ```bash HTTP/1.1 201 Created Content-Type: application/json @@ -36,6 +41,7 @@ Content-Length: 59 ``` ## Download a Certificate + This is a two step process. First we'll obtain a short lived token. Then using this token we'll be able to download the zip file containing the associated cert. First we'll request a download token: @@ -62,11 +68,12 @@ curl -L -X GET https://prism.ultraviolet.rs/certs//download -G -d ``` example: + ```bash curl -L -X GET https://prism.ultraviolet.rs/certs/75709155906162784911683514578929321876/download -G -d "token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTQ2NTIzMTYsImlzcyI6IlVsdHJhdmlvbGV0Iiwic3ViIjoiY2VydHMifQ.lvFgVSKAyn2UNeJg1OA4fGxDDZ6pylZTn9UZhrfWR9I" --output certs.zip ``` -On the UI we'll click on request download button, followed by download certs to obtain the certs. +On the UI we'll click on request download button, followed by download certs to obtain the certs. ![Request Download](img/ui/request%20download.png) @@ -75,6 +82,7 @@ On the UI we'll click on request download button, followed by download certs to This results in three files `ca.pem`, `cert.pem` and `key.pem` which we'll use with CoCo's manager to bring the backend online. ## Renew Certificate + Certificates can be renewed before they expire. This will move their expiry date to a future one. ![Renew Certificate](img/ui/renew.png) @@ -84,6 +92,7 @@ curl -sSiX PATCH https://prism.ultraviolet.rs/certs//renew -H "Au ``` response: + ```bash HTTP/1.1 200 OK Content-Type: application/json @@ -92,6 +101,7 @@ Content-Length: 0 ``` ## Revoke Certificate + Certificates can be revoked, which means they can no longer be used for connecting to backends service. Revoked certificates cannot be renewed. ![Renew Certificate](img/ui/revoke.png) @@ -101,6 +111,7 @@ curl -sSiX PATCH https://prism.ultraviolet.rs/certs//revoke -H "A ``` response: + ```bash HTTP/1.1 200 OK Content-Type: application/json @@ -115,6 +126,7 @@ curl -sSiX GET https://prism.ultraviolet.rs/certs -H "Authorization: Bearer " -d @- << EOF { @@ -171,6 +178,7 @@ EOF ``` response: + ```bash HTTP/1.1 201 Created Content-Type: application/json @@ -181,6 +189,7 @@ Content-Length: 59 ``` ### Download Certificate + First we'll request a download token: ```bash @@ -207,6 +216,7 @@ curl -L -X GET https://prism.ultraviolet.rs/certs//download -G -d ``` example: + ```bash curl -L -X GET https://prism.ultraviolet.rs/certs/75709155906162784911683514578929321876/download -G -d "token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTQ2NTIzMTYsImlzcyI6IlVsdHJhdmlvbGV0Iiwic3ViIjoiY2VydHMifQ.lvFgVSKAyn2UNeJg1OA4fGxDDZ6pylZTn9UZhrfWR9I" --output certs.zip ``` @@ -215,12 +225,13 @@ curl -L -X GET https://prism.ultraviolet.rs/certs/757091559061627849116835145789 This results in three files `ca.pem`, `cert.pem` and `key.pem` which we'll use with CoCo's manager to bring the backend online. - ### Connect backend + To connect a backend we need to start manager. Follow the getting started [guide](https://docs.cocos.ultraviolet.rs/getting-started/) on cocos to get up to speed. We'll then run manager to connect the backend. example: + ```bash MANAGER_GRPC_URL=192.168.100.4:7011 MANAGER_LOG_LEVEL=debug MANAGER_QEMU_USE_SUDO=false MANAGER_QEMU_ENABLE_SEV=false MANAGER_QEMU_SEV_CBITPOS=51 MANAGER_QEMU_OVMF_CODE_FILE=/usr/share/edk2/x64/OVMF_CODE.fd MANAGER_QEMU_OVMF_VARS_FILE=/usr/share/edk2/x64/OVMF_VARS.fd MANAGER_QEMU_ENABLE_SEV_SNP=false MANAGER_GRPC_CLIENT_CERT=cert.pem MANAGER_GRPC_CLIENT_KEY=key.pem MANAGER_GRPC_SERVER_CA_CERTS=ca.pem go run main.go ``` @@ -231,6 +242,7 @@ This can be viewed by: ```bash curl -sSiX GET https://prism.ultraviolet.rs/backends/ -H "Authorization: Bearer " ``` + response: ```bash @@ -293,6 +305,7 @@ Content-Length: 0 ![New computation](img/ui/new%20computation.png) ### Run Computation + Next we'll run the computation: ```bash @@ -300,6 +313,7 @@ curl -sSiX POST https://prism.ultraviolet.rs/computations//run - ``` response: + ```bash HTTP/1.1 200 OK Content-Type: application/json @@ -312,7 +326,6 @@ Content-Length: 0 This will result in events and logs from agent and manager visible on the ui. ![Events and Logs](img/ui/logsEvents.png) - ### Get One Computation In order to get one specific computation, by ID: diff --git a/docs/index.md b/docs/index.md index 4f490f0..4934aab 100644 --- a/docs/index.md +++ b/docs/index.md @@ -24,4 +24,4 @@ Prism AI offers several key features: 5. **Logging and Monitoring**: Provides comprehensive tracking and auditing capabilities. 6. **User-Friendly Interface**: Simplifies complex AI workflow management. -These features make it ideal for sensitive industries like healthcare, finance, and government. For more details, visit the [Prism AI page](https://ultraviolet.rs/prism.html). \ No newline at end of file +These features make it ideal for sensitive industries like healthcare, finance, and government. For more details, visit the [Prism AI page](https://ultraviolet.rs/prism.html). diff --git a/docs/policies.md b/docs/policies.md index df9d2c9..d95e639 100644 --- a/docs/policies.md +++ b/docs/policies.md @@ -101,7 +101,6 @@ On the UI the steps are as follows: 4. Select required details and click on 'Update'. ![Update Policy Page](img/ui/update_computation_policy.png) - ### Lisiting Computation Policies As an administrator/computation owner, you can list all the policies in a computation, while as a user you can only list your own policies in a computation. @@ -138,7 +137,7 @@ Content-Length: 1785 "created_at": "0001-01-01T00:00:00Z", "updated_at": "2024-05-26T10:48:49.111668Z", "updated_by": "c25537fd-39ad-4b36-b180-e90dfb477fcd" - }, + }, ... ] } @@ -179,5 +178,4 @@ On the UI the steps are as follows: 3. Click on the delete button on any of the policies to delete. ![List Policies](img/ui/computation_policies.png) - If you delete policies, the policy will be removed from the policy storage. Further authorization checks related to that policy will fail. diff --git a/docs/projects.md b/docs/projects.md index 6a4db8c..75fc000 100644 --- a/docs/projects.md +++ b/docs/projects.md @@ -44,6 +44,7 @@ Content-Length: 235 ``` On the ui the steps are as follows: + 1. Log in to prism platform with a user with administrator permission. 2. On successfully log in, projects page is displayed. Click on 'New Project'. ![Projects page](img/ui/projects.png) @@ -90,6 +91,7 @@ Content-Length: 294 ``` On the ui the steps are as follows: + 1. Click on 'Projects' on the navigation panel to view project details. ![Project Details](img/ui/project details.png) @@ -106,7 +108,7 @@ curl -isSX GET https://prism.ultraviolet.rs/auth/domains/ -H "Conten For example: ```bash -curl -sSiX GET https://prism.ultraviolet.rs/auth/domains/127910df-7eca-42dc-a625-1f8fda70229c -H "Content-Type: application/json" -H "Authorization: Bearer " +curl -sSiX GET https://prism.ultraviolet.rs/auth/domains/127910df-7eca-42dc-a625-1f8fda70229c -H "Content-Type: application/json" -H "Authorization: Bearer " HTTP/1.1 200 OK Content-Type: application/json @@ -126,10 +128,10 @@ Content-Length: 294 ``` On the ui the steps are as follows: + 1. Click on 'Projects' on the navigation panel to view project details. ![Project Details](img/ui/project details.png) - ## Get projects To paginate the results, use `offset`, `limit`, `metadata`, `name`, `status`, `parentID`, `ownerID`, `tree` and `dir` as query parameters. @@ -141,7 +143,7 @@ curl -isSX GET https://prism.ultraviolet.rs/auth/domains/ -H "Content-Type: appl For example: ```bash -curl -sSiX GET https://prism.ultraviolet.rs/auth/domains/ -H "Content-Type: application/json" -H "Authorization: Bearer " +curl -sSiX GET https://prism.ultraviolet.rs/auth/domains/ -H "Content-Type: application/json" -H "Authorization: Bearer " HTTP/1.1 200 OK Content-Type: application/json @@ -188,6 +190,7 @@ Content-Length: 898 ``` On the ui the steps are as follows: + 1. Click on user profile at the top right, then click on "Projects" on the menu. This navigates to the projects page. ![User Profile](img/ui/profile.png) 2. Project page is displayed. @@ -225,13 +228,13 @@ Content-Length: 0 ``` On the ui the steps are as follows: + 1. From Project details page, click on 'Members'. This navigates to Members page. ![Project Details](img/ui/proj details members.png) 2. From Member page, click on 'Assign Member'. A modal dialog will appear that allowing member relation assignment. ![Assign Member](img/ui/assign member.png) - ## Members To paginate the results, use `offset`, `limit`, `metadata`, `name`, `status`, `parentID`, `ownerID`, `tree` and `dir` as query parameters. @@ -268,8 +271,10 @@ Content-Length: 216 ] } ``` + On the ui steps are as follows: On the ui, steps are as follows: + 1. From Project details page, click on 'Members'. This navigates to Members page. ![Project Details](img/ui/proj details members.png) 2. Project members page is displayed. diff --git a/docs/ui.md b/docs/ui.md index aea0aa3..5ef5d4b 100644 --- a/docs/ui.md +++ b/docs/ui.md @@ -54,5 +54,4 @@ Once the customer is created, the user can select one of the plans created by th Once selected, the user will be prompted to make the payment. Once the payment is successful, the user will be subscribed to the plan and the billing will be active. - ![Payment Page](img/payment.png) diff --git a/docs/users.md b/docs/users.md index bbb9641..dcbda29 100644 --- a/docs/users.md +++ b/docs/users.md @@ -145,6 +145,7 @@ X-Xss-Protection: 1; mode=block ``` On the ui the steps are as follows: + 1. Click 'Users' on the navigation panel to display Users page. Then click 'New User' at the top right. ![Users](img/ui/users.png) 2. Fill in the required fields on the Create User page. Once done click 'Create User'. @@ -177,6 +178,7 @@ Content-Length: 212 ``` On the ui the steps are as follows: + 1. Click on user profile at the top right. ![User Profile](img/ui/profile.png) @@ -222,11 +224,11 @@ Content-Length: 1087 ``` On the ui the steps are as follows: -1. Click 'Users' on the navigation panel to display Users page. Then click a user name from the list of users. This navigates to User Details page. + +1. Click 'Users' on the navigation panel to display Users page. Then click a user name from the list of users. This navigates to User Details page. ![Users](img/ui/users list.png) ![Users Details](img/ui/user details.png) - ## Get Users You can get all users in the database by querying `/users` endpoint. @@ -290,7 +292,8 @@ Content-Length: 44 ``` On the ui the steps are as follows: -1. Click 'Users' on the navigation panel to display Users page. Then click a user name from the list of users. This navigates to User Details page. + +1. Click 'Users' on the navigation panel to display Users page. Then click a user name from the list of users. This navigates to User Details page. ![Users](img/ui/users list.png) ## Update User @@ -336,7 +339,8 @@ Content-Length: 391 ``` On the ui the steps are as follows: -1. Click 'Users' on the navigation panel to display Users page. Then click a user name from the list of users. This navigates to User Details page. + +1. Click 'Users' on the navigation panel to display Users page. Then click a user name from the list of users. This navigates to User Details page. ![Users](img/ui/users list.png) 2. Click 'Update User'. ![User Details](img/ui/user details.png) @@ -579,13 +583,13 @@ For example: ```bash curl -sSiX GET https://prism.ultraviolet.rs/domains -H "Authorization: Bearer " - + HTTP/1.1 200 OK Content-Type: application/json Date: Sat, 25 May 2024 09:09:58 GMT Content-Length: 304 -{ +{ "total":1,"offset":0, "limit":10, "domains": [ @@ -601,4 +605,4 @@ Content-Length: 304 } ] } -``` \ No newline at end of file +```