1 00:00:01,700 --> 00:00:03,020 ‫Verification or is back. 2 00:00:03,020 --> 00:00:05,960 ‫What is your opinion on the usage of supervisor D. 3 00:00:06,020 --> 00:00:08,810 ‫So that's a great question. 4 00:00:08,870 --> 00:00:14,780 ‫Supervisor D I'm assuming what you're referring to is putting supervisor in the container and running 5 00:00:14,780 --> 00:00:18,440 ‫it as the PID one or the root process right in that container. 6 00:00:18,500 --> 00:00:21,100 ‫That is fine if you need to do it right. 7 00:00:21,110 --> 00:00:25,910 ‫I know Docker is best practices are never more than one app per container. 8 00:00:25,910 --> 00:00:32,750 ‫And I like to expose sort of take that idea and say it's really never more than one concern per container. 9 00:00:32,750 --> 00:00:37,170 ‫And when in some cases that concern might be multiple executable. 10 00:00:37,340 --> 00:00:40,640 ‫And so you would need to start of those with something else. 11 00:00:40,640 --> 00:00:43,090 ‫And it could be some sort of fancy shell scripting. 12 00:00:43,250 --> 00:00:45,220 ‫I like using supervisor D. 13 00:00:45,230 --> 00:00:56,690 ‫In fact if you look at my HP repo I do that I have a horribly outdated P HP repo for level so I definitely 14 00:00:56,690 --> 00:01:01,280 ‫need some updates to use some of the modern new Docker features but it shows off a couple of things 15 00:01:01,520 --> 00:01:10,040 ‫that are unique and one of those is that for PDP when you're using NPM you need the PDP executable running 16 00:01:10,100 --> 00:01:16,220 ‫and the engine X executable running and you could run those in separate containers and that would probably 17 00:01:16,220 --> 00:01:17,830 ‫be the official Docker way to do it. 18 00:01:17,840 --> 00:01:22,460 ‫If you were following their guidelines but their guidelines are just that they're just like best practices. 19 00:01:22,460 --> 00:01:26,420 ‫They're the place to start but it doesn't mean you have to stay there if you know what you're doing 20 00:01:26,420 --> 00:01:27,200 ‫and why you're doing it. 21 00:01:27,590 --> 00:01:35,690 ‫So in my case I would in this particular example I combine both engine X and the p HP FGM into the same 22 00:01:35,690 --> 00:01:43,040 ‫container image and I run them both with supervisor D and so it adds another layer of complexity because 23 00:01:43,040 --> 00:01:47,450 ‫now I have Docker running a container that's actually running supervisor as supervisors running engine 24 00:01:47,450 --> 00:01:51,670 ‫X and FGM but I find that it works well and I've ran. 25 00:01:51,710 --> 00:01:56,910 ‫I've run this on very large global Web sites that are running in lots of regions and abuse. 26 00:01:56,930 --> 00:02:04,030 ‫So this design is definitely time tested and is used in heavily heavy scenarios. 27 00:02:04,040 --> 00:02:09,070 ‫The reason I like this is because Docker and swarm out of the box don't have the concept of a pod. 28 00:02:09,170 --> 00:02:14,720 ‫If you're in Cuba and 80s world you have a pod concept and in that case you could run the engine X and 29 00:02:14,780 --> 00:02:22,960 ‫the PSP side by side in their own containers inside the same pod and that pod is deployed together. 30 00:02:22,970 --> 00:02:27,260 ‫So when it's deployed onto a server you would know that you'd get both and then they would both be able 31 00:02:27,260 --> 00:02:31,790 ‫to use the sockets if you're familiar with this stuff and PSP they use the sockets to talk back and 32 00:02:31,790 --> 00:02:37,740 ‫forth and that's very efficient but in the docker swarm way you would do it of the box that way you 33 00:02:37,740 --> 00:02:40,480 ‫would have to talk over TGP and that adds lots of lag. 34 00:02:40,520 --> 00:02:45,950 ‫I mean that lots of lag it's maybe fine for some people but when you're talking about going across server 35 00:02:45,950 --> 00:02:51,500 ‫instead of just talking over a local socket inside the same kernel there's definitely added you know 36 00:02:51,530 --> 00:02:55,600 ‫possibly multiple milliseconds if not tens of milliseconds of delay there. 37 00:02:55,610 --> 00:02:59,650 ‫So I like to run them both in the same container and I use supervisor D to do that. 38 00:02:59,810 --> 00:03:01,250 ‫So check out that example. 39 00:03:01,280 --> 00:03:03,620 ‫I will throw that in chat. 40 00:03:03,620 --> 00:03:05,960 ‫I think I saw someone post that in there already. 41 00:03:07,250 --> 00:03:11,160 ‫So hopefully that helps you out and that answers your question. 42 00:03:11,330 --> 00:03:15,050 ‫There's only a few places by the way that I use supervisor D and that's one of them. 43 00:03:15,320 --> 00:03:20,720 ‫The other one might be like cold fusion because it also needs like a patch or something on the front 44 00:03:20,720 --> 00:03:23,670 ‫end in order to work or area Gen-X. 45 00:03:23,690 --> 00:03:28,670 ‫So anytime you have something where you've got a back in binary that has to run to Amul to run your 46 00:03:28,670 --> 00:03:32,490 ‫code and then you need some sort of web server in front of it and they have to both work together to 47 00:03:32,810 --> 00:03:37,550 ‫to deliver the service it total because they're always going to be deployed together and one doesn't 48 00:03:37,550 --> 00:03:38,630 ‫work without the other. 49 00:03:38,630 --> 00:03:44,690 ‫It makes complete sense that they go together in that case in the same image especially when you scale 50 00:03:44,690 --> 00:03:50,600 ‫them if you're always going to scale them one for one because a lot of things with containers you would 51 00:03:50,600 --> 00:03:53,900 ‫want to scale differently right you're gonna scale the number of API is different you're going to scale 52 00:03:53,900 --> 00:03:55,210 ‫the number database container. 53 00:03:55,220 --> 00:04:00,430 ‫So in those cases you definitely with the flexibility and you want to build to update them on separately. 54 00:04:00,470 --> 00:04:05,090 ‫In this case I'm just going to update the app at the same time and I'm always going to replace the containers 55 00:04:05,090 --> 00:04:08,930 ‫at the same time so it makes a lot of sense to do those together so hopefully that helps.