This is the environment provided for building the Varnish VMODs (https://varnish-cache.org/vmods/)
This is the environment provided for building the Varnish VMODs.
Currently provided setups:
NOTE Contribution welcome!
Currently upported modules configurations are placed in ./modules/vmods
folder.
A configuration consists of 3 files:
.env
- environment set-up per moduleversion_map.env
- mapping between Varnish version and module version,vmod.spec
- the RPM building standard specification file.To provide a support for a new module one should:
./modules/vmods
, named same as the module itself,vmod.spec
,.env
file (see curent ones for reference).4.1.x - 6.1.x
Builds packages for:
# Help for make commands:
make help
# build RPMs for for all supported modules
make rpms VARNISH_VERSION=6.0.1-1
# or for a particular module:
make rpms VARNISH_VERSION=6.0.1-1 MODULE=vmod-curl
NOTE Resulting RPM packages can be found in ./modules/dist
folder.
The integration test is a Docker Compose stack containing:
$VARNISH_VERSION
) with all built modules installed,Due to customize the setup:
docker-compose.yml
file in the main project directory, copying from the template template/docker-compose.yml
file (if not created by hand then will be copied automatically during make start
),test/config
folder, copy into it and modify template/default.vcl
and template/varnish.env
files according to your needs (if not created by hand then will be copied automatically during make start
)NOTE Automatically generated files can be edited later (they are excluded from the source control).
# Starts Varnish with modules RPMs in a simple Docker Compose stack together with some backend service:
make start
The above will start the Docker Compose stack in the background.
Display logs with following:
# Open docker compose logs.
make logs
# or Varnish log:
make varnishlog
Stop or tear down the stack with following:
# Stops the test stack without removing the images.
make stop
# or stop and delete the docker compose related images:
make clean
Ajdust the load test settings in the .env
file:
# benchmark settings
# -- defaults:
# METHOD=GET
CONCURRENT=100
NR_OF_REQUESTS=50000
Perform Apache Benchmark (load test) against provided Varnish Docker Compose stack:
# Ensures stack whether it is started, performs benchmark and cleans up the stack after.
make benchmark VARNISH_VERSION=6.0.1-1
NOTE The benchmark results for particular Varnish version will be stored in the benchmark
folder.