13

vmod workshop

Embed Size (px)

Citation preview

Page 1: vmod workshop
Page 2: vmod workshop

WRITINGVMODS

Page 3: vmod workshop

Arianna Aondio

Field Engineer

WHO AM I?

● Email: [email protected]● Twitter: aondio_● Github: aondio

Page 4: vmod workshop

AGENDA

● Varnishd -C

● Inline c

● VCC file

● Demo

Page 5: vmod workshop

Fun fact:I’m a new OS X user.It took me 10 minutes of googlingto understand how to type this → “\”with this new keyboard.

Be nice to me!

Page 6: vmod workshop

VARNISHD -C

There is no VCL magic

Try it out with:varnishd -C -f your/vcl/file

Page 7: vmod workshop

INLINE C-CODE

Can do almost anything...

C{printf(”Arianna doesn’t like inline c!\n”);

}C

...but VMODs are better!

Page 8: vmod workshop

VCC FILE

Interface between VMOD andthe VCL runtime ("VRT")

And…the man page isgenerated from it!

Page 9: vmod workshop

BUILDING A VMOD

● Fork libvmod-examle https://github.com/varnish/libvmod-example.git

● Run rename-vmod-script

● ./autogen

● ./configure

● Make

● Make check

● Make install

Page 10: vmod workshop

DEMO

Some coding...

Page 11: vmod workshop

WORKSPACE

Page 12: vmod workshop

WORKFLOW

Page 13: vmod workshop

THANK YOU