This project contains a Makefile that is used to manage the build process of a Node.js server and a Rust server, start these servers, run benchmarks against them, and build Docker images for both.
To use this Makefile, you can run the following commands:
- To build both servers:
make
ormake build
- To start the Node.js server:
make start-node
- To start the Rust server:
make start-rust
- To run benchmarks against both servers:
make benchs
- To build the Docker image for the Rust server:
make image-rust
- To build the Docker image for the Node.js server:
make image-node
- To build Docker images for both servers:
make images
To use the docker-compose.yml
file, you can run the following commands:
- To build both services:
docker-compose build
- To start both services:
docker-compose up
- To stop both services:
docker-compose down
The Makefile has several targets:
-
build
: This target depends onnode-server
andrust-server
targets and is responsible for building both servers. -
node-server
: This target navigates to thenode-server
directory and installs the necessary npm packages. -
rust-server
: This target navigates to therust-server
directory and builds the Rust server in release mode. -
start-node
: This target depends onnode-server
and starts the Node.js server. -
start-rust
: This target depends onrust-server
and starts the Rust server. -
benchmark
: This target runs a k6 benchmark against the server running on port 3000 and then kills the process running on that port. -
benchs
: This target runs thebenchmark
target for both the Node.js and Rust servers. -
image-rust
: This target builds a Docker image for the Rust server. -
image-node
: This target builds a Docker image for the Node.js server. -
images
: This target depends onimage-node
andimage-rust
and builds Docker images for both servers.