Skip to content

Commit

Permalink
chore: add coloreye for ease of debugging (#2037)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys authored May 6, 2024
1 parent 4b54d34 commit de30a85
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 15 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,50 +41,50 @@ jobs:
- os: macos-latest
target: aarch64-apple-darwin
binary: aarch64-apple-darwin
build_args: --features prod
build_args: --no-default-features --features prod
- os: dimerun-k3-ubuntu2204
target: x86_64-unknown-linux-gnu
binary: x86_64-manylinux2014
container: quay.io/pypa/manylinux2014_x86_64
build_args: --features static-ssl,prod
build_args: --no-default-features --features static-ssl,prod
- os: dimerun-k3-ubuntu2204
target: x86_64-unknown-linux-gnu
binary: x86_64-manylinux2014-cuda117
container: sameli/manylinux2014_x86_64_cuda_11.7
build_args: --features static-ssl,cuda,prod
build_args: --no-default-features --features static-ssl,cuda,prod
- os: dimerun-k3-ubuntu2204
target: x86_64-unknown-linux-gnu
binary: x86_64-manylinux2014-cuda122
container: sameli/manylinux2014_x86_64_cuda_12.2
build_args: --features static-ssl,cuda,prod
build_args: --no-default-features --features static-ssl,cuda,prod
- os: dimerun-k3-ubuntu2204
target: x86_64-unknown-linux-gnu
binary: x86_64-manylinux2014-vulkan
container: quay.io/pypa/manylinux2014_x86_64
build_args: --features static-ssl,vulkan,prod
build_args: --no-default-features --features static-ssl,vulkan,prod
vulkan_sdk: '1.3.239.0'
- os: windows-latest
target: x86_64-pc-windows-msvc
binary: x86_64-windows-msvc
build_args: --features prod
build_args: --no-default-features --features prod
ext: .exe
- os: windows-latest
target: x86_64-pc-windows-msvc
binary: x86_64-windows-msvc-vulkan
ext: .exe
build_args: --features vulkan,prod
build_args: --no-default-features --features vulkan,prod
vulkan_sdk: '1.3.280.0'
- os: windows-latest
target: x86_64-pc-windows-msvc
binary: x86_64-windows-msvc-cuda117
ext: .exe
build_args: --features cuda,prod
build_args: --no-default-features --features cuda,prod
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,prod
build_args: --no-default-features --features cuda,prod
windows_cuda: '12.2.0'

env:
Expand Down
60 changes: 60 additions & 0 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions crates/tabby/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors.workspace = true
homepage.workspace = true

[features]
default = ["ee"]
default = ["ee", "dep:color-eyre"]
ee = ["dep:tabby-webserver"]
cuda = ["llama-cpp-bindings/cuda"]
rocm = ["llama-cpp-bindings/rocm"]
Expand All @@ -15,7 +15,7 @@ vulkan = ["llama-cpp-bindings/vulkan"]
# 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 = ['tabby-webserver/prod-db']
prod = ["ee", 'tabby-webserver/prod-db']

[dependencies]
tabby-common = { path = "../tabby-common" }
Expand Down Expand Up @@ -57,6 +57,7 @@ axum-prometheus = "0.6"
uuid.workspace = true
cached = { workspace = true, features = ["async"] }
parse-git-url = "0.5.1"
color-eyre = { version = "0.6.3", optional = true }

[dependencies.openssl]
optional = true
Expand Down
3 changes: 3 additions & 0 deletions crates/tabby/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ impl Device {

#[tokio::main]
async fn main() {
#[cfg(feature = "dep:color-eyre")]
color_eyre::install().expect("Must be able to install color_eyre");

let cli = Cli::parse();
init_logging();

Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ COPY . .

RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/root/workspace/target \
cargo build --features cuda,prod --release --package tabby && \
cargo build --no-default-features --features cuda,prod --release --package tabby && \
cp target/release/tabby /opt/tabby/bin/

RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/root/workspace/target \
cargo build --features prod --release --package tabby && \
cargo build --no-default-features --features prod --release --package tabby && \
cp target/release/tabby /opt/tabby/bin/tabby-cpu

FROM ${BASE_CUDA_RUN_CONTAINER} as runtime
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.rocm
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ COPY . .

RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/root/workspace/target \
cargo build --features rocm,prod --release --package tabby && \
cargo build --no-default-features --features rocm,prod --release --package tabby && \
cp target/release/tabby /opt/tabby/bin/

RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/root/workspace/target \
cargo build --features prod --release --package tabby && \
cargo build --no-default-features --features prod --release --package tabby && \
cp target/release/tabby /opt/tabby/bin/tabby-cpu

FROM ${BASE_ROCM_RUN_CONTAINER} AS runtime
Expand Down

0 comments on commit de30a85

Please sign in to comment.