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

Add option for http_cache_hosts #697

Open
phoenix-bjoern opened this issue Mar 2, 2020 · 8 comments
Open

Add option for http_cache_hosts #697

phoenix-bjoern opened this issue Mar 2, 2020 · 8 comments

Comments

@phoenix-bjoern
Copy link
Contributor

phoenix-bjoern commented Mar 2, 2020

To enable Varnish in env.php an additional command needs to be executed:
bin/magento setup:config:set --http-cache-hosts=varnish

It seems there is no possibility to append

'http_cache_hosts' => [
        [
            'host' => 'varnish'
        ]
    ]

to env.php in ece-tools.

@YPyltiai
Copy link

YPyltiai commented Mar 2, 2020

Hi @phoenix-bjoern , did you try extending this via scenarios? If it's a single command to be done during deploy, you may be able to add it via scenarios for now, since we cannot add it natively to main scenario until we have good ways of testing it and running in production.

See this: https://devdocs.magento.com/cloud/deploy/scenario-based-deployment.html

@phoenix-bjoern
Copy link
Contributor Author

@YPyltiai thanks for the feedback. Of course this would be doable. However I think this is a missing feature as Varnish is the default FPC on-premise and in order to invalidate cache elements the setting in env.php is required. IMHO support in ece-tools is a must-have.
Would you accept a PR if we would takeover the coding part?

@YPyltiai
Copy link

YPyltiai commented Mar 4, 2020

@phoenix-bjoern it makes sense - my only comment is about the design part of it. Current flows are specific to Cloud and we added scenario concept to allow for out of Cloud customization. We just need to think if we just do the variable here to control it or fork scenario & extend it for Varnish support there (out of Cloud scenario). We should accept PR but let's discuss this design question first. Let me tag few people here.

@NadiyaS , @shiftedreality , @kandy - what do you guys think?

@shiftedreality
Copy link
Member

shiftedreality commented Mar 9, 2020

I would like to suggest leaving this functionality in ./bin/magento and add to ECE-Tools via separate customized Step if needed instead of adding functionality directly into the package.

@phoenix-bjoern
Copy link
Contributor Author

@shiftedreality @YPyltiai We can either use bin/magento or the config writer to set the http_cache_hosts to the app/etc/env.php. But what about the configuration of the varnish hostname? Would it be part of
MAGENTO_CLOUD_RELATIONSHIPS ? Maybe like this:

{
...
    "redis": [
        {
            "host": "redis",
            "port": "6379"
        }
    ],
    "varnish": [
        {
            "host": "varnish1, varnish2",
        }
    ]
}```

IMHO this is an architectural decision. If you let us know what your thoughts are on that we can create a PR for it.

@NadiyaS
Copy link
Contributor

NadiyaS commented Oct 26, 2020

Hi @phoenix-bjoern
MAGENTO_CLOUD_RELATIONSHIPS is not configured by ece-tools on cloud environments, but you may set your own environment variable (e.g. CUSTOM_CONNECTIONS) which has the same structure as MAGENTO_CLOUD_RELATIONSHIPS with all service's connections and ece-tools will read data from your variable instead of MAGENTO_CLOUD_RELATIONSHIPS. For this you need to redefine the name of variable in ENV_RELATIONSHIPS. See https://github.com/magento/ece-tools/blob/develop/config/schema.yaml#L662

@andriyShevtsov
Copy link
Contributor

@phoenix-bjoern is this request still actual?

@phoenix-bjoern
Copy link
Contributor Author

Yes, it is and I would be happy if this gets option gets supported in ece-tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants