Skip to content

Commit

Permalink
Updated readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
jverre committed Sep 2, 2024
1 parent 96581fe commit 89e50e3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 243 deletions.
51 changes: 2 additions & 49 deletions apps/opik-backend/README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,3 @@
# Opik
# Opik backend

How to start the Opik application
---

1. Run `mvn clean install` to build your application
1. Start application with `java -jar target/opik-backend-{project.pom.version}.jar server config.yml`
1. To check that your application is running enter url `http://localhost:8080`

Health Check
---

To see your applications health enter url `http://localhost:8081/healthcheck`

Run migrations
---

1. Check pending
migrations `java -jar target/opik-backend-{project.pom.version}.jar {database} status config.yml`
2. Run migrations `java -jar target/opik-backend-{project.pom.version}.jar {database} migrate config.yml`
3. Create schema
tag `java -jar target/opik-backend-{project.pom.version}.jar {database} tag config.yml {tag_name}`
3. Rollback
migrations `java -jar target/opik-backend-{project.pom.version}.jar {database} rollback config.yml --count 1`
OR `java -jar target/opik-backend-{project.pom.version}.jar {database} rollback config.yml --tag {tag_name}`

Replace `{project.pom.version}` with the version of the project in the pom file.
Replace `{database}` with `db` for MySQL migrations and with `dbAnalytics` for ClickHouse migrations.


```
SHOW DATABASES
Query id: a9faa739-5565-4fc5-8843-5dc0f72ff46d
┌─name───────────────┐
│ INFORMATION_SCHEMA │
│ opik │
│ default │
│ information_schema │
│ system │
└────────────────────┘
5 rows in set. Elapsed: 0.004 sec.
```

* You can curl the ClickHouse REST endpoint
with `echo 'SELECT version()' | curl -H 'X-ClickHouse-User: opik' -H 'X-ClickHouse-Key: opik' 'http://localhost:8123/' -d @-`.
Sample result: `23.8.15.35`.
* You can stop the application with `docker-compose -f apps/opik-backend/docker-compose.yml down`.
If you would like to contribute to the Opik backend, please refer to the [Contribution guide](./CONTRIBUTING.md).
109 changes: 2 additions & 107 deletions apps/opik-documentation/README.md
Original file line number Diff line number Diff line change
@@ -1,108 +1,3 @@
# Documentation
# Opik documentation

The Comet LLM Evaluation documentation has three main components:

1. Documentation website with user guides and tutorials
2. Python SDK reference documentation
3. API reference documentation

## Python SDK

The Python SDK reference documentation is built using Sphinx.

### Setup
In order to generate the reference documentation, you will need use Python 3.10 or later.

You can create the required environment using:

```python
conda create --name py312_docs_opik python=3.12
conda activate py312_docs_opik

cd python-sdk-docs
pip install -r requirements.txt
```

### Development

When building the Sphinx docs, there are two main components:

1. The source code available at `../../../sdks/python` - This is where all the docstrings are defined
2. The Sphinx files available at `./source`

In order to view the Sphinx docs, you can run the following commands:

```
make dev
```

The `python-sdk-docs-dev` command will rebuild the sphinx docs on any changes in the source repo and will also serve the docs on `http://localhost:8000`. If you make any changes to the SDK source code, you will need to run this command again.

### Publishing the docs

To deploy the docs, you can run the following command:

```
pip install -e ../../../sdks/python/
make build
ssh [email protected] 'cd /var/www/html && rm -rf sdk-reference-docs'
scp -r build/html* [email protected]:/var/www/html/sdk-reference-docs
```

**Note:** The `generate-python-sdk-documentation` command will use the opik SDK version you have installed. If you want to use a specific version of the SDK, make sure it is installed and then run the command.

## API reference documentation

The API reference documentation is autogenerated based on OpenAPI specs and served directly from the backend. This ensures the API documentation is always up to date.


## Documentation

The main documentation containing our guides and tutorials are build using Docusaurus.

### Setup

In order to run the documentation locally, you will need to install Node.js. For this we will use `nvm` to install the correct version of Node.js.

```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
```

We will then install the latest version of Node.js.

```
nvm install --lts
nvm use --lts
```

You can install the dependencies by running the following command:

```
cd documentation
npm install
```

### Running the documentation locally
You can run the documentation locally by running the following command:

```
cd documentation
npm run dev
```

**Note:** When running `npm run dev`, cookbooks are rebuild each time a change is saved. For this you will need to have a Python environment running with `jupyter` installed. If you don't have it installed, you can use the command `npm run start` instead to only start docusaurus.

### Publishing the docs

You can publish the docs to the dev server by running the following commands:
```
# Build the files
npm run build
# Remove the existing files
ssh [email protected] 'cd /var/www/html && rm -rf 404.html index.html sitemap.xml assets category evaluation img monitoring quickstart self-host tracing cookbook'
# Push the files
scp -r build/* [email protected]:/var/www/html/
```
If you would like to contribute to the Opik documentation, please refer to the [Contribution guide](./CONTRIBUTING.md).
82 changes: 2 additions & 80 deletions apps/opik-frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,3 @@
# React Comet Opik
# Opik frontend

This is a frontend part of Comet Opik project

## Getting Started

### Install

Access the project directory.

```bash
cd apps/opik-frontend
```

In order to run the frontend, you will need to have node available locally. For
this recommend installing [nvm](https://github.com/nvm-sh/nvm). For this guide
we will assume you have nvm installed locally:

```bash
# Use version 20.15.0 of node
nvm use lts/iron

npm install
```

Start Develop serve with hot reload at <http://localhost:5173>.
The dev server is set up to work with Opik BE run on http://localhost:8080. All requests that tarts with `/api` prefix is proxying to it.
The server port can be changed in `vite.config.ts` file section `proxy`.

```bash
npm start
```

### Lint

```bash
npm run lint
```

### Typecheck

```bash
npm run typecheck
```

### Build

```bash
npm run build
```

### Test

```bash
npm run test
```

View and interact with your tests via UI.

```bash
npm run test:ui
```

## Comet Integration

In order to run the frontend locally with the Comet integration we have to run the frontend in `comet` mode, but first, we should override the environment variables

1. Create a new `.env.comet.local` file with this content:

```
VITE_BASE_URL=/opik/
VITE_BASE_API_URL=/opik/api
VITE_BASE_COMET_URL=https://staging.dev.comet.com/
VITE_BASE_COMET_API_URL=https://staging.dev.comet.com/api
```

2. Now you can start the frontend in `comet` mode:

```bash
npm start -- --mode=comet
```
If you would like to contribute to the Opik frontend, please refer to the [Contribution guide](./CONTRIBUTING.md).
3 changes: 3 additions & 0 deletions deployment/installer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Opik installer

If you would like to contribute to the Opik installer, please refer to the [Contribution guide](./CONTRIBUTING.md).
9 changes: 2 additions & 7 deletions sdks/python/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# opik-python
# Opik Python SDK

To install package in development mode run `pip install -e .` from the repository root directory.

# Linters

Before pushing your changes please run `pre-commit run --all-files` from the python/sdk directory.
It will install and run required linters.
If you would like to contribute to the Opik python SDK, please refer to the [Contribution guide](./CONTRIBUTING.md).

0 comments on commit 89e50e3

Please sign in to comment.