Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/build-and-deploy-on-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Deploy - Merge main
on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Dispatch Workflow
uses: timescale/workflow-dispatch-action@main
with:
github-token: ${{ secrets.ORG_AUTOMATION_TOKEN }}
owner: timescale
repo: tiger-agents-deploy
workflow_id: build.yaml
ref: "main"
inputs: >
{
"repository": "memory-engine",
"sha": "${{ github.sha }}",
"latest": true
}

deploy:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
include:
- env: dev
namespace: savannah-system
- env: prod
namespace: memory-engine
steps:
- name: Dispatch Workflow - ${{ matrix.env }}
uses: timescale/workflow-dispatch-action@main
with:
github-token: ${{ secrets.ORG_AUTOMATION_TOKEN }}
owner: timescale
repo: tiger-agents-deploy
workflow_id: deploy.yaml
ref: "main"
inputs: >
{
"repository": "memory-engine",
"sha": "${{ github.sha }}",
"env": "${{ matrix.env }}",
"namespace": "${{ matrix.namespace }}"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# dependencies (bun install)
node_modules
download

# output
out
Expand Down
17 changes: 17 additions & 0 deletions bun
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

version="bun-v1.3.11"
scriptDir="$(cd "$(dirname "$0")" && pwd)"
downloadDir="$scriptDir/download/bun/${version}"
bunCmd="$downloadDir/bin/bun"

if [ ! -f "$bunCmd" ]; then
echo Installing bun to "$bunCmd"
bashArgs=()
if [ "$version" != "latest" ]; then
bashArgs=(-s "$version")
fi
curl -fsSL https://bun.sh/install | BUN_INSTALL="$downloadDir" bash "${bashArgs[@]}"
fi

exec "$bunCmd" "$@"
13 changes: 13 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions packages/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM oven/bun:1.3.11

WORKDIR /app
CMD ["bun", "run", "packages/server/index.ts"]
EXPOSE 3000

# Reproduce workspace structure so bun.lock is valid
COPY package.json bun.lock ./
COPY packages/server/package.json packages/server/
COPY packages/embedding/package.json packages/embedding/
COPY packages/engine/package.json packages/engine/
COPY packages/worker/package.json packages/worker/
COPY scripts/package.json scripts/
RUN bun install --frozen-lockfile --production --ignore-scripts

ENV NODE_ENV=production

COPY packages/server/tsconfig.json packages/server/index.ts packages/server/
6 changes: 6 additions & 0 deletions packages/server/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bun.serve({
port: process.env.PORT || 3000,
fetch() {
return new Response("memory engine");
},
});
12 changes: 12 additions & 0 deletions packages/server/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "memory-engine-server",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"start": "bun run index.ts"
},
"devDependencies": {
"@types/bun": "^1.3.11"
}
}
24 changes: 24 additions & 0 deletions packages/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"include": ["**/*.ts"],
"compilerOptions": {
"lib": ["ESNext"],
"types": ["@types/bun"],
"target": "ESNext",
"module": "Preserve",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}