Skip to content

I like the idea of having like this 20-line Varnish config that we deploy around the world, and it’s like: Look at our CDN!

License

Notifications You must be signed in to change notification settings

thechangelog/pipely

Repository files navigation

Pipely™ - single-purpose, single-tenant CDN

Based on Varnish Cache. This started as the simplest CDN running on fly.io for changelog.com

You are welcome to fork this and build your own - OSS FTW 💚

How it started

How it started

🧢 Jerod Santo - March 29, 2024 - Changelog & Friends #38

How it's going - a.k.a. roadmap to v1.0

  • ✅ Static backend, 1 day stale, stale on error, x-headers - Initial commit
  • ✅ Dynamic backend, cache-status header - PR #1
  • ✅ Add tests - PR #3
  • ✅ Make it easy to develop locally - PR #7
  • ✅ Add support for TLS backends, publish & deploy to production - PR #8
  • ✅ Add Feeds backend - PR #10
  • ✅ Add Assets backend - PR #11
  • ✅ Send Varnish logs to Honeycomb.io - PR #12
  • ✅ Enrich Varnish logs with GeoIP data - PR #13
  • ✅ Supervisor restarts crashed processes - PR #14
  • ✅ Auth PURGE requests - PR #16
  • ✅ Add redirects from Fastly VCL - PR #19
  • ✅ Send Varnish logs to S3 - PR #27
  • ✅ All contributors review & clean-up
    • Is the VCL as clean & efficient as it could be?
    • Does everything work as expected?
    • Anything that can be removed?
    • How do we make this friendlier to new users?
    • What would make this more contribution-friendly?
    • How easy is this to use as your own deployment?
  • ✅ Tag & ship v1.0-rc.1
    • ✅ Update documentation and do some local dev tests - PR #22
    • ✅ Add debug welcome message and prompt - PR #25
    • ✅ Avoid using home_dir() due to Windows issues - PR #26
    • ✅ Add troubleshooting and misc to local dev docs - PR #29
  • ✅ Tag & ship v1.0-rc.2
    • ✅ Prepare for 20% of the production traffic - PR #30
    • Route 20% of the production traffic through
    • Observe cold cache behaviour
  • ✅ Tag & ship v1.0-rc.3
  • ✅ Tag & ship v1.0-rc.4
    • ✅ Limit Varnish memory to 66% (out of 3200M out of 4000M) - [3553723
  • ✅ Tag & ship v1.0-rc.5
    • ✅ Handle varnish-json-response failing on startup - PR #33
    • ✅ Bump the instance size to performance-1x with 8GB of RAM - PR #34
    • Route 50% of the production traffic through
  • ☑️ Tag & ship v1.0
  • ☑️ Route 100% of the production traffic through v1.0

Post v1.0

  • Refactor VCL to use include
    • This will enable us to do reuse the same configs in the tests 💪 @mttjohnson
  • Add logging acceptance tests
  • Keep Dagger version in .github/workflows/_namespace.yaml in sync with just/dagger.just

Local development and testing

While it's fun watching other people experiment with digital resin (varnish 😂), it's a whole lot more fun when you can repeat those experiments yourself, understand more how it works, and make your own modifications.

Prerequisites

And that's about it. Everything else is containerized with Dagger.

Note

For Windows Developers: The project's toolchain is made for Linux-like systems. On a Windows machine you will need to have the Windows Subsystem for Linux (WSL) installed in addition to Docker. just should be installed inside your WSL Linux operating system. You might be able to run Just natively from Windows, but there are some known bugs related to home directory filenames, so better to avoid that altogether and work directly in WSL.

just
Available recipes:
    how-many-lines                  # How many lines of Varnish config?
    how-many-lines-raw              # How many lines of Varnish config?
    http-profile url="https://pipedream.changelog.com/" # Observe all HTTP timings - https://blog.cloudflare.com/a-question-of-timing
    local-debug                     # Debug container locally
    local-run                       # Run container locally: available on http://localhost:9000
    test                            # Test VTC + acceptance locally
    test-acceptance-fastly *ARGS    # Test CURRENT production
    test-acceptance-local           # Test local setup
    test-reports                    # Open test reports
    test-reports-rm                 # Clear test reports
    test-vtc                        # Test VCL config

    [team]
    cert fqdn                       # Show cert $fqdn for app
    cert-add fqdn                   # Add cert $fqdn to app
    certs                           # Show app certs
    deploy tag=_DEFAULT_TAG         # Deploy container image
    envrc-secrets                   # Create .envrc.secrets with credentials from 1Password
    ips                             # Show app IPs
    local-debug-production          # Debug production container locally - assumes envrc-secrets has already run
    local-run-production            # Run production container locally - assumes envrc-secrets has already run - available on http://localhost:9000
    machines                        # Show app machines
    publish tag=_DEFAULT_TAG        # Publish container image - assumes envrc-secrets was already run
    restart                         # Restart ALL app machines, one-by-one
    scale                           # Scale production app
    secrets                         # Set app secrets - assumes envrc-secrets was already run
    status                          # Show app status
    tag tag sha discussion          # Tag a new release
    test-acceptance-pipedream *ARGS # Test NEW production - Pipedream, the Changelog variant of Pipely

# Run the tests
just test

How can you help

If you have any ideas on how to improve this, please open an issue or go straight for a pull request. We make this as easy as possible:

See you in our Zulip Chat 👋

Note

Join from https://changelog.com/~ . It requires signing up and requesting an invite before you can Log in

Changelog on Zulip

Contributors

About

I like the idea of having like this 20-line Varnish config that we deploy around the world, and it’s like: Look at our CDN!

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •