Skip to content

Commit

Permalink
Merge pull request #6 from JeffMboya/Cube-5
Browse files Browse the repository at this point in the history
UV-5 - Enhance docs
  • Loading branch information
drasko authored Oct 9, 2024
2 parents ee159f7 + ca9ecd4 commit a1c345b
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 8 deletions.
78 changes: 78 additions & 0 deletions docs/developer-guide.md
Original file line number Diff line number Diff line change
@@ -1 +1,79 @@
# Developer Guide

This guide will help you get started with developing, deploying, and running Cube AI.

## Cloning the Repository

```bash
git clone https://github.com/ultravioletrs/cube.git
cd cube
```

## Pulling Docker Images

```bash
cd cube/docker/
docker compose pull
```

## Running Services with Docker Compose

You can run/start Cube AI services using Docker Compose as described in [this guide](https://github.com/ultravioletrs/cube/blob/main/hal/ubuntu/README.md).

To properly access Cube AI UI deployed on a different server, update the IP address entries in `docker/.env` as described in the above guide to point to your server IP address. The Cube AI UI can then be accessed through your browser at:

```bash
http://<your-server-ip-address>:3001
```

For example, if you have deployed locally, use:

```bash
http://localhost:3001
```

## Building Docker Images

You can build the Docker images for Cube AI and related services using the `make` command in the project's root directory.

To build the production Docker image, use:

```bash
make docker
```

For the development Docker image, use:

```bash
make docker-dev
```

## Hardware Abstraction Layer (HAL) for Confidential Computing

For detailed instructions on setting up and building Cube HAL, please refer to [this guide](https://github.com/ultravioletrs/cube/blob/main/hal/buildroot/README.md). It covers:

- Cloning the Buildroot and Cube repositories
- Configuring and building Cube HAL
- Running Cube HAL in a virtual machine

## Cleaning up your Dockerized Cube AI Setup

If you want to stop and remove the Cube AI services, volumes, and networks created during the setup, follow these steps:

First, stop all running containers:

```bash
docker compose down
```

Remove volumes and vetworks:

```bash
docker compose down --volumes --remove-orphans
```

To clean up the build artifacts and remove compiled files, use:

```bash
make clean
```
30 changes: 22 additions & 8 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
# Getting Started

Connect to Cube AI deployed instance on port `:6193`. Login with your username and password. If you can't log in ask the instance administrator to create a new user.
Before logging in or interacting with Cube AI, you need to make sure that Cube AI has been deployed and is running. Deployment can be done by the instance administrator or by you if you have the necessary access permissions. Therefore, to Connect:

1. Ensure that Cube AI is deployed and running on your instance.
2. Connect to the deployed Cube AI instance on port `6193` using your login credentials (username and password).

Port `6193` is our default port for accessing Cube AI deployment. It is configurable through the `.env` file, meaning you can change it to any port that suits your deployment needs as described in [this guide](https://github.com/ultravioletrs/cube/blob/main/hal/ubuntu/README.md)

For example, to customize the port:

```bash
UV_CUBE_UI_BASE_URL=http://<your-instance-ip>:<your-preferred-port>
```

If you are running Cube AI on a different port, make sure to update the environment variable accordingly.

## Create a new user

Follow [this demonstration](https://jam.dev/c/f8d3fa47-7505-4201-b8ca-c0f724826237) to learn how to create a new user. Below are the summarized steps:
If you are the instance administrator (or have administrator credentials), follow [this demonstration](https://jam.dev/c/f8d3fa47-7505-4201-b8ca-c0f724826237) to create a new user. Below are the summarized steps:

1. Admin login with their credentials
2. Create a new domain if there is none
3. Login to the new domain or already existing domain
1. Log in with admin credentials
2. Create a new domain (if needed)
3. Login to the newly created domain (or already existing domain)
4. Click profile icon and navigate to `Manage Users`
5. Click create
6. Fill in the form
7. Click `Create`
8. Share the login credentials (username and password) with the new user

## Login

Get a token from using your login credentials.
Once the administrator creates your account and shares your login details, use the credentials to log in to Cube AI and obtain an authentication token as shown below.

```bash
curl -ksSiX POST https://<cube-ai-instance>/users/tokens/issue -H "Content-Type: application/json" -d @- << EOF
Expand All @@ -27,7 +41,7 @@ curl -ksSiX POST https://<cube-ai-instance>/users/tokens/issue -H "Content-Type:
EOF
```

You'll receive a response similar to this:
Be sure to replace `<your_email>` and `<your_password>` with your actual login details. You'll receive a response similar to this:

```bash
HTTP/2 201
Expand All @@ -40,7 +54,7 @@ content-length: 591
{"access_token":"<access_token>","refresh_token":"<refresh_token>"}
```

The `access_token` field in the response is your API token, which will be used for authentication in future API calls.
The `access_token` field in the response is your API token, which will be used for authentication in future API calls. The `refresh_token` field is a token you can use to obtain a new access token once the current one expires.

## VS Code Setup

Expand Down

0 comments on commit a1c345b

Please sign in to comment.