0 1 00:00:01,700 --> 00:00:03,020 Verification or is back. 1 2 00:00:03,020 --> 00:00:05,960 What is your opinion on the usage of supervisor D. 2 3 00:00:06,020 --> 00:00:08,810 So that's a great question. 3 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 4 5 00:00:14,780 --> 00:00:18,440 it as the PID one or the root process right in that container. 5 6 00:00:18,500 --> 00:00:21,100 That is fine if you need to do it right. 6 7 00:00:21,110 --> 00:00:25,910 I know Docker is best practices are never more than one app per container. 7 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. 8 9 00:00:32,750 --> 00:00:37,170 And when in some cases that concern might be multiple executable. 9 10 00:00:37,340 --> 00:00:40,640 And so you would need to start of those with something else. 10 11 00:00:40,640 --> 00:00:43,090 And it could be some sort of fancy shell scripting. 11 12 00:00:43,250 --> 00:00:45,220 I like using supervisor D. 12 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 13 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 14 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 15 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 16 17 00:01:16,220 --> 00:01:17,830 be the official Docker way to do it. 17 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. 18 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 19 20 00:01:26,420 --> 00:01:27,200 and why you're doing it. 20 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 21 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 22 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 23 24 00:01:47,450 --> 00:01:51,670 X and FGM but I find that it works well and I've ran. 24 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. 25 26 00:01:56,930 --> 00:02:04,030 So this design is definitely time tested and is used in heavily heavy scenarios. 26 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. 27 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 28 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. 29 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 30 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 31 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 32 33 00:02:37,740 --> 00:02:40,480 would have to talk over TGP and that adds lots of lag. 33 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 34 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 35 36 00:02:51,530 --> 00:02:55,600 possibly multiple milliseconds if not tens of milliseconds of delay there. 36 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. 37 38 00:02:59,810 --> 00:03:01,250 So check out that example. 38 39 00:03:01,280 --> 00:03:03,620 I will throw that in chat. 39 40 00:03:03,620 --> 00:03:05,960 I think I saw someone post that in there already. 40 41 00:03:07,250 --> 00:03:11,160 So hopefully that helps you out and that answers your question. 41 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. 42 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 43 44 00:03:20,720 --> 00:03:23,670 end in order to work or area Gen-X. 44 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 45 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 46 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 47 48 00:03:37,550 --> 00:03:38,630 work without the other. 48 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 49 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 50 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 51 52 00:03:53,900 --> 00:03:55,210 the number database container. 52 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. 53 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 54 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.