-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
74 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/build-push-action@v6 | ||
with: | ||
cache-from: type=gha | ||
cache-to: type=gha | ||
outputs: type=local,dest=dist | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: lila-openingexplorer | ||
path: dist/usr/local/bin/lila-openingexplorer | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: import-lichess | ||
path: dist/usr/local/bin/import-lichess |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ members = [ | |
resolver = "2" | ||
|
||
[profile.release] | ||
lto = true | ||
lto = "fat" | ||
strip = "debuginfo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Optimized for bookd.lichess.ovh: | ||
# - Ubuntu 22.04 (jammy) | ||
# - AMD Ryzen 5 PRO 3600 (znver2) | ||
|
||
FROM docker.io/ubuntu:jammy AS builder | ||
|
||
RUN apt-get update && apt-get upgrade --yes && apt-get install --yes git libssl-dev liburing-dev pkg-config wget software-properties-common gpg lsb-release make | ||
|
||
# Rust | ||
ADD --chmod=755 https://sh.rustup.rs/ rustup.sh | ||
ENV CARGO_HOME=/usr/local/cargo | ||
ENV PATH=/usr/local/cargo/bin:$PATH | ||
RUN ./rustup.sh -y --no-modify-path --profile minimal --default-toolchain 1.83.0 && rustc --version | ||
ENV RUSTFLAGS="-Ctarget-cpu=znver2 -Clinker-plugin-lto -Clinker=clang-19 -Clink-arg=-fuse-ld=lld-19" | ||
ENV JEMALLOC_SYS_WITH_MALLOC_CONF="abort_conf:true,background_thread:true,metadata_thp:auto,dirty_decay_ms:30000,muzzy_decay_ms:30000" | ||
|
||
# Matching clang and lld | ||
ADD --chmod=755 https://apt.llvm.org/llvm.sh llvm.sh | ||
RUN ./llvm.sh 19 && apt-get update && apt-get install --yes clang-19 lld-19 | ||
ENV CC=/usr/bin/clang-19 | ||
ENV CXX=/usr/bin/clang++-19 | ||
ENV LD=/usr/bin/lld-19 | ||
|
||
# Prepare working directory | ||
WORKDIR /lila-openingexplorer | ||
COPY Cargo.toml Cargo.lock ./ | ||
COPY lila-openingexplorer ./lila-openingexplorer | ||
COPY lila-openingexplorer-import ./lila-openingexplorer-import | ||
|
||
# Run tests | ||
RUN cargo --config net.git-fetch-with-cli=true fetch | ||
RUN cargo test | ||
RUN cargo bench --features lto | ||
|
||
# Build optimized binaries | ||
RUN cargo build --release --features lto | ||
|
||
# Final image | ||
FROM docker.io/ubuntu:jammy | ||
RUN apt-get update && apt-get upgrade --yes | ||
COPY --from=builder /lila-openingexplorer/target/release/lila-openingexplorer /usr/local/bin/ | ||
COPY --from=builder /lila-openingexplorer/target/release/import-lichess /usr/local/bin/ | ||
ENTRYPOINT ["/usr/local/bin/lila-openingexplorer"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters