Skip to content

Commit

Permalink
chore: embedder add pgvector (and fixes) (#9341)
Browse files Browse the repository at this point in the history
* chore: add pgvector to development environment Postgres

* fix: MailManagerDebug now always creates file paths under the O/S limit

* fix: bump rethinkdb-ts (fixes development errors on my system)

* chore: review fixes
  • Loading branch information
jordanh committed Jan 18, 2024
1 parent 3a7145e commit 0fae983
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
id-token: "write"
services:
postgres:
image: postgres:15.4
# Image is pinned to v15, OK since it's just for testing
image: ankane/pgvector
# This env variables must be the same in the file PARABOL_BUILD_ENV_PATH
env:
POSTGRES_PASSWORD: "temppassword"
Expand Down
4 changes: 3 additions & 1 deletion packages/server/email/MailManagerDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ export default class MailManagerDebug extends MailManager {
Subject: ${subject}
Body: ${body}`)

const toStr = to.toString()

const {html} = options
// limit filename length so it does not exceed filesystem limits
const filename = `${to.slice(0, 50)}-${subject.replaceAll(' ', '-').slice(0, 180)}.html`
const filename = `${toStr.slice(0, 50)}-${subject.replaceAll(' ', '-').slice(0, 180)}.html`
const folder = '/tmp'
fs.writeFileSync(`${folder}/${filename}`, html)
// make it a link so you can click it in the terminal
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"relay-runtime": "^14.1.0",
"rethinkdb-ts": "2.5.1",
"rethinkdb-ts": "2.6.0",
"rrule": "^2.7.2",
"samlify": "^2.8.2",
"sharp": "^0.32.6",
Expand Down
9 changes: 8 additions & 1 deletion packages/server/postgres/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ FROM postgres:15.4

ADD extensions /extensions

RUN apt-get update && apt-get install -y build-essential locales
RUN apt-get update && apt-get install -y \
build-essential \
locales \
postgresql-server-dev-15 \
git

RUN cd /extensions/postgres-json-schema && make install && make installcheck
RUN git clone --branch v0.5.0 \
https://github.com/pgvector/pgvector.git /extensions/pgvector && \
cd extensions/pgvector && make clean && make && make install

RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

Expand Down
1 change: 1 addition & 0 deletions packages/server/postgres/extensions/install.sql
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CREATE EXTENSION IF NOT EXISTS "postgres-json-schema";
CREATE EXTENSION IF NOT EXISTS "vector";
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12898,6 +12898,7 @@ draft-js-utils@^1.4.0:

"draft-js@https://github.com/mattkrick/draft-js/tarball/559a21968370c4944511657817d601a6c4ade0f6":
version "0.10.5"
uid "025fddba56f21aaf3383aee778e0b17025c9a7bc"
resolved "https://github.com/mattkrick/draft-js/tarball/559a21968370c4944511657817d601a6c4ade0f6#025fddba56f21aaf3383aee778e0b17025c9a7bc"
dependencies:
fbjs "^0.8.15"
Expand Down Expand Up @@ -21054,7 +21055,7 @@ rethinkdb-ts-migrate@^0.3.6:
sucrase "^3.21.0"
tslib "^2.4.0"

rethinkdb-ts@2.5.1, rethinkdb-ts@2.6.0, rethinkdb-ts@^2.4.5:
rethinkdb-ts@2.6.0, rethinkdb-ts@^2.4.5:
version "2.6.0"
resolved "https://registry.yarnpkg.com/rethinkdb-ts/-/rethinkdb-ts-2.6.0.tgz#25ad1561d58836761463718470310b4bf911f9eb"
integrity sha512-RKkTP/P1dNNK265qmNjBqiiWlawRw7+MNVoro9UJa8RPvdB9+MJwzWxz7rgTLrfJr77FuaRQMqzlRexx6ivfUQ==
Expand Down

0 comments on commit 0fae983

Please sign in to comment.