Replies: 10 comments 3 replies
-
Hi, Unfortunately I don't have much experience with the AWS eco-system beyond S3 and CloudFront, so I can't comment specifically on AWS Fargate, and what's needed. But in general, you'd want the For details on how to do this in AWS Fargate, I suggest asking in the #devops channel in the Craft Discord. There're so many helpful people hanging out there, with experience in most things internet. :) Let me know if you need any more help. |
Beta Was this translation helpful? Give feedback.
-
I am not using Imager-x but rather Imager (I know a little behind the times) but we are also on Fargate and have the exact same issue with local cache. I have not really looked too deep into it (just not that big of a deal for us yet) but what I plan on looking into when I get to it is using EFS. As for April 2020 mounting EFS on Fargate has been supported and it seems like a viable option for your problem (as well as mine). Would love to hear more if you get a chance to look into that as a solution! |
Beta Was this translation helpful? Give feedback.
-
Each fargate container has its own local storage. Typically a deploy destroys the existing containers and boots up new ones (that have the new code). This also wipes out the local storage on the old ones. To make some storage persistent, you need to configure your fargate containers with shared volumes (normally backed by EFS). Then configure |
Beta Was this translation helpful? Give feedback.
-
I'm hosting a craft site in docker containers on a platform that provides autoscaling, as long as I don't need to persist or share data on the local file system of the containers. Is there any chance that the |
Beta Was this translation helpful? Give feedback.
-
I have a similar setup using Platform.sh and we just use a mount. It works nicely. |
Beta Was this translation helpful? Give feedback.
-
The platform we're using is Render |
Beta Was this translation helpful? Give feedback.
-
@noahjahn I don't think either AWS S3 or Redis would be good options for this. Checking S3 for every single transform would introduce insane amounts of latency. I guess Redis could work if someone configured it to be persistent, and made sure that cached items wasn't evicted, which in my experience can be pretty hard. I think the only viable option would be to use the database, like Craft does for its transforms. I'm contemplating adding an option for this for the next major release, which will probably be synchronised with Craft 4.0. |
Beta Was this translation helpful? Give feedback.
-
Maybe this is getting too far out of scope for what is being asked here but as far as transforms on an s3 objects go AWS has a clear and clean possible solution https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html They even has a blog on doing this exact thing: Would be pretty awesome to be able to deploy a lambda function that could use imager somehow in it. So the idea is that this would store the original asset in S3 then make additions to the url that the transformer could understand then I can just cache the image and redirect to that and serve it straight from S3. That takes load off my server and onto AWS infrastructure just where I like it :) |
Beta Was this translation helpful? Give feedback.
-
Thank you for the reply! You're definitely right, S3 would introduce too much latency. I still think Redis would be a good alternative even to the database (maybe there is a choice on which service to use). For my specific use case, I already have a Redis service running in Render that stays persisted just like the database. |
Beta Was this translation helpful? Give feedback.
-
I am no longer using Imager-X (sorry @aelvan) but wondered if this would be better off as a discussion than an issue? I am unsure if this is possible though |
Beta Was this translation helpful? Give feedback.
-
I'm submitting a...
Description
My workplace is using Imager-X on numerous sites and have recently moved to AWS Fargate (the hosting company we use recommended and set it up). However, we have ran into this issue whereupon deployment, the local imager cache gets removed.
I see in the docs FAQS that you mention that this should be on shared storage but I am currently unsure how to do this...(new to Craft CMS & AWS)... I was wondering if you have ever had experience using AWS for this and got any guidance in how to get this working? I understand that this more of an AWS/Imager-X setup question so any help is appreciated.
Below is what we currently have in the imager-x.php file:
Additional info
Beta Was this translation helpful? Give feedback.
All reactions