Skip to content
This repository was archived by the owner on Sep 3, 2026. It is now read-only.

[WIP][Docker] Add support for using Varnish with xkey - #143

Closed
andrerom wants to merge 4 commits into
masterfrom
httpcache_varnish_tagging
Closed

andrerom wants to merge 4 commits into
masterfrom
httpcache_varnish_tagging

Conversation

@andrerom

@andrerom andrerom commented Nov 12, 2016

Copy link
Copy Markdown
Contributor

Varnish changes, ezplatform-http-cache package (uses varnsh xkey for improved varnish performance, and cache ability of our REST api++).

Todo:

@andrerom andrerom changed the title [Docker] Add docker support for using varnish with xkey [Docker] Add docker support for using Varnish with xkey Nov 12, 2016
@andrerom andrerom changed the title [Docker] Add docker support for using Varnish with xkey [Docker] Add support for using Varnish with xkey Nov 12, 2016
@andrerom
andrerom force-pushed the httpcache_varnish_tagging branch from 27e536e to c9047ea Compare November 23, 2016 17:17
@andrerom
andrerom force-pushed the httpcache_varnish_tagging branch from c9047ea to f2162c1 Compare December 16, 2016 22:20
@andrerom
andrerom force-pushed the httpcache_varnish_tagging branch 2 times, most recently from 25908fc to 69558c2 Compare January 19, 2017 10:22
@andrerom

andrerom commented Jan 19, 2017

Copy link
Copy Markdown
Contributor Author

Back to passing, cleaned up and with last push it works locally as well again, super fast as always. /cc @bdunogier

How to tests (same exact steps as .travis.yml to know where to look next time you want to try):

  1. check out branch
  2. export TEST_CMD="bin/behat -vv --profile=rest --suite=fullJson --tags=~@broken" COMPOSE_FILE="doc/docker-compose/base-prod.yml:doc/docker-compose/redis.yml:doc/docker-compose/varnish.yml:doc/docker-compose/selenium.yml" BEHAT_WEB_HOST="varnish"
  3. docker-compose -f doc/docker-compose/install.yml up --abort-on-container-exit
  4. docker-compose up -d
  5. Depending on your docker setup you should now be able to browse the install on localhost or some ip, where port 8080 is nginx, and 8081 is varish
  6. if you don't change anything you can also run the behat tests for rest with docker-compose exec --user www-data app sh -c "php /scripts/wait_for_db.php; php $TEST_CMD" (one will fail because we registered redis here)

@bdunogier

Copy link
Copy Markdown
Contributor

For readability, I'd suggest we split the ci/docker changes from the VCL ones (more like doc).

I can do it, @andrerom, just let me know.

@bdunogier

Copy link
Copy Markdown
Contributor

From what I've seen, the VCL looks good. Haven't really looked at the docker part :)

@andrerom
andrerom force-pushed the httpcache_varnish_tagging branch from 69558c2 to 956e7c2 Compare January 25, 2017 09:00
@andrerom

Copy link
Copy Markdown
Contributor Author

From what I've seen, the VCL looks good. Haven't really looked at the docker part :)

Should be easier now, just removed the duplicated vcl in entrypoint folder :D

Comment thread doc/varnish/vcl/varnish4.vcl Outdated
return (synth(405, "Method not allowed"));
}

# If http header "xkey" is set, we assume purge is on key and you have Varnish xkey installed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align header name to be same on occurances here, in kernel and on foshttpcache pr, afaik it should be "key" like on line below and in foshttpcache

Comment thread doc/docker-compose/varnish.yml Outdated
# docker-compose exec varnish varnishlog -g request -q "ReqMethod eq 'PURGE'"
#
# But before doing that check that http and not local purge client is set:
# docker-compose exec app app/console --env=dev debug:container ezpublish.http_cache.purge_client

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be adapted to the service used by the http-cache package.

@andrerom andrerom Feb 10, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it need to be now?

Comment thread composer.json Outdated
"incenteev/composer-parameter-handler": "~2.0",
"tedivm/stash-bundle": "~0.4",
"ezsystems/ezpublish-kernel": "~6.7@dev",
"ezsystems/ezpublish-kernel": "dev-feature-EZP-25696 as 6.7.x-dev",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be replaced with the enablement of the EzSystemsPlatformHttpCacheBundle in the AppKernel.

@bdunogier

Copy link
Copy Markdown
Contributor

Given that the feature has been merged to ezsystems/ezplatform-http-cache, it has been decided that the VCL would go into the new package. I'll push a new version without the VCL changes. The Docker ones only make sense in this repository, don't they ?

I suggest that we leave the current varnish configuration untouched in this repository, and update the documentation to mention the external package and corresponding documentation.

@andrerom

andrerom commented Feb 15, 2017

Copy link
Copy Markdown
Contributor Author

Given that the feature has been merged to ezsystems/ezplatform-http-cache, it has been decided that the VCL would go into the new package. I'll push a new version without the VCL changes. The Docker ones only make sense in this repository, don't they ?

yes, they only make sense here.

I suggest that we leave the current varnish configuration untouched in this repository, and update the documentation to mention the external package and corresponding documentation.

@bdunogier For 1.8 yes

But I think I'll leave this PR open with aim to at some point have official Varnish container, and ideally it should use the xkey variant of the VCL, so guess it will have to wait for version where we switch the default.

@andrerom
andrerom force-pushed the httpcache_varnish_tagging branch from a571119 to 57e6b34 Compare June 21, 2017 15:30
@andrerom andrerom changed the title [Docker] Add support for using Varnish with xkey [WIP][Docker] Add support for using Varnish with xkey Jun 22, 2017
@andrerom

andrerom commented Sep 5, 2017

Copy link
Copy Markdown
Contributor Author

Closing, solved in:

  • 1.x (added xkey moduke to docker image): 2c946db
  • 2.x (change to use ezplatform-http-cache and it's updated VCL): a83894c

@andrerom andrerom closed this Sep 5, 2017
@andrerom
andrerom deleted the httpcache_varnish_tagging branch September 5, 2017 15:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants