resquebundle / resque

ResqueBundle for Symfony 4+
MIT License
50 stars 29 forks source link

Question about documentation #46

Closed amcastror closed 5 years ago

amcastror commented 5 years ago

Hi,

The docs state that:

"When running multiple configured apps for multiple workers, all apps must be able to access by the same root_dir defined in worker: root_dir."

(at the bottom of Optional, set configuration)

In other words, two different installations of a project with workers must live in the same server? Can't I have then workers wrapped into Docker containers to process jobs?

Maybe what this means is that if I have two different apps, then to process jobs from these two apps I need workers that share the root_dir? I just can't figure this out.

Thanks a lot!

PhilETaylor commented 5 years ago

Sorry I inherited the documentation and project, and although I use it in production, I have not had reason to dig too deep into things that just work or dont concern my project yet.

I too, like you, have 10s of docker containers that are my workers, all running the same docker image, and my root_dir is set the same on all of them.

I have a frontend docker container which is a different app, that places jobs in the queue, and THAT needed to have the same root_dir in the job, same as the root_dir for the WORKER docker images.

does that help?

amcastror commented 5 years ago

Hi @PhilETaylor, from what I understand from your answer all your docker images have the same root_dir, and your frontend docker also has the same root_dir. So bottom line, all of them must have the same root_dir. True?

Just to clarify, having the same root_dir means to be able to access the same physical folder or just having the same configuration?

Thanks!

PhilETaylor commented 5 years ago

My frontend and worker images have different paths to the app.

In my FRONTEND docker images, I have the root_dir configured as the full path to app folder (Symfony 3) of my WORKERS IMAGE

/var/www/app

When resque picks up a job in the workers, it then knows which symfony to boot and use based on that path.

Basically when you add a job to the queue (in my case using the FRONTEND docker image) the job definition contains the root_dir that resque, when running on the workers, expect, so the FRONTEND needs to be able to set that in the JOB.

amcastror commented 5 years ago

Ok, now I get it. Thanks a lot.

PhilETaylor commented 5 years ago

Awesome.