Unverified Commit 6f4bb4f2 authored by Daniël de Kok's avatar Daniël de Kok Committed by GitHub
Browse files

nix: incremental build of the launcher (#2410)

parent 8a7749b8
{ buildRustPackage, importCargoLock, pkg-config, protobuf, openssl }:
buildRustPackage {
name = "text-generation-lancher";
src = ./.;
sourceDir = ./launcher;
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl.dev protobuf ];
}
This diff is collapsed.
{ {
inputs = { inputs = {
crate2nix = {
url = "github:nix-community/crate2nix";
inputs.nixpkgs.follows = "tgi-nix/nixpkgs";
};
tgi-nix.url = "github:danieldk/tgi-nix"; tgi-nix.url = "github:danieldk/tgi-nix";
nixpkgs.follows = "tgi-nix/nixpkgs"; nixpkgs.follows = "tgi-nix/nixpkgs";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
...@@ -12,6 +16,7 @@ ...@@ -12,6 +16,7 @@
outputs = outputs =
{ {
self, self,
crate2nix,
nixpkgs, nixpkgs,
flake-utils, flake-utils,
rust-overlay, rust-overlay,
...@@ -21,6 +26,10 @@ ...@@ -21,6 +26,10 @@
flake-utils.lib.eachDefaultSystem ( flake-utils.lib.eachDefaultSystem (
system: system:
let let
cargoNix = crate2nix.tools.${system}.appliedCargoNix {
name = "tgi";
src = ./.;
};
config = { config = {
allowUnfree = true; allowUnfree = true;
cudaSupport = true; cudaSupport = true;
...@@ -81,12 +90,11 @@ ...@@ -81,12 +90,11 @@
transformers transformers
vllm vllm
cargoNix.workspaceMembers.text-generation-launcher.build
(callPackage ./router.nix { (callPackage ./router.nix {
inherit (rustPlatform) buildRustPackage importCargoLock; inherit (rustPlatform) buildRustPackage importCargoLock;
}) })
(callPackage ./_launcher.nix {
inherit (rustPlatform) buildRustPackage importCargoLock;
})
]); ]);
venvDir = "./.venv"; venvDir = "./.venv";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment