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

[Perf] Reduce Docker image size #41

Open
Jerboas86 opened this issue Jan 31, 2025 · 2 comments
Open

[Perf] Reduce Docker image size #41

Jerboas86 opened this issue Jan 31, 2025 · 2 comments

Comments

@Jerboas86
Copy link
Contributor

The docker image size is currently 683MB and based on bookworm-slim.

The binary requires heavy data files like onnx file, but there's still room for improvement.

I tried to use alpine base image without success. The rust compilation fails being unable to find libclang.so file.

@lucasjinreal
Copy link
Owner

Does onnx file able to download on the fly as doing by default in current code base?

@Jerboas86
Copy link
Contributor Author

The onnx file is incorporated in the docker image.

COPY --from=builderpy /kokoro-v0_19.onnx ./checkpoints/kokoro-v0_19.onnx

If you try to remove this line, the container execution will fail with the following error

thread 'main' panicked at src/tts/koko.rs:32:18:
download model failed.: reqwest::Error { kind: Request, url: "https://huggingface.co/hexgrad/kLegacy/resolve/main/v0.19/kokoro-v0_19.onnx", source: hyper_util::client::legacy::Error(Connect, Ssl(Error { code: ErrorCode(1), cause: Some(Ssl(ErrorStack([Error { code: 369098857, library: "STORE routines", function: "ossl_store_get0_loader_int", reason: "unregistered scheme", file: "../crypto/store/store_register.c", line: 237, data: "scheme=file" }, Error { code: 2147483650, library: "system library", function: "file_open", file: "../providers/implementations/storemgmt/file_store.c", line: 267, data: "calling stat(/usr/lib/ssl/certs)" }, Error { code: 369098857, library: "STORE routines", function: "ossl_store_get0_loader_int", reason: "unregistered scheme", file: "../crypto/store/store_register.c", line: 237, data: "scheme=file" }, Error { code: 2147483650, library: "system library", function: "file_open", file: "../providers/implementations/storemgmt/file_store.c", line: 267, data: "calling stat(/usr/lib/ssl/certs)" }, Error { code: 369098857, library: "STORE routines", function: "ossl_store_get0_loader_int", reason: "unregistered scheme", file: "../crypto/store/store_register.c", line: 237, data: "scheme=file" }, Error { code: 2147483650, library: "system library", function: "file_open", file: "../providers/implementations/storemgmt/file_store.c", line: 267, data: "calling stat(/usr/lib/ssl/certs)" }, Error { code: 369098857, library: "STORE routines", function: "ossl_store_get0_loader_int", reason: "unregistered scheme", file: "../crypto/store/store_register.c", line: 237, data: "scheme=file" }, Error { code: 2147483650, library: "system library", function: "file_open", file: "../providers/implementations/storemgmt/file_store.c", line: 267, data: "calling stat(/usr/lib/ssl/certs)" }, Error { code: 369098857, library: "STORE routines", function: "ossl_store_get0_loader_int", reason: "unregistered scheme", file: "../crypto/store/store_register.c", line: 237, data: "scheme=file" }, Error { code: 2147483650, library: "system library", function: "file_open", file: "../providers/implementations/storemgmt/file_store.c", line: 267, data: "calling stat(/usr/lib/ssl/certs)" }, Error { code: 167772294, library: "SSL routines", function: "tls_post_process_server_certificate", reason: "certificate verify failed", file: "../ssl/statem/statem_clnt.c", line: 1889 }]))) }, X509VerifyResult { code: 20, error: "unable to get local issuer certificate" })) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants