Git Product home page Git Product logo

varnish-book's Introduction

Training material and related tools

This repository contains:

  • Training material used for Varnish Plus training
  • Source for the slides and book version
  • A snapshot of munin graphs for use by instructors.
  • PHP example-code for testing Varnish
  • Build system for said training material

This is the training material Varnish Software uses for professional Varnish training courses. It is made available under a Creative Commons CC-BY-NC-SA license (see the LICENSE file for details) as a book.

The build system produces the book in PDF and HTML formats. The PDF format includes two editions, one as the book for trainees, and the other as slides for the trainer. You can download this book in PDF format from https://www.varnish-software.com/download-varnish-book.

Index

  • build/ - Created on make, contains PDF output, html-output and necessary images
  • Makefile
  • material/ - PHP files, mainly used by the web-dev material
  • misc/ - Contains strange stuff. Including the old course (Linpro-source) and a patch for rst2s5 needed (and a pre-patched version).
  • munin/ - Anonymized munin graphs for instructors
  • NEWS - List of changes instructors should be be aware of from version to version.
  • README - This file
  • TODO
  • ui/ - Images, style-definitions for PDFs and CSS for the slides.
  • util/ - Headers for the rst, tool to make version.rst, strip-class to remove an rst-class (for generating slides as PDF instead of s5).
  • varnish_book.rst - course itself
  • vcl/ - VCL files used in the course. Not a copy. Included directly as-is, and verified by make check. (note: If 'backend' is missing, a generic backend will be added on the fly during make check).
  • src/ - Resource files for sphinx to export the book in HTML version. This folder contains a Makefile to build the book in different formats. Enter to the directory and type make to see the building targets.

Building the material

Install the following packages with their dependencies.

  • rst2pdf
  • gawk
  • git
  • make
  • graphviz
  • php5
  • sphinx 1.3 or later
  • python-docutils
  • inkscape
  • Open Sans font type

You also need the "Open Source" font type. To check whether you have it, type fc-match "Open Sans" in the terminal. The command should output OpenSans-Regular.ttf: "Open Sans" "Regular". Otherwise, do the following:

$ wget http://www.fontsquirrel.com/fonts/download/open-sans
$ sudo unzip open-sans -d /usr/local/share/fonts/truetype/
$ rm open-sans
$ fc-cache
$ fc-match "Open Sans"

Download the source code of this book:

git clone https://github.com/varnish/Varnish-Book.git

Compile the book:

make book

All build-stuff is handled by make. The following is an incomplete list of targets:

make book
Builds book in PDF format
make sphinx
Builds book in HTML and ePub format
make slides
Builds slides in PDF format. This slides are to be used in a training course.
make clean
removes build/
make util/param.rst
Updates the default values of your Varnish installation.
These values are the ones to be used in your book building.
make sourceupdate
Calls util/param.rst rule and will call other rules to update the sources of the book.

Updating the training material

Read NEWS, and make sure you always add significant content changes in this file, so the instructor(s) can keep track of changes without reading commit logs.

Try to use only tip, warning and note boxes.

To change the layout, change ui/pdf.style or ui/pdf_slide.style.

The syntax for indirect hyperlink targets (double underscores __) is not the same for rst as for sphinx. Thefore, for simplicity, avoid them. More than two refereces per sentence is not supported by rst2sphinxparser.igawk.

Figures and tables must have a counter right before their directive. The counter must be as the following example:

.. figure 1

or:

.. table 1

Use git-tag every time that the book is printed and distributed.

Known issues

This subsection includes known issues for building the book in different formats.

Building with sphinx

  • List of figures and list of tables do not work when the figure or table caption includes a reference. This is a limitation to create the PDF with sphinx.
  • Fonts are not resized in notes or other cases such :class: tinycode.

Legal

This material is provided under a CC-BY-NC-SA license. The license is available from:

http://creativecommons.org/licenses/by-nc-sa/3.0/

And a copy of the license is available in the LICENSE file.

Clarification: The Non-Commercial clause of the CC-BY-NC-SA license is intentionally vague in the original license. Varnish Software does not interpret reading of the material as commercial, regardless of context (e.g: You can read the material at work, for the benefit of your self and the company). The Non-Commercial clause is intended to block competition with other commercial training offerings and to prohibit commercial printing and selling of the book. If you have any doubt as to how this should be interpreted, please contact [email protected] for clarification before proceeding.

varnish-book's People

Contributors

adeelshahid avatar arfr avatar bennchri avatar cleberjsantos avatar clouder avatar daghf avatar dridi avatar fgm avatar fgsch avatar franciscovg avatar huayra avatar jondade avatar kristianlyng avatar lkarsten avatar mhagander avatar napsty avatar perbu avatar robsonpeixoto avatar tfheen avatar thijsferyn avatar tomhtml avatar tyler-jachetta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

varnish-book's Issues

Exercise for health probes/grace/saint

This should really be an exercise and not a demo. I've usually turned it into an exercise, and it's a much better way to gain actual understanding of how grace really works - which can be tricky wen you're new to it.

All Examples (VCL and PHP) should be licensed under the FreeBSD License

As agreed under VUG6 in London, we should make the license of the examples explicit, so the examples can be used both in the book as well as in the documentation (which ships with Varnish Cache).

The FreeBSD license will apply for the /vcl and /material/webdev directories, as all VCL and PHP examples are contained there. Shall we do this by adding the license text to the current LICENSE file or by adding a LICENSE file to each directory?

Vary description incomplete

For Vary, the admin course currently just says "The handling of the Vary-header is separate from the cache hash." in a note. There really needs to be some explanation of how it's actually handled (possibly in a different section of course, but somewhere in the admin course).

Screensharing periodically fails

Similar to sound-issues...

There are times when screen sharing simply does not work. Clicking the screen sharing doesn't do anything. A quick restart of bbb seems to fix this.

BBB sound: Beeps too much.

Not sure where the beeping comes from, but it seems that regardless of what I do, it makes a sound when I interact with the sound inside of bbb - part of why I don't use it.

Elaborate more on ACLs

Things to add:

  • Use of domains: "www.cnn.com" / 24
  • If you put an entry in (...) it ignores it if DNS does not resolve.
  • IPv6
  • Blindingly fast, long lists are perfectly OK.
  • Good place to show example of "include" in VCL

Lacks coverage of gzip

There is no coverage at all in the course about the gzip functionality in Varnish 3. Yet, this is something I run into quite often with clients who consider it a very useful feature in Varnish. It's also pretty simple - but it should warrant at least a small section with some best practices and how to set it up, etc.

Installation of required software **as exercise**

To complete the course, trainees need to the following software:

  • Varnish Cache 4.x or Varnish Cache Plus 4.x
  • Apache/2.4 or later
  • HTTPie 0.8.0 or later
  • PHP 5.4 or later
  • curl - command line tool for transferring data with URL syntax

Trainees receive access to a VM without this software preinstalled. The book explains step by step how to install and configure them. An advantage of this approach is to spend as less time as possible to get started.

@dridi commented that it would be useful to have the installation process as an exercise to gauge the trainees.

Please comment if you have a strong opinion.

Compile error on V4.2 release

Hi,

I tried to compile the V4.2 release but I'm getting this error:

Couldn't include build/exercises/complete-rewrite_urls_and_headers.rst
make: *** [build/merged_book.rst] Error 2

Any idea what went wrong?

Bans/purges refactor

The ban (purges)-chapter isn't all that good, and should probably be re-organized a bit. And eventually renamed to bans.

CentOS 7 as main testbed for Varnish Plus

The Varnish Plus repository log shows that RedHat users are about double than Ubuntu/Debian users. Therefore, the book should prioritise explanations and commands for RedHat instead of Ubuntu.

Finishing touches

The finishing words need some real love. It's currently part of the course which I haven't properly re-factored.

Random and Round-Robin

Random and Round-Robin are the basic directors, and should be explained more thoroughly.

The broken link

The pickchapter.sh and splitchapters.sh does not exists in directory Varnish-Book/util but exists a simbolic link for this files (/home/kristian/Documents/Source/training/util/pickchapter.sh and /home/kristian/Documents/Source/training/util/splitchapters.sh) in path Varnish-Book/src/util

Cookie cleaning examples

Perhaps a "practical VCL" bit? Or more exercises that does exactly this. cookie-removal is pretty common.

Needs more coverage of varnishtop

Right now, varnishtop is only covered in the appendix. Such a useful tool really should be covered earlier in the book, and in more detail.

Explain parameter ``vcc_err_unref``

Comment from @KristianLyng:

There's a parameter called vcc_err_unref that defaults to 'on'. People some time want to have stuff like backends defined, but not use them, and that means turning that parameter off. It is a pretty common request for people with large server collections, since they may want to have backends they just use every now and then, without having to comment them in and out every time.

Bullets review

Some sections have no "slide" parts, but only handout content. Also, some slides have only one bullet. All sections should have more than one bullet highlighting the important take away points.

Replace httpie with curl

httpie is not consistent across all Linux distributions. Some customers might not be willing to install it either.

Directors in general

All the director-stuff pretty much needs to be re-done. I've created issues for each, but it all needs to be re-factored.

Saintmode

Saintmode requires some explanation....

Epub support

I think providing an option for epub, would be really useful because generating an epub form a pdf file is really hard to get right, and after all we have the source :)
I've played a bit with the Makefile and was able to get it working. I don't have that much experience with sphinx so this was a bit trial and error.
I've looked into sphinx a bit, and when generating the conf-py.in (Varnish Book documentation build configuration file) we have the option in sphinx-quickstart to enable the epub support

Sphinx can also add configuration for epub output:
 Do you want to use the epub builder (y/n) [n]: y

Enabling this, would be enough from what I've checked.

Without doing this I was still able to make it work just by changing a bit the make file, and copying bit from the sphinx task.

epub: ${common} src/conf.py
    for a in ui util/* vcl material build/version.rst ; do \
        if [ ! -e src/$$a ]; then \
            ln -s ${PWD}/$$a src/$$a ;\
        fi; \
    done;

#This loop should be improved! This clears out frontpage.rst and printheaders.rst and creates wrong pdf later.
    for a in src/util/frontpage.rst src/util/printheaders.rst; do \
        rm $$a; \
        touch $$a; \
    done

#Splits chapters into individual files, and creates the index page for sphinx.
    mkdir -p src/build/chapters
    ln -sf ${PWD}/ui build/chapters/

#update references in tables:
    mkdir -p src/build/chapters/tables
    for a in tables/*; do \
        util/rst2sphinxparser_tables.awk -v dst="src/build/chapters/"$$a < ${PWD}/$$a; \
    done

    util/rst2sphinxparser.igawk -v dst=${PWD}/src/ < ${mergedrst}

#Removes '.. class:: handout' from src/*.rst
    sed -i 's/\.\. class:: handout//' src/*.rst

    sphinx-build -b epub -d build/doctrees   src/ build/epub

this was obviously a rip off from the sphinx task, but I only wanted to test if it worked.
Actually the only difference is the line:

 sphinx-build -b epub -d build/doctrees   src/ build/epub

I was able to create a epub with this.

Compile error on Mac OS X

$ make
mkdir -p build
./util/version.sh > build/version.rst
Building PDFs for book...
gawk: fatal: cannot use gawk builtin include' as variable name Building PDF slides for book... gawk: fatal: cannot use gawk builtininclude' as variable name

Screensharing is confused by multihead

I've experienced that multihead setup has confused screensharing. It resulted in the rectangle for selecting the area to share being displayed on a different monitor than what was eventually shared. It was fairly consistent and predictable, but icky.

Update for 3.0

The VCL is currently 2.1-compatible, but should be updated for 3.0 Soon [tm].

Re-do both NEWS and README for github

NEWS and README were written with tar-balls and 'plain' git in mind. It should be re-factored so the most relevant information is easily available on the github front-page.

Supported platforms need to be uniform

In chapter 1 there are two places where we mention supported platforms(1.1 and 1.2). The reason for this is that one mentions support for Varnish Plus while the other talks about Varnish Cache.

Listings for both Varnish Plus and Varnish Cache should be under 1.2 as we do the comparison between these in that chapter anyway, so having that also there should make sense.

I can send a pull request if you agree with my idea here.

Add a shopping cart example

This is an old suggestion by Kristian Lyngstøl. Instructors, would this example be valuable for most of your trainees? If yes, please comment what exactly the example should show/teach.

Bringing VCLExamples into the book

While having a chat on IRC a request, that makes a lot of sense, came from a reader of the book:

varnish user: ruben_varnish: indeed. There's a VCL examples that should be more promoted too
varnish user: there're valuable snippets there
varnish user: for example, the one that fixes the Vary: User-agent
...
varnish user: bring the VCLExamples to the book
varnish user: but revise them
varnish user: they're not standardized
varnish user: there're different approaches of doing the same thing

There you have something to include in the next version of it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.