Skip to content

Commit

Permalink
Merge branch '1.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Serwatka committed Jul 19, 2017
2 parents 456c516 + ebac939 commit 3cdb8de
Show file tree
Hide file tree
Showing 15 changed files with 153 additions and 72 deletions.
5 changes: 5 additions & 0 deletions .env
Expand Up @@ -23,3 +23,8 @@ APP_DOCKER_FILE=Dockerfile

# Install config, used by .platform.app.yaml among others
INSTALL_EZ_INSTALL_TYPE=demo

# Behat / Selenium config
## web host refer to the tip of the setup, so varnish if that is used.
WEB_HOST=web
SELENIUM_HOST=selenium
6 changes: 2 additions & 4 deletions .travis.yml
Expand Up @@ -16,13 +16,11 @@ env:
- SYMFONY_DEBUG=1
# list of behat arguments to test
matrix:
# Disabled until failures on BDD tests with redis is solved / figured out
#- 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/selenium.yml"
- TEST_CMD="bin/behat -vv --profile=rest --suite=fullJson --tags=~@broken" COMPOSE_FILE="doc/docker-compose/base-prod.yml:doc/docker-compose/selenium.yml"
- TEST_CMD="bin/behat -vv --profile=rest --suite=fullJson --tags=~@broken" COMPOSE_FILE="doc/docker-compose/base-prod.yml:doc/docker-compose/varnish.yml:doc/docker-compose/selenium.yml" WEB_HOST="varnish"
- TEST_CMD="bin/behat -vv --profile=rest --suite=fullXml --tags=~@broken"
- TEST_CMD="bin/behat -vv --profile=core --tags=~@broken"
- TEST_CMD="bin/phpunit -v vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishRestBundle/Tests/Functional"
- TEST_CMD="bin/behat -vv --profile=platformui --tags='@common'"
- TEST_CMD="bin/behat -vv --profile=platformui --tags='@common'" COMPOSE_FILE="doc/docker-compose/base-dev.yml:doc/docker-compose/redis.yml:doc/docker-compose/selenium.yml"

# test only master (+ Pull requests)
branches:
Expand Down
4 changes: 4 additions & 0 deletions app/config/default_parameters.yml
Expand Up @@ -34,3 +34,7 @@ parameters:

# Location id of the content item for form uploads
form_builder.upload_folder.location_id: 250

# Settings for HttpCache
purge_type: "local"
purge_server: "http://my.varnish.server:80"
6 changes: 6 additions & 0 deletions app/config/env/docker.php
Expand Up @@ -107,3 +107,9 @@
if ($value = getenv('PUBLIC_SERVER_URI')) {
$container->setParameter('ez_recommendation.default.server_uri', $value);
}

// HttpCache setting (for configuring Varnish purging)
if ($purgeServer = getenv('HTTPCACHE_PURGE_SERVER')) {
$container->setParameter('purge_type', 'http');
$container->setParameter('purge_server', $purgeServer);
}
48 changes: 20 additions & 28 deletions app/config/ezplatform.yml
@@ -1,4 +1,8 @@
ezpublish:
# HttpCache settings, By default 'local' (Symfony HttpCache Proxy), by setting it to 'http' you can point it to Varnish
http_cache:
purge_type: %purge_type%

# Repositories configuration, setup default repository to support solr if enabled
repositories:
default:
Expand All @@ -12,45 +16,33 @@ ezpublish:

# Siteaccess configuration, with one siteaccess per default
siteaccess:
list:
- site
- fr
- de
- no
list: [site, fr, de, no]
groups:
site_group:
- site
- fr
- de
- no
site_group: [site, fr, de, no]
default_siteaccess: site
match:
URIElement: 1

# System settings, grouped by siteaccess and/or siteaccess group
system:
# System languages. Note that by default, content, content types, and other data are in eng-GB locale,
# so removing eng-GB from this list may lead to errors or content not being shown, unless you change
# all eng-GB data to other locales first.
site:
languages: [eng-GB, fre-FR, ger-DE, nor-NO]
fr:
languages: [fre-FR, eng-GB]
de:
languages: [ger-DE, eng-GB]
no:
languages: [nor-NO, eng-GB]
site_group:
# Pool to use for cache, needs to be different per repository (database).
cache_pool_name: '%cache_pool%'
# These reflect the current installers, complete installation before you change them. For changing var_dir
# it is recommended to install clean, then change setting before you start adding binary content, otherwise you'll
# need to manually modify your database data to reflect this to avoid exceptions.
var_dir: var/site
site:
languages:
- eng-GB
- fre-FR
- ger-DE
- nor-NO
fr:
languages:
- fre-FR
- eng-GB
de:
languages:
- ger-DE
- eng-GB
no:
languages:
- nor-NO
- eng-GB
# HttpCache purge server(s) setting, eg Varnish, for when ezpublish.http_cache.purge_type is set to 'http'.
http_cache:
purge_servers: ["%purge_server%"]
19 changes: 19 additions & 0 deletions doc/docker-compose/Dockerfile-varnish
@@ -0,0 +1,19 @@
FROM debian:jessie

ENV DEBIAN_FRONTEND noninteractive

# Use packages from Varnish to get Varnsih 5.1, currently does not work on debian:stretch
RUN apt-get update -q -y && \
apt-get install -q -y --force-yes --no-install-recommends ca-certificates curl && \
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish5/script.deb.sh | bash && \
apt-get install -q -y --force-yes --no-install-recommends varnish

# This will need debian:stretch, just here for referance, had segmentation faults so rather using varnsih 5.1 above
#RUN \
# apt-get update -q -y && \
# apt-get install -q -y --force-yes --no-install-recommends ca-certificates varnish-modules varnish


EXPOSE 80 6082

CMD ["varnishd", "-F", "-a", ":80", "-T", ":6082", "-f", "/etc/varnish/default.vcl", "-s", "malloc,256M"]
1 change: 1 addition & 0 deletions doc/docker-compose/README.md
Expand Up @@ -32,6 +32,7 @@ The current Docker Compose files are made to be mixed and matched togtehr as you

In addition the following exists but are work in progress, thus not tested yet and are known to be somewhat broken:
- redis.yml _(optional, adds redis service and appends config to app)_
- varnish.yml _(optional, adds varnish service and appends config to app)_
- solr.yml _(optional, add solr service and configure app for it)_


Expand Down
19 changes: 19 additions & 0 deletions doc/docker-compose/entrypoint/varnish/parameters.vcl
@@ -0,0 +1,19 @@
// Custom parameters.vcl for docker use

backend ezplatform {
.host = "web";
.port = "80";
}

// ACL for invalidators IP
acl invalidators {
"127.0.0.1";
"172.16.0.0"/20;
"app";
}

// ACL for debuggers IP
acl debuggers {
"127.0.0.1";
"172.16.0.0"/20;
}
4 changes: 4 additions & 0 deletions doc/docker-compose/redis.yml
@@ -1,6 +1,10 @@
version: '2.1'
# Redis config, to be appended after base-prod or base-dev, ..., but before selenium.yml

## WARNING:
# This service is currently work in progress, is not tested by CI, and thus not guaranteed to work.
# You are however more then welcome to try it out and help make it stable.

services:
app:
depends_on:
Expand Down
8 changes: 4 additions & 4 deletions doc/docker-compose/selenium.yml
@@ -1,5 +1,5 @@
version: '2.1'
# Appends services to prod.yml, prod+dev, prod+redis, ..., always latests
# Appends services to prod.yml, prod+dev, prod+redis, ..., always latest

services:
selenium:
Expand All @@ -16,6 +16,6 @@ services:
depends_on:
- selenium
environment:
- EZP_TEST_REST_HOST=web
- BEHAT_SELENIUM_HOST=selenium
- BEHAT_WEB_HOST=web
- EZP_TEST_REST_HOST=$WEB_HOST
- BEHAT_SELENIUM_HOST=$SELENIUM_HOST
- BEHAT_WEB_HOST=$WEB_HOST
4 changes: 4 additions & 0 deletions doc/docker-compose/solr.yml
Expand Up @@ -4,6 +4,10 @@ version: '2.1'
# NOTE: You'll need to manually reindex the solr index when booting this as we don't have entrypoint for solr yet.
# (Unless you use ezplatform:install command which indexes for you)

## WARNING!
# This service is currently work in progress, is not tested by CI, and thus not guaranteed to work.
# You are however more then welcome to try it out and help make it stable.

services:
app:
depends_on:
Expand Down
40 changes: 40 additions & 0 deletions doc/docker-compose/varnish.yml
@@ -0,0 +1,40 @@
version: '2.1'
# Simple single server setup for prod

## WARNING!
# This service is currently work in progress, is not tested by CI, and thus not guaranteed to work.
# You are however more then welcome to try it out and help make it stable.

services:
app:
environment:
- SYMFONY_HTTP_CACHE=0
- SYMFONY_TRUSTED_PROXIES=varnish
- HTTPCACHE_PURGE_SERVER=http://varnish

varnish:
build:
context: .
dockerfile: Dockerfile-varnish
image: my_varnish
mem_limit: 384M
memswap_limit: 512M
ports:
- "8081:80"
depends_on:
- web
volumes:
- ${COMPOSE_DIR}/../varnish/vcl/varnish4.vcl:/etc/varnish/default.vcl:ro
- ${COMPOSE_DIR}/entrypoint/varnish/parameters.vcl:/etc/varnish/parameters.vcl:ro


## DEBUG??
# In need of debugging all request going to Varnish, use varnishlog, example:
# docker-compose exec varnish varnishlog -c -i ReqURL,ReqMethod -I ReqHeader:X-Location-Id
# Or more relevant only BAN's with all info:
# docker-compose exec varnish varnishlog -g request -q "ReqMethod eq 'BAN'"
#
# 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
#
# And if in prod make sure you have rebuilt app container on code changes ;)
21 changes: 21 additions & 0 deletions doc/varnish/vcl/parameters.vcl
@@ -0,0 +1,21 @@
// Our Backend - Assuming that web server is listening on port 80
// Replace the host to fit your setup
//
// For additional example see: doc/docker-compose/entrypoint/varnish/parameters.vcl

backend ezplatform {
.host = "127.0.0.1";
.port = "80";
}

// ACL for invalidators IP
acl invalidators {
"127.0.0.1";
"192.168.0.0"/16;
}

// ACL for debuggers IP
acl debuggers {
"127.0.0.1";
"192.168.0.0"/16;
}
20 changes: 2 additions & 18 deletions doc/varnish/vcl/varnish3.vcl
@@ -1,24 +1,8 @@
// Varnish 3 style - eZ 5.4+ / 2014.09+
// Complete VCL example

// Our Backend - Assuming that web server is listening on port 80
// Replace the host to fit your setup
backend ezplatform {
.host = "127.0.0.1";
.port = "80";
}

// ACL for invalidators IP
acl invalidators {
"127.0.0.1";
"192.168.0.0"/16;
}

// ACL for debuggers IP
acl debuggers {
"127.0.0.1";
"192.168.0.0"/16;
}
// For customizing your backend and acl rules see parameters.yml
include "parameters.vcl";

// Called at the beginning of a request, after the complete request has been received
sub vcl_recv {
Expand Down
20 changes: 2 additions & 18 deletions doc/varnish/vcl/varnish4.vcl
Expand Up @@ -3,24 +3,8 @@

vcl 4.0;

// Our Backend - Assuming that web server is listening on port 80
// Replace the host to fit your setup
backend ezplatform {
.host = "127.0.0.1";
.port = "80";
}

// ACL for invalidators IP
acl invalidators {
"127.0.0.1";
"192.168.0.0"/16;
}

// ACL for debuggers IP
acl debuggers {
"127.0.0.1";
"192.168.0.0"/16;
}
// For customizing your backend and acl rules see parameters.yml
include "parameters.vcl";

// Called at the beginning of a request, after the complete request has been received
sub vcl_recv {
Expand Down

0 comments on commit 3cdb8de

Please sign in to comment.