Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
text-generation-inference
Commits
9aaa12e7
Unverified
Commit
9aaa12e7
authored
Aug 15, 2024
by
Daniël de Kok
Committed by
GitHub
Aug 15, 2024
Browse files
nix: build router incrementally (#2422)
parent
3f385991
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
50 deletions
+25
-50
flake.lock
flake.lock
+0
-22
flake.nix
flake.nix
+25
-28
No files found.
flake.lock
View file @
9aaa12e7
...
@@ -579,27 +579,6 @@
...
@@ -579,27 +579,6 @@
"type": "github"
"type": "github"
}
}
},
},
"naersk": {
"inputs": {
"nixpkgs": [
"tgi-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1721727458,
"narHash": "sha256-r/xppY958gmZ4oTfLiHN0ZGuQ+RSTijDblVgVLFi1mw=",
"owner": "nix-community",
"repo": "naersk",
"rev": "3fb418eaf352498f6b6c30592e3beb63df42ef11",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "naersk",
"type": "github"
}
},
"nix-github-actions": {
"nix-github-actions": {
"inputs": {
"inputs": {
"nixpkgs": [
"nixpkgs": [
...
@@ -901,7 +880,6 @@
...
@@ -901,7 +880,6 @@
"inputs": {
"inputs": {
"crate2nix": "crate2nix",
"crate2nix": "crate2nix",
"flake-utils": "flake-utils_6",
"flake-utils": "flake-utils_6",
"naersk": "naersk",
"nixpkgs": [
"nixpkgs": [
"tgi-nix",
"tgi-nix",
"nixpkgs"
"nixpkgs"
...
...
flake.nix
View file @
9aaa12e7
...
@@ -7,10 +7,6 @@
...
@@ -7,10 +7,6 @@
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"
;
naersk
=
{
url
=
"github:nix-community/naersk"
;
inputs
.
nixpkgs
.
follows
=
"tgi-nix/nixpkgs"
;
};
poetry2nix
.
url
=
"github:nix-community/poetry2nix"
;
poetry2nix
.
url
=
"github:nix-community/poetry2nix"
;
rust-overlay
=
{
rust-overlay
=
{
url
=
"github:oxalica/rust-overlay"
;
url
=
"github:oxalica/rust-overlay"
;
...
@@ -21,7 +17,6 @@
...
@@ -21,7 +17,6 @@
{
{
self
,
self
,
crate2nix
,
crate2nix
,
naersk
,
nixpkgs
,
nixpkgs
,
flake-utils
,
flake-utils
,
rust-overlay
,
rust-overlay
,
...
@@ -34,6 +29,7 @@
...
@@ -34,6 +29,7 @@
cargoNix
=
crate2nix
.
tools
.
${
system
}
.
appliedCargoNix
{
cargoNix
=
crate2nix
.
tools
.
${
system
}
.
appliedCargoNix
{
name
=
"tgi"
;
name
=
"tgi"
;
src
=
./.
;
src
=
./.
;
additionalCargoNixArgs
=
[
"--all-features"
];
};
};
config
=
{
config
=
{
allowUnfree
=
true
;
allowUnfree
=
true
;
...
@@ -46,32 +42,10 @@
...
@@ -46,32 +42,10 @@
tgi-nix
.
overlay
tgi-nix
.
overlay
];
];
};
};
naersk
'
=
pkgs
.
callPackage
naersk
{
};
router
=
with
pkgs
;
naersk
'
.
buildPackage
{
name
=
"router"
;
src
=
./.
;
cargoBuildOptions
=
x
:
x
++
[
"-p"
"text-generation-router-v3"
];
nativeBuildInputs
=
[
pkg-config
];
buildInputs
=
[
openssl
.
dev
protobuf
];
doCheck
=
false
;
};
inherit
(
poetry2nix
.
lib
.
mkPoetry2Nix
{
inherit
pkgs
;
})
mkPoetryEditablePackage
;
inherit
(
poetry2nix
.
lib
.
mkPoetry2Nix
{
inherit
pkgs
;
})
mkPoetryEditablePackage
;
text-generation-server
=
mkPoetryEditablePackage
{
editablePackageSources
=
./server
;
};
text-generation-server
=
mkPoetryEditablePackage
{
editablePackageSources
=
./server
;
};
in
in
{
{
defaultPackage
=
router
;
devShells
.
default
=
devShells
.
default
=
with
pkgs
;
with
pkgs
;
mkShell
{
mkShell
{
...
@@ -118,7 +92,30 @@
...
@@ -118,7 +92,30 @@
vllm
vllm
cargoNix
.
workspaceMembers
.
text-generation-launcher
.
build
cargoNix
.
workspaceMembers
.
text-generation-launcher
.
build
router
(
cargoNix
.
workspaceMembers
.
text-generation-router-v3
.
build
.
override
{
crateOverrides
=
defaultCrateOverrides
//
{
aws-lc-rs
=
attrs
:
{
# aws-lc-rs does its own custom parsing of Cargo environment
# variables like DEP_.*_INCLUDE. However buildRustCrate does
# not use the version number, so the parsing fails.
postPatch
=
''
substituteInPlace build.rs \
--replace-fail \
"assert!(!selected.is_empty()" \
"// assert!(!selected.is_empty()"
''
;
};
rav1e
=
attrs
:
{
env
.
CARGO_ENCODED_RUSTFLAGS
=
"-C target-feature=-crt-static"
;
};
text-generation-router-v3
=
attrs
:
{
# We need to do the src/source root dance so that the build
# has access to the protobuf file.
src
=
./.
;
postPatch
=
"cd backends/v3"
;
buildInputs
=
[
protobuf
];
};
};
})
]);
]);
venvDir
=
"./.venv"
;
venvDir
=
"./.venv"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment