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
e3ded361
Unverified
Commit
e3ded361
authored
Mar 03, 2023
by
OlivierDehaene
Committed by
GitHub
Mar 03, 2023
Browse files
feat(ci): improve CI speed (#94)
parent
2d39f199
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
25 deletions
+55
-25
.github/workflows/build.yaml
.github/workflows/build.yaml
+6
-2
.github/workflows/tests.yaml
.github/workflows/tests.yaml
+31
-5
Dockerfile
Dockerfile
+18
-18
No files found.
.github/workflows/build.yaml
View file @
e3ded361
...
...
@@ -15,6 +15,10 @@ jobs:
build-and-push-image
:
runs-on
:
ubuntu-latest
steps
:
-
name
:
Initialize Docker Buildx
uses
:
docker/setup-buildx-action@v2.0.0
with
:
install
:
true
-
name
:
Tailscale
uses
:
tailscale/github-action@v1
with
:
...
...
@@ -65,5 +69,5 @@ jobs:
platforms
:
'
linux/amd64'
tags
:
${{ steps.meta.outputs.tags }}
labels
:
${{ steps.meta.outputs.labels }}
cache-from
:
type=registry,ref=ghcr.io/huggingface/text-generation-inference:latest
cache-to
:
type=inline
\ No newline at end of file
cache-from
:
type=registry,ref=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:cache,mode=max
cache-to
:
type=registry,ref=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:cache,mode=max
\ No newline at end of file
.github/workflows/tests.yaml
View file @
e3ded361
...
...
@@ -3,6 +3,7 @@ name: Server Tests
on
:
pull_request
:
paths
:
-
"
.github/workflows/tests.yaml"
-
"
server/**"
-
"
proto/**"
-
"
router/**"
...
...
@@ -11,6 +12,12 @@ on:
jobs
:
run_tests
:
runs-on
:
ubuntu-20.04
env
:
SCCACHE_GHA_ENABLED
:
"
on"
RUSTC_WRAPPER
:
/usr/local/bin/sccache
SCCACHE
:
0.3.3
steps
:
-
uses
:
actions/checkout@v2
-
name
:
Set up Python
...
...
@@ -25,12 +32,28 @@ jobs:
components
:
rustfmt, clippy
-
name
:
Install Protoc
uses
:
arduino/setup-protoc@v1
-
name
:
Loading cache.
uses
:
actions/cache@v2
id
:
model_cache
-
name
:
Install sccache
run
:
|
curl -fsSL https://github.com/mozilla/sccache/releases/download/v$SCCACHE/sccache-v$SCCACHE-x86_64-unknown-linux-musl.tar.gz | tar -xzv --strip-components=1 -C /usr/local/bin sccache-v$SCCACHE-x86_64-unknown-linux-musl/sccache
chmod +x /usr/local/bin/sccache
-
name
:
configure sccache
uses
:
actions/github-script@v6
with
:
path
:
~/.cache/huggingface/
key
:
models
script
:
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('SCCACHE_GHA_CACHE_TO', 'sccache-${{runner.os}}-${{github.ref_name}}');
core.exportVariable('SCCACHE_GHA_CACHE_FROM', 'sccache-${{runner.os}}-main,sccache-${{runner.os}}-');
-
name
:
cargo registry cache
uses
:
actions/cache@v3
with
:
key
:
cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-${{ github.sha }}
restore-keys
:
|
cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-
cargo-${{ runner.os }}-
path
:
|
~/.cargo/registry
~/.cargo/git
-
name
:
Install
run
:
|
make install
...
...
@@ -41,3 +64,6 @@ jobs:
-
name
:
Run Rust tests
run
:
|
cargo test
-
name
:
sccache stats
run
:
|
/usr/local/bin/sccache --show-stats
Dockerfile
View file @
e3ded361
FROM
rust:1.67 as router-builder
FROM
lukemathwalker/cargo-chef:latest-rust-1.67 AS chef
WORKDIR
/usr/src
FROM
chef as planner
COPY
Cargo.toml Cargo.toml
COPY
rust-toolchain.toml rust-toolchain.toml
COPY
proto proto
COPY
router router
COPY
launcher launcher
RUN
cargo chef prepare
--recipe-path
recipe.json
FROM
chef AS builder
RUN
PROTOC_ZIP
=
protoc-21.12-linux-x86_64.zip
&&
\
curl
-OL
https://github.com/protocolbuffers/protobuf/releases/download/v21.12/
$PROTOC_ZIP
&&
\
...
...
@@ -6,26 +17,15 @@ RUN PROTOC_ZIP=protoc-21.12-linux-x86_64.zip && \
unzip
-o
$PROTOC_ZIP
-d
/usr/local
'include/*'
&&
\
rm
-f
$PROTOC_ZIP
WORKDIR
/usr/src
COPY
--from=planner /usr/src/recipe.json recipe.json
RUN
cargo chef cook
--release
--recipe-path
recipe.json
COPY
Cargo.toml Cargo.toml
COPY
rust-toolchain.toml rust-toolchain.toml
COPY
proto proto
COPY
router router
WORKDIR
/usr/src/router
RUN
cargo
install
--path
.
FROM
rust:1.67 as launcher-builder
WORKDIR
/usr/src
COPY
rust-toolchain.toml rust-toolchain.toml
COPY
launcher launcher
WORKDIR
/usr/src/launcher
RUN
cargo
install
--path
.
RUN
cargo build
--release
FROM
nvidia/cuda:11.8.0-devel-ubuntu22.04
...
...
@@ -69,9 +69,9 @@ RUN cd server && \
/opt/miniconda/envs/text-generation/bin/pip
install
".[bnb]"
--no-cache-dir
# Install router
COPY
--from=
router-
builder /usr/
local/cargo/bin
/text-generation-router /usr/local/bin/text-generation-router
COPY
--from=builder /usr/
src/target/release
/text-generation-router /usr/local/bin/text-generation-router
# Install launcher
COPY
--from=
launcher-
builder /usr/
local/cargo/bin
/text-generation-launcher /usr/local/bin/text-generation-launcher
COPY
--from=builder /usr/
src/target/release
/text-generation-launcher /usr/local/bin/text-generation-launcher
ENTRYPOINT
["text-generation-launcher"]
CMD
["--json-output"]
\ No newline at end of file
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