-
Notifications
You must be signed in to change notification settings - Fork 176
refactor(demo): run native demo without Docker #4708
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
76e8b88
refactor(demo): run native demo without Docker
sveitser 4f3c8c7
fix(demo): address review on native L1/db
sveitser a092b1e
ci(demo): install anvil/redis/postgres for native demo jobs
sveitser 86394dd
fix(demo): use KeyDB not Redis for CDN discovery
sveitser 0c85296
ci(demo): target ubuntu 24.04 t64 libs for keydb
sveitser d51143f
fix(keydb): add missing linux deps (bzip2, lz4, zlib, systemd)
sveitser 79da8db
style(demo): trim comments to the minimum
sveitser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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: Install native demo deps | ||
| description: Install anvil (foundry), KeyDB, and the postgres server for the native demo | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - uses: ./.github/actions/install-foundry | ||
| - shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| sudo apt-get update | ||
| sudo apt-get install -y postgresql | ||
| # stop the auto-started cluster so the demo can bind 5432/5433 | ||
| sudo systemctl stop postgresql || true | ||
| # postgres server binaries (initdb, postgres) are not on PATH on Debian | ||
| echo "$(ls -d /usr/lib/postgresql/*/bin | sort -V | tail -1)" >> "$GITHUB_PATH" | ||
|
|
||
| # keydb: extract the prebuilt server (no apt repo for 24.04) + its runtime libs | ||
| sudo apt-get install -y libsnappy1v5 libzstd1 libuuid1 libcurl4t64 libssl3t64 | ||
| curl -fsSL "https://download.keydb.dev/pkg/open_source/deb/ubuntu22.04_jammy/amd64/keydb-latest/keydb-tools_6.3.4-1~jammy1_amd64.deb" -o /tmp/keydb-tools.deb | ||
| dpkg-deb -x /tmp/keydb-tools.deb /tmp/keydb | ||
| echo "/tmp/keydb/usr/bin" >> "$GITHUB_PATH" | ||
| /tmp/keydb/usr/bin/keydb-server --version |
This file contains hidden or 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 hidden or 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 hidden or 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,99 @@ | ||
| # Prebuilt KeyDB (not in nixpkgs): Linux keydb-tools .deb, macOS Homebrew bottle. | ||
| { lib | ||
| , stdenv | ||
| , fetchurl | ||
| , autoPatchelfHook | ||
| , dpkg | ||
| , openssl | ||
| , snappy | ||
| , zstd | ||
| , bzip2 | ||
| , lz4 | ||
| , zlib | ||
| , systemd | ||
| , curl | ||
| , util-linux | ||
| , darwin | ||
| }: | ||
|
|
||
| let | ||
| version = "6.3.4"; | ||
| debBase = "https://download.keydb.dev/pkg/open_source/deb/ubuntu22.04_jammy"; | ||
|
|
||
| linuxSrcs = { | ||
| x86_64-linux = fetchurl { | ||
| url = "${debBase}/amd64/keydb-latest/keydb-tools_${version}-1~jammy1_amd64.deb"; | ||
| sha256 = "8653a2631858d6e58106e8607de61d4031b2d0c7bba0a8040859df65ea98724b"; | ||
| }; | ||
| aarch64-linux = fetchurl { | ||
| url = "${debBase}/arm64/keydb-latest/keydb-tools_${version}-1~jammy1_arm64.deb"; | ||
| sha256 = "5496d9d116cf2449b7be1b12da866f6d882ccb531ace45c8a3d679fcd0ae98af"; | ||
| }; | ||
| }; | ||
|
|
||
| # sha256 == ghcr blob digest. | ||
| darwinBottleSha = "eefed6df2c14cfbab28ac8ce65f888d011bed8a1edec7095b891ba2b418ea733"; | ||
| darwinSrc = fetchurl { | ||
| url = "https://ghcr.io/v2/homebrew/core/keydb/blobs/sha256:${darwinBottleSha}"; | ||
| sha256 = darwinBottleSha; | ||
| curlOptsList = [ "-H" "Authorization: Bearer QQ==" ]; | ||
| name = "keydb-bottle-${version}.tar.gz"; | ||
| }; | ||
|
|
||
| src = | ||
| if stdenv.isDarwin then darwinSrc | ||
| else linuxSrcs.${stdenv.hostPlatform.system} | ||
| or (throw "keydb.nix: unsupported system ${stdenv.hostPlatform.system}"); | ||
| in | ||
| stdenv.mkDerivation { | ||
| pname = "keydb"; | ||
| inherit version src; | ||
|
|
||
| nativeBuildInputs = | ||
| lib.optionals stdenv.isLinux [ autoPatchelfHook dpkg ] | ||
| ++ lib.optionals stdenv.isDarwin [ darwin.autoSignDarwinBinariesHook ]; | ||
|
|
||
| buildInputs = | ||
| lib.optionals stdenv.isLinux [ | ||
| (lib.getLib stdenv.cc.cc) | ||
| openssl | ||
| snappy | ||
| zstd | ||
| bzip2 | ||
| lz4 | ||
| zlib | ||
| (lib.getLib systemd) | ||
| curl | ||
| (lib.getLib util-linux) | ||
| ] | ||
| ++ lib.optionals stdenv.isDarwin [ openssl ]; | ||
|
|
||
| unpackPhase = | ||
| if stdenv.isLinux | ||
| then "dpkg-deb -x $src ." | ||
| else "tar xzf $src"; | ||
|
|
||
| dontBuild = true; | ||
|
|
||
| installPhase = '' | ||
| runHook preInstall | ||
| mkdir -p $out/bin | ||
| '' + (if stdenv.isLinux then '' | ||
| cp usr/bin/keydb-server $out/bin/ | ||
| '' else '' | ||
| cp keydb/${version}/bin/keydb-server $out/bin/ | ||
| install_name_tool \ | ||
| -change @@HOMEBREW_PREFIX@@/opt/openssl@3/lib/libcrypto.3.dylib ${lib.getLib openssl}/lib/libcrypto.3.dylib \ | ||
| -change @@HOMEBREW_PREFIX@@/opt/openssl@3/lib/libssl.3.dylib ${lib.getLib openssl}/lib/libssl.3.dylib \ | ||
| $out/bin/keydb-server | ||
| '') + '' | ||
| runHook postInstall | ||
| ''; | ||
|
|
||
| meta = { | ||
| description = "KeyDB server, prebuilt, for the native demo CDN discovery store"; | ||
| homepage = "https://keydb.dev"; | ||
| platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; | ||
| mainProgram = "keydb-server"; | ||
| }; | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.