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:
- create a sub-folder in
./modules/vmods
, named same as the module itself, - prepare a working
vmod.spec
, - set the variables in the
.env
file (see curent ones for reference).
- docker
- make
4.1.x - 6.1.x
Builds packages for:
- CentOS 7 x86_64 (for now)
# 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 =
$VARNISH_VERSION
) with all built modules installed, - Nginx as the main backend,
- An echo-server for testing vmod-curl.
Due to customize the setup:
- create a
docker-compose.yml
file in the main project directory, copying from the templatetemplate/docker-compose.yml
file (if not created by hand then will be copied automatically duringmake start
), - create
test/config
folder, copy into it and modifytemplate/default.vcl
andtemplate/varnish.env
files according to your needs (if not created by hand then will be copied automatically duringmake 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.