-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Docker friendly changes #31
Comments
That is a great idea! I'll definitely implement this.
Other ideas:
|
Just to cross reference because it's also about Docker: #4 |
Thanks for the quick answer, glad you like the idea.
I think your other idea will fix the third point if you intercept enable disable you can just rewrite the config.json and watch for it in the cache-clean app. |
Thanks for your additional feedback. Then, a separate - optional - package for a Magento module can supply the I don't want to write into the module directory really. non-composer code writing to vendor/ dosn't feel right. I'd rather keep the cache file in var/ or maybe the Magento base dir. I'm itching to build this right now, but unfortunately it will have to wait until after https://magetestfest.com/ - sorry. |
This will be OK, simple and working as all code should be. Maybe we will meet at the test fest ;) |
Would be great to see you there - please say hi if you are there! |
Hi @dimitar-ivanov-tryzens I've implemented a first prototype. I would like to ask you to check it out and provide feedback, how it might be improved.
If you installed the utility globally, please use The PHP script to generate the dump file can be found in the package at The script will create the file If the file is not present, When running the watcher with debug output enabled ( Please let me know if it works for you, solves the intended problem and how it might be improved. |
@Vinai almost, the PHP script path is So I gave it a whirl and got this;
I then opened
And it also processes files 🎉
|
Hi @Vinai, thanks works perfect! |
So... I updated the script to use relative paths in the dump file. |
This is totally ok as long as it's not breaking cache-clean.js. I've tested relative paths so far so good.
This way node container starts and exits, when you need it you can just call
Same can be achieved just with docker and the following command run from magento root:
In both examples change paths so they reflect your infrastructure. |
I am happy with those changes and think you can successfully close the ticket. |
Thank you for the feedback @dimitar-ivanov-tryzens! May I incorporate the docker examples you posted above into the README? |
@Vinai great, works!!! Ship iiiiit! :) |
@Vinai hm no wait. It looks like it works, but this is my log;
But when I refresh the page, the menu item I'm trying to change isn't actually updated... |
sure |
@peterjaap Did it work before? |
@Vinai probably not, I just assumed (my bad) it worked because of the message it gave. |
@peterjaap I'm happy I didn't release this version already :) I assume it is building the path to the files incorrectly. Maybe the calculation of the cache ID prefix is wrong (it's based on the path to the Can you confirm that the path Can you please check what the correct path to the file The cache id prefix might be different for example. |
The problem with the Varnish FPC |
Hi, sorry for being late to the party, but took some days off.
So now this will work and you will be able to clean cache from all the listed containers. Unfortunately, there is one issue that may or may not bother you. Varnish resolves the DNS addresses on start, and if your cli/node containers are not running it will error. I don't want the cli and node running all the time, so I had to figure something.
this will allow everyone to run purge commands, not acceptable for serious work but totally ok for dev. @Vinai I've made a small mistake in the docker run command, it's better to add the container to the network all others are using. Without it works for redis, but not for varnish.
In this case, I am using docker_default network. @peterjaap if you can provide some more details of your Varnish config, I can try to help. |
@dimitar-ivanov-tryzens Thank you for your excellent and detailed description! You are a lot more familiar with setting up docker than me, so I really appreciate your help. @peterjaap Any chance you can have another look at the feature and try if fixing the Varnish configuration makes it work for you? With a bit of luck your changes only didn't show up because of the cache-clean watcher was blocked by vcl. |
Yesterday I released a new version with some bugfixes. I've rebased the branch and added a new build. @peterjaap could you please do me a favor and update the watcher and try if the watcher still doesn't actually clear affected caches? It would be great to finally be able to close this issue for good :) Here are the commands to update again:
|
After some more tests I think in general things should work as expected. I'll go ahead and merge this branch into master and make a new release. The main motivation is I would like to limit the lifetime of feature branches. |
Published as release 0.0.41 |
Hi, and thanks for the wonderful module.
I've spent some time making the module work on Docker, and I can confirm it's working fine. But I've stumbled upon some issues. The module makes two php calls, which obviously can't work inside a node container, and I don't find it a good idea to use mixed purpose containers (php+node). Fortunately, the calls are really simple so I've just run them and saved the output:
php -r "require 'app/vendor/autoload.php'; foreach ((new \Magento\Framework\Component\ComponentRegistrar)->getPaths('module') as \$m) echo \$m.PHP_EOL;" > modules.cfg
php -r "echo json_encode( require 'app/etc/env.php' ?? []);" > settings.cfg
This can be easily run inside the php container and stored in a location of your choice. After that, I've just rewritten the cache-clean.js to use the two saved files. I am not fluent enough with closurescript to do a PR, but it will be a nice option to check first for a static file with configuration, and if not present then proceed with php calls. This will allow some further customizations like having a more fine-grained filter for watch locations. I don't think I need to watch for files inside vendor, or at least not for all of them.
The text was updated successfully, but these errors were encountered: