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

Release SQS for self-host users (single image, docker compose, Kubernetes) #13999

Merged
merged 16 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 5 additions & 1 deletion hosting/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ services:
BB_ADMIN_USER_PASSWORD: ${BB_ADMIN_USER_PASSWORD}
PLUGINS_DIR: ${PLUGINS_DIR}
OFFLINE_MODE: ${OFFLINE_MODE:-}
SQS_SEARCH_ENABLE: "true"
COUCH_DB_SQL_URL: "http://${COUCH_DB_USER}:${COUCH_DB_PASSWORD}@couchdb-service:4984"
depends_on:
- worker-service
- redis-service
Expand Down Expand Up @@ -54,6 +56,8 @@ services:
REDIS_URL: redis-service:6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
OFFLINE_MODE: ${OFFLINE_MODE:-}
SQS_SEARCH_ENABLE: "true"
COUCH_DB_SQL_URL: "http://${COUCH_DB_USER}:${COUCH_DB_PASSWORD}@couchdb-service:4984"
depends_on:
- redis-service
- minio-service
Expand Down Expand Up @@ -97,7 +101,7 @@ services:

couchdb-service:
restart: unless-stopped
image: budibase/couchdb
image: budibase/couchdb:v3.3.3-sqs
environment:
- COUCHDB_PASSWORD=${COUCH_DB_PASSWORD}
- COUCHDB_USER=${COUCH_DB_USER}
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/hosting/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { lookpath } from "lookpath"
import fs from "fs"
import * as makeFiles from "./makeFiles"
import { logErrorToFile, downloadFile, error } from "../utils"

Check failure on line 4 in packages/cli/src/hosting/utils.ts

View workflow job for this annotation

GitHub Actions / lint

'downloadFile' is defined but never used. Allowed unused vars must match /^_/u
import yaml from "yaml"
import { DockerCompose } from "./types"

Expand Down Expand Up @@ -46,7 +46,8 @@
export async function downloadDockerCompose() {
const filename = composeFilename()
try {
await downloadFile(COMPOSE_URL, `./${filename}`)
fs.copyFileSync("../../hosting/docker-compose.yaml", `./${filename}`)
//await downloadFile(COMPOSE_URL, `./${filename}`)
samwho marked this conversation as resolved.
Show resolved Hide resolved
} catch (err) {
console.error(error(`Failed to retrieve compose file - ${err}`))
}
Expand Down
34 changes: 14 additions & 20 deletions packages/frontend-core/src/components/Updating.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,30 @@
export let isMigrationDone
export let onMigrationDone
export let timeoutSeconds = 60 // 1 minute
export let minTimeSeconds = 3

const loadTime = Date.now()
const intervalMs = 1000
let timedOut = false
let secondsWaited = 0

async function checkMigrationsFinished() {
setTimeout(async () => {
const isMigrated = await isMigrationDone()

const timeoutMs = timeoutSeconds * 1000
if (!isMigrated || secondsWaited <= minTimeSeconds) {
if (loadTime + timeoutMs > Date.now()) {
secondsWaited += 1
return checkMigrationsFinished()
}
let totalWaitMs = 0
while (true) {

Check failure on line 10 in packages/frontend-core/src/components/Updating.svelte

View workflow job for this annotation

GitHub Actions / lint

Unexpected constant condition
const waitForMs = 5000 + Math.random() * 5000
await new Promise(resolve => setTimeout(resolve, waitForMs))
totalWaitMs += waitForMs

return migrationTimeout()
const isMigrated = await isMigrationDone()
if (isMigrated) {
onMigrationDone()
return
}

onMigrationDone()
}, intervalMs)
if (totalWaitMs > timeoutSeconds * 1000) {
timedOut = true
return
}
}
}

checkMigrationsFinished()

function migrationTimeout() {
timedOut = true
}
</script>

<div class="loading" class:timeout={timedOut}>
Expand Down
Loading