Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UV-5 - Enhance docs #6

Merged
merged 13 commits into from
Oct 9, 2024
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
```
21 changes: 13 additions & 8 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
# 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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why this port comes from? If this is Oolama specific, then mention this. If this is ours then explain that it is user-definable through ENV and that this is just a default.

3. If you are unable to log in, contact the administrator of the instance and request that they create a new user account for you.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this, not needed for the doc


## 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 +32,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 +45,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