Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update to use Docker 17.04 for improved performance #173

Closed
wants to merge 2 commits into from

Conversation

andrerom
Copy link
Contributor

@andrerom andrerom commented Apr 18, 2017

Consists of three changes:

  1. Use Docker 17.04 :cached (PR) volume mount point feature to improve performance
  2. [WIP] Change nginx config to by default use SYMFONY_ENV=prod for backend & REST url's (/ez|/api)

Those two changes improves the performance to a level where working with containers is ok'ish, even on a older 2011 Macbook Pro.

Note: With changes we do in v2 and further improvements on docker itself last change for nginx conf might not be needed anymore (for people wanting to develop on backend they would anyway want it to also run in DEV)

Todo:

Possible Followups:

  • eZ Platform:
    • Optional: See if we can do something by default when running server:start as well to get backend to run in prod env (can probably be done with custom symfony server router, but unsure if we want to go back to that)
  • Docker files:
    • Optional: Move docker compose and docker stuff a place where it can be used to generate flat docker-compose.yml file at root for simplified use (no need to always joggle which files to use)
    • Get rid of volume usage in prod so we can run on Docker Swarm
      • Affects anything that needs config, data or assets built in: solr, nginx, mariadb, varnish
    • Optional: See if we can move to alpine images now that it is supported by blackfire (but still not available for mysql/mariadb image)

How to run this:

Before you try, make sure you to install Docker 17.04 or higher (only available in Docker for Mac edge channel atm)!

For full instructions see the doc/docker-compose/Readme.md, short version for dev setup:

git clone --branch docker_17.04 https://github.com/ezsystems/ezplatform.git
cd ezplatform
export COMPOSE_FILE=doc/docker-compose/base-dev.yml
# If you have used this before make sure to run `docker-compose pull` first at this point!
docker-compose -f doc/docker-compose/install.yml up --abort-on-container-exit
docker-compose up -d --force-recreate

@andrerom andrerom force-pushed the docker_17.04 branch 2 times, most recently from 1c96a23 to 10a0ca4 Compare April 19, 2017 11:58
@timiTao
Copy link

timiTao commented Jun 23, 2017

any progress with this feature to add this to platform?

@andrerom
Copy link
Contributor Author

andrerom commented Jul 4, 2017

@timiTao None, it was a prototype and would need cleanup on which folders use which mount options, and might need Docker for Mac to also gain support for :delegate

Also the need to run backend in prod disappears with v2 so cleanup should remove that as it's more of a hack. But the bump to docker compose 3.x format can be extracted and done on master right now if we want.

Copy link
Contributor

@DavidLiedle DavidLiedle left a comment

Choose a reason for hiding this comment

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

I have copied these edits into a private local repo and am running docker-compose successfully and without incident on my machine, as laid out in the README.md file, for a project I'm working on. Very nice! Thank you for these improvements @andrerom :) It has greatly sped up my development cycle.

EDIT: I happen to be on v1.10.0-rc3, as that's what was the latest when I started my current task. Forgot to mention the version earlier. :)

@timiTao
Copy link

timiTao commented Jul 6, 2017

@andrerom I run this on my local machine with ezPlatform + ee and working fine. I convince one person in Polish office to do that too on mac. Others consider this, with solution like that.

But we of them manually edit file base-dev.yml and ignore this changes in PR.

That is why I asked when will be this officialy 👍

Moving to new format always be some progress.

Funny things is that, it was one of first things in office to improve. After I did my job mostly, somebody told me from other office, that you did this PR - nobody used Docker For Mac in my office.

@andrerom
Copy link
Contributor Author

andrerom commented Jul 12, 2017

Closing in favor of #192

NOTE: Concept for setting backend in PROD mode for v1 performance is not part of that, but can be opened separately for anyone that wants to try. Instead of the rewrite rules approach attempted here it should perhaps be:

  • changes to web/index.php to set to prod when url matches /ez and /rest, and with a env variable to opt out of this
  • changes to stash config to share cache between dev and prod when in file system mode

This way also php built in server (app/console server:start) can benefit to.

@andrerom andrerom closed this Jul 12, 2017
@andrerom andrerom deleted the docker_17.04 branch July 12, 2017 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants