diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59779403ae9e..0fa9ce6b1cd8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,17 +35,17 @@ jobs: target: x86_64-unknown-linux-gnu binary: x86_64-manylinux2014 container: quay.io/pypa/manylinux2014_x86_64 - build_args: --features static-ssl + build_args: --features static-ssl,prod-db - os: ubuntu-latest target: x86_64-unknown-linux-gnu binary: x86_64-manylinux2014-cuda117 container: sameli/manylinux2014_x86_64_cuda_11.7 - build_args: --features static-ssl --features cuda + build_args: --features static-ssl --features cuda,prod-db - os: ubuntu-latest target: x86_64-unknown-linux-gnu binary: x86_64-manylinux2014-cuda122 container: sameli/manylinux2014_x86_64_cuda_12.2 - build_args: --features static-ssl --features cuda + build_args: --features static-ssl --features cuda,prod-db - os: windows-latest target: x86_64-pc-windows-msvc binary: x86_64-windows-msvc @@ -54,19 +54,19 @@ jobs: target: x86_64-pc-windows-msvc binary: x86_64-windows-msvc-cuda117 ext: .exe - build_args: --features cuda + build_args: --features cuda,prod-db windows_cuda: '11.7.1' - os: windows-latest target: x86_64-pc-windows-msvc binary: x86_64-windows-msvc-cuda122 ext: .exe - build_args: --features cuda + build_args: --features cuda,prod-db windows_cuda: '12.2.0' - os: ubuntu-latest target: x86_64-unknown-linux-gnu binary: x86_64-manylinux2014-rocm57 container: ghcr.io/cromefire/hipblas-manylinux/2014/5.7:latest - build_args: --features static-ssl --features rocm + build_args: --features static-ssl,rocm,prod-db env: SCCACHE_GHA_ENABLED: true diff --git a/Dockerfile b/Dockerfile index 9f542961e730..9ca69a1fab67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,7 @@ COPY . . RUN --mount=type=cache,target=/usr/local/cargo/registry \ --mount=type=cache,target=/root/workspace/target \ - cargo build --features cuda --release --package tabby && \ + cargo build --features cuda,prod-db --release --package tabby && \ cp target/release/tabby /opt/tabby/bin/ FROM ${BASE_CUDA_RUN_CONTAINER} as runtime diff --git a/crates/tabby/Cargo.toml b/crates/tabby/Cargo.toml index b44256df74c2..0af7c66d1e77 100644 --- a/crates/tabby/Cargo.toml +++ b/crates/tabby/Cargo.toml @@ -13,6 +13,7 @@ experimental-http = ["dep:http-api-bindings"] # architecture, enable this feature to compile OpenSSL as part of the build. # See https://docs.rs/openssl/#vendored for more. static-ssl = ['openssl/vendored'] +prod-db = ['tabby-webserver/prod-db'] [dependencies] tabby-common = { path = "../tabby-common" } diff --git a/ee/tabby-db/Cargo.toml b/ee/tabby-db/Cargo.toml index c67188855d5d..e3a8a36c74df 100644 --- a/ee/tabby-db/Cargo.toml +++ b/ee/tabby-db/Cargo.toml @@ -7,6 +7,7 @@ homepage.workspace = true [features] testutils = [] +prod-db = [] [dependencies] anyhow.workspace = true diff --git a/ee/tabby-db/src/path.rs b/ee/tabby-db/src/path.rs index a1418dc68cf8..cbc9da76254b 100644 --- a/ee/tabby-db/src/path.rs +++ b/ee/tabby-db/src/path.rs @@ -7,5 +7,12 @@ fn tabby_ee_root() -> PathBuf { } pub fn db_file() -> PathBuf { - tabby_ee_root().join("db.sqlite") + #[cfg(feature = "prod-db")] + { + tabby_ee_root().join("db.sqlite") + } + #[cfg(not(feature = "prod-db"))] + { + tabby_ee_root().join("dev-db.sqlite") + } } diff --git a/ee/tabby-webserver/Cargo.toml b/ee/tabby-webserver/Cargo.toml index 72c5cd0b7890..acbd22195430 100644 --- a/ee/tabby-webserver/Cargo.toml +++ b/ee/tabby-webserver/Cargo.toml @@ -5,6 +5,9 @@ edition.workspace = true authors.workspace = true homepage.workspace = true +[features] +prod-db = ['tabby-db/prod-db'] + [dependencies] anyhow.workspace = true argon2 = "0.5.1"