From 4e5b23d378f247725f34b192e6f26119e37e4770 Mon Sep 17 00:00:00 2001 From: Raghu Saxena Date: Thu, 18 May 2023 11:56:24 +0800 Subject: [PATCH 1/3] Add some docs on building and readme --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index a07f7ed..97454e5 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,21 @@ Many thanks to horsie and anon from Discord, both of whom were extremely helpful ## Usage The current release can be considered stable, but is not intended for use by others - it is not very customizable yet. That said, feel free to hack around with it if you like! + +### Building + +Best to build in release mode and target your CPU natively for better performance. + +``` +$ RUSTFLAGS="-C target-cpu=native" cargo build --release +``` + +### ulimits + +Make sure you set a high ulimit for open files! By default some VPS might set this to 1024, and then `kiryuu` won't be able to handle high traffic. + +If you've already started kiryuu, you can identify its PID and then set it via: + +``` +$ prlimit --pid PID_HERE --nofile=16384:16384 +``` From a7006879cfecc8013b23a4450472da38d0cac7ff Mon Sep 17 00:00:00 2001 From: Raghu Saxena Date: Thu, 18 May 2023 12:00:06 +0800 Subject: [PATCH 2/3] Some notes on testing in README --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 97454e5..407273e 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,13 @@ Best to build in release mode and target your CPU natively for better performanc $ RUSTFLAGS="-C target-cpu=native" cargo build --release ``` +Building a static binary is possible with the `musl` target, with something like: + +``` +$ cargo build --target=x86_64-unknown-linux-musl --release + +``` + ### ulimits Make sure you set a high ulimit for open files! By default some VPS might set this to 1024, and then `kiryuu` won't be able to handle high traffic. @@ -29,3 +36,15 @@ If you've already started kiryuu, you can identify its PID and then set it via: ``` $ prlimit --pid PID_HERE --nofile=16384:16384 ``` + +## Testing + +There are integration tests via Gauge that run in CI. The tests are located at https://github.com/ckcr4lyf/kiryuu-gauge + +To run them locally, you could use: + +``` +$ docker run -e KIRYUU_HOST=http://172.17.0.1:6969 -e REDIS_HOST=redis://172.17.0.1:6379 ghcr.io/ckcr4lyf/kiryuu-gauge:master +``` + +(Make sure you've kiryuu running locally and redis as well!) From 7097248dc2780c8d29ec3834f6f00feda91c5c0d Mon Sep 17 00:00:00 2001 From: Raghu Saxena Date: Thu, 18 May 2023 12:00:13 +0800 Subject: [PATCH 3/3] Remove makefile --- Makefile | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 7170e2b..0000000 --- a/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -run: - ./target/debug/kiryuu - -static: - cargo build --target=x86_64-unknown-linux-musl --release - -test-announce: - curl -v "localhost:6969/announce?info_hash=AAAAAAAAAAAAAAAAAAAB&port=3333&left=0" - -# kiryuu & redis should be running -gauge: - docker run -e KIRYUU_HOST=http://172.17.0.1:6969 -e REDIS_HOST=redis://172.17.0.1:6379 ghcr.io/ckcr4lyf/kiryuu-gauge:master \ No newline at end of file