Skip to content

Commit

Permalink
migrate opensearch to clickhouse
Browse files Browse the repository at this point in the history
  • Loading branch information
arielweinberger committed Dec 31, 2023
1 parent d30bbc7 commit f55fb17
Show file tree
Hide file tree
Showing 102 changed files with 3,745 additions and 1,782 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@ schema.graphql
temp
tmp

kms/data
kms/data

volumes
17 changes: 16 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
{}
{
"sqltools.connections": [
{
"server": "localhost",
"port": 8123,
"useHTTPS": false,
"database": "default",
"username": "default",
"password": "",
"tls": {},
"previewLimit": 50,
"driver": "ClickHouse",
"name": "Local"
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ npm install

### Spin up infrastructure dependencies via Docker Compose

Pezzo is entirely cloud-native and relies solely on open-source technologies such as [PostgreSQL](https://www.postgresql.org/), [OpenSearch](https://github.com/opensearch-project/OpenSearch), [Redis](https://github.com/redis/redis) and [Supertokens](https://supertokens.com/).
Pezzo is entirely cloud-native and relies solely on open-source technologies such as [PostgreSQL](https://www.postgresql.org/), [ClickHouse](https://github.com/ClickHouse/ClickHouse), [Redis](https://github.com/redis/redis) and [Supertokens](https://supertokens.com/).

You can run these dependencies via Docker Compose:

Expand Down
2 changes: 1 addition & 1 deletion apps/console/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"options": {},
"configurations": {
"local": {
"tags": ["pezzolabs/pezzo/console"],
"tags": ["ghcr.io/pezzolabs/pezzo/console"],
"push": false
}
}
Expand Down
2 changes: 0 additions & 2 deletions apps/console/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { PromptEditView } from "./features/editor/PromptEditView";
import { EditorProvider } from "./lib/providers/EditorContext";
import { PromptTesterProvider } from "./lib/providers/PromptTesterContext";
import { PromptVersionsView } from "./components/prompts/views/PromptVersionsView";
import { PromptMetricsView } from "./components/prompts/views/PromptMetricsView";
import { Suspense } from "react";
import { FullScreenLoader } from "./components/common/FullScreenLoader";
import { OrgPage } from "./pages/projects/OrgPage";
Expand Down Expand Up @@ -158,7 +157,6 @@ export function App() {
}
/>
<Route path="versions" element={<PromptVersionsView />} />
<Route path="metrics" element={<PromptMetricsView />} />
</Route>
</Route>
</Route>
Expand Down
Binary file added apps/console/src/assets/providers/anthropic-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion apps/console/src/assets/providers/anthropic-logo.svg

This file was deleted.

Binary file added apps/console/src/assets/providers/azure-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 0 additions & 23 deletions apps/console/src/assets/providers/azure-logo.svg

This file was deleted.

Binary file added apps/console/src/assets/providers/meta-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/console/src/assets/providers/openai-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion apps/console/src/assets/providers/openai-logo.svg

This file was deleted.

3 changes: 2 additions & 1 deletion apps/console/src/components/metrics/StatisticBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ interface Props {
const getProperties = (
currentValue: number,
previousValue: number,
reverseColors: boolean
reverseColors: boolean,
) => {
const diff = currentValue - previousValue;
// Handle case where previousValue is 0
const calculatedPreviousValue = previousValue === 0 ? 1 : previousValue;

const percentage = Math.abs((diff / calculatedPreviousValue) * 100);

const percentageToRender =
percentage < 1 ? percentage.toFixed(3) : percentage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import { promptProvidersMapping } from "@pezzo/types";
import { PromptService } from "~/@generated/graphql/graphql";

// Logos
import OpenAILogo from "~/assets/providers/openai-logo.svg";
import AzureOpenAILogo from "~/assets/providers/azure-logo.svg";
import AnthropicLogo from "~/assets/providers/anthropic-logo.svg";
import OpenAILogo from "~/assets/providers/openai-logo.png";
import AzureOpenAILogo from "~/assets/providers/azure-logo.png";
import AnthropicLogo from "~/assets/providers/anthropic-logo.png";

export const providersList: ProviderProps[] = [
{
image: (
<img
alt="OpenAI"
src={OpenAILogo}
className="w-6 rounded-sm bg-[#74AA9C] p-[2px]"
className="w-6 rounded-sm"
/>
),
value: PromptService.OpenAiChatCompletion,
Expand All @@ -24,7 +24,7 @@ export const providersList: ProviderProps[] = [
<img
alt="Azure OpenAI"
src={AzureOpenAILogo}
className="w-6 rounded-sm bg-white p-[2px]"
className="w-6 rounded-sm"
/>
),
value: PromptService.AzureOpenAiChatCompletion,
Expand All @@ -35,7 +35,7 @@ export const providersList: ProviderProps[] = [
<img
alt="Anthropic"
src={AnthropicLogo}
className=" w-6 rounded-sm p-[2px]"
className=" w-6 rounded-sm"
/>
),
value: PromptService.AnthropicCompletion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
AlertTitle,
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
} from "@pezzo/ui";
import { AlertCircle } from "lucide-react";
import { cn } from "@pezzo/ui/utils";
Expand Down Expand Up @@ -49,18 +47,7 @@ export const PromptTesterModal = () => {
{!testResult && <VariablesStep onSubmit={handleSubmitVariables} />}
{testResult && (
<div className="w-full">
<RequestDetails
disableCopy
id={testResult.reportId}
request={testResult.request}
response={testResult.response}
provider={testResult.metadata.provider}
calculated={testResult.calculated}
metadata={testResult.metadata}
properties={testResult.properties}
cacheEnabled={testResult.cacheEnabled}
cacheHit={testResult.cacheHit}
/>
<RequestDetails id={testResult.id} />
</div>
)}
</div>
Expand Down
60 changes: 0 additions & 60 deletions apps/console/src/components/prompts/views/PromptMetricsView.tsx

This file was deleted.

Loading

0 comments on commit f55fb17

Please sign in to comment.