So it's my great pleasure to introduce Paul, who's going to talk to us a little bit about building Python extensions with Rust. I first met Paul, I was working at Bloomberg, but he's now a software engineer over at Google. He's also a maintainer of DateUtil, set up tools and a core developer, so he's ticking all the boxes today. So it's a great pleasure. Thank you very much, Paul. Is it someone, now it's better? Okay, great. All right, so I almost forgot to start my timer. All right, so today I'm going to be talking about building Python extensions in Rust. So this is the result of some work that I did because I was interested in maybe writing some Rust backends for DateUtil or other projects that I had and I sort of went down a rabbit hole where I ended up contributing like a huge number of like bindings to Pi03, which is kind of how it goes in open source. But I'm very excited about the possibility of getting a lot of Rust extensions out there in the community, but you'll see it's not going to be all rosy, I'm not in the Rust evangelism strike force. So I think we've probably all heard that Python is great glue language because you can write high level APIs that are very easy for people to use, but Python itself does have a lot of overhead, right? It sort of takes some, it takes a lot of the worrying out of the hands of the programmer, but at the cost of worrying about it itself at run time, which is why Python is great for orchestration tasks like system orchestration or for just calling into other languages like compiled languages like C or C++. And in fact, a lot of the great libraries that you know about are in fact just sort of glue around some other compiled fast languages, right? So NumPy or SciPy or Mapplotlib, these are all calling down into C or C++ or Fortran, but they're giving you that great powerful API. So just as a quick, just to dive into what it means to write an extension, here's an implementation of the sieve of Eratosthenes, which is an algorithm for finding all the prime numbers less than or equal to a given number. And the way it works is you just make a list of all the numbers up to that number, and then you start, and then you start with two, and then you cross off all the multiples of that, and then you continue doing that for all the prime numbers you found until you've gotten to the end of the list, and then you have the list of all the prime numbers. And you can see this is a pretty short implementation, it's pretty easy, and it works for at least five and 20. And this is what it looks like if you write it in the C API. It's obviously much longer, but that's not really the important part. What's more important is that it involves a lot of details that Python doesn't make you think about. So for example here, I'm manually managing how the, like some exception handling, I do that here and here. I'm also manually managing the memory, and I have to manage the reference counts of all the Python objects that I create. So this is kind of a lot of complexity, and it didn't really all fit in one slide. You can see this is actually quite a terse way of programming, I have this for loop that's on one line, because on a smaller screen than this, this is all that fits on one slide if you want readable text. So why would you do anything like this? Why would you subject yourself to it? It comes with a lot of performance benefits. So if we compare the Python version that I wrote to the C version that I wrote, the C version takes 526 microseconds, and the Python version takes 18.6 milliseconds to calculate all the numbers up to 100,000. So that's like a 35 times speed up, and once you get past some of the overhead of just calling the function itself, you're getting into numbers of like 40 or 50 times speed up of the hot loop. But it has these downsides that I mentioned, right? With C, you have to manually manage all your memory. You have to allocate it, you have to free it, you have to do all the reference counting, otherwise you get memory leaks. So you have to keep track of what returns you a new reference, and then decrement them correctly, and then you can get seg faults if you decrement them too much, but you can get memory leaks if you increment them too much. And it's not a memory safe language, so if you have an array in C, you can just, it's really just a pointer to the beginning of the array, and then you just tell it how far off to go. And you have to keep track of how big the array is, and in fact, when I was first implementing this, I made this little mistake, which is that to save a little space and conceptual time, I had the sieve start from 2 and go to the end. So the length of that is n minus 1, but you're so used to saying, oh, I just iterate from 0 to n. So I accidentally said, oh, i equals 0, go to i less than n, but that's longer than the array. And so when this reached the end, it wasn't an error, it wasn't a seg fault, it just read some random piece of memory and then turned it into a Python object and returned it to me. And I was like, well, that's weird. Like, 87 is not a prime number. Oh, that's a really bad example. But in any case, it's not the next prime number after 5. So this is something that I wish I was protected from, and it is something I'm protected from in Python. So where can we look next? Well, this is kind of what Rust is all about. It's a systems programming language that is memory safe. This doesn't come up quite so much in this talk, but it also pays a lot of attention to concurrency. So its model really pays attention to preventing data races and making you think about these things a lot. But it's also high performance. All this kind of safety features come at compile time and not at runtime like they do in Python. And also, it's, I think, an appealing community for Pythonistas because we're used to this world, which is a great and inclusive community and has this huge package ecosystem where you can just pip install whatever you want. And in Rust, they have a similar thing.  So this is something that I think would be very appealing to people in the Python community. I don't have time to go into exactly why Rust is a great language, but I just wanted to highlight some concept just to show you, give you a sense of the different ways you approach programming in Rust versus Python. So Rust cares a lot about ownership, what owns resources. And this has to do with when they're allowed to clean up references. This allows you to avoid having a garbage collector or a reference counting. So in general, one thing can own, like one variable or name can be bound to a resource and can own that resource. And then many things can have read-only access to it or one other thing can have write-only access to it. But you can't have multiple things that can write at the same time. So here what we have is we have something where if you look at this function, I assign this vector to V, it allocates some resources, it binds them to V, and then they're owned by V. And so when V goes out of scope, you're allowed to clean up those resources. You don't have to pay attention to when it gets freed. The compiler is doing that for you. It also is going to enforce that these rules about ownership. So here what I'm doing is I assign V to something, and then I pass it to something else, which also wants to take ownership of it. And that's fine. So what happens is I assign this vector to V. The vector moves into this thing that I've also called V in the take ownership function. And then because it's owned by the V in that take ownership function, when that goes out of scope at the end of this function, the resources are cleaned up. And if you tried to use them, it would be used after free. And in fact, that's what I'm doing here. I'm trying to use them, and I try and access this, and it's an error. But the compiler is going to catch this. It's going to use its borrow checker, and it's going to say, hey, you moved this here, but then you tried to use it. And it's actually a very informative message. I just explained in words what that is, and I had the comments, but I didn't really need the comments because the compiler generated all those comments that I manually annotated it with. So it doesn't always work as cleanly and nicely as this. But generally speaking, the compiler will tell you what it's trying to do. It's quite good about that. OK, so that's essentially as much as I'm going to tell you about Rust. The rest of this, let's just assume that you're perfect advanced Rust programmers. So I'm not going to explain anything else. So this is like the draw circle and then draw the rest of the owl, right? So here's my implementation of this in Rust. So this part of it is just pure Rust. It has nothing to do with Python. And in fact, we'll reuse it later. And then this part is something that just takes that and translates it into Python. So you can imagine that if this were a function in a library, it would be quite easy to write Python wrappings for it. And this is using PyO3. PyO3 is a library that provides bindings to the CAPI in Rust. And it uses this thing. It's called a procedural macro. And you can just imagine it's like a decorator. And it's just going to do some transformations on this to make sure that all the reference counts happen and all the types are set correctly. And what I've done here is, first I've just created this vector in Rust. I've returned it. And then this part says PyList new. And that's going to construct a Python list. And that's the same as in CAPI creating a list and allocating it and doing all this stuff. But the lifetime of this list is managed by the lifetime of this Py object. So you can see this has comparable speed to C. So I've written this function. And then I import it. And it does what we expect it to do. There's no 87s. And it's also pretty much just as fast.  And in C, we get about 700 microseconds. And in Rust, we get about 700 microseconds. So it's much tighter. And it's also memory safe, right? So how does it work? Because C, it's binding to C. And C itself is not memory safe. So the way it works is that PyO3 operates in two layers. They have the FFI layer, which is a whole bunch of unsafe code. And then they have the safe Rust layer. So the FFI layer looks like this, where this is from the daytime bindings that I wrote. And in the C API, there's this struct called PyDateTimeCAPI. And the right side is what the definition is in C. And then I basically have to copy this and say, give me the exact same memory layout of that. But in Rust, and I'm going to say that it's a C function, and it has all these C integers and things like that. And so I have all the functions. And then I declare all the data structures. So this is the same data structure as a daytime in Python. And then I also have all the little macros. And I have to re-implement all the macros, because you can't just use C preprocessor macros in Rust. And then all that gets wrapped in the safe Rust layer. And this is the layer that you would be using if you're writing your Rust extensions. So we have this little marker that says, hey, all this stuff in here, this is unsafe, which sounds like kind of a cheat where you can just say, oh, do all this unsafe stuff. But it's still memory safe. But actually, this is a very useful feature in the sense that if you're trying to audit this code and you're running through all this and you want to find memory safety bugs, the place you're going to look is in all the brackets that are surrounded by unsafe. And as long as these are sort of localized, you know that you can ignore 80% of the code when you're just looking for these memory safety bugs. So we have this unsafe stuff, which calls the FFI layer. And then it returns something that has a lifetime that's managed by Rust and has all the right memory safety features. And that's what you use. So then you would have this thing, it's PyDate. And then we have some trait that is called PyDate access, which gives you safe Rust functions that access all these things. And so if you want to make a module, it's quite easy. You have a function, and then you sort of decorate it with this thing that says Py Function and that will construct it as a function. And then when you want to make a module that's importable, you call this PyModule thing. And this is saying, basically, it's going to return, it just initializes this module. So I'll just add all the functions and then those are what gets exposed to Python. So here I have this thing that's seconds before. It tells you what the date was, some number of seconds before. And I can pass it this integer, and it gives me the right answer. But you'll notice here, I've declared this i64, which is a Rust type. It's not like Python Integer 64 or anything, right? But here I passed it a Python object, which is an integer. Because PyO3 is doing all the right things to convert one to the other behind the scenes in these procedural macros. So it makes it quite convenient for the end user to not have to think about this. And you can even do things like manage the exceptions. So you'll notice I don't have anything about checking for nulls or anything like that. I just return this Py result. And that's what's returned from the constructor because the constructor can raise errors. And if I get something that would raise an error here, instead of panicking or segfaulting or anything like that, it just returns error result. And then that percolates out to Python and raises the correct error. You can also make classes. Rust is a different model of inheritance. Well, it doesn't really have inheritance. It separates out the data in your classes from the implementation. So we do a similar thing where we have the data portion. And we declare that a Py class. And then in the implementation, we call these Python methods. And so this is the new for this point. And then this is some function I'm going to call norm. So point is just x and y. And we want to know what the norm of that vector is. We add it to our module. And then I can import it just fine. And it works. I can create it. And then I can calculate that the norm of something 3 and 4 is 5. So perfect. Like, you can create classes. You can create modules. So that's the CAPI approach. There's another approach, which is to create FFI bindings. So here's another way that you can do something similar, which is I use exact same Rust implementation. But now instead of wrapping it in something that creates Python objects and things like that, I create this CFFI, which is to say that we'll call the outputs of C compilers and stuff the lingua franca of what all languages are going to speak. And we'll just generate something that's compatible with that. And so this is some super unsafe thing. It's an external C unsafe function. And it's public.  And then it's like, oh, check out this mutable pointer. That's very scary. And then this is even worse, right? What I've done is I have this vector. And so I convert it to a mutable pointer. So I just have the data that it represents. And then I say mem forget, which means Rust, please stop managing this memory. Like you've allocated it and stuff. Now I'm going to hand it to someone else to manage this memory. So it's fairly scary. But the big advantage of this is that when I hand this off, I can hand it off to Python. I can hand it off to Ruby. I can hand it off to JavaScript. I can hand it off to whatever, because all those languages also speak C. But I also have to hand it this thing deallocateVector, right? Because I'm the only one who knows how to allocate and deallocate vectors, because I'm Rust. And but I'm handing it memory that needs to be deallocated eventually. So I have to end up passing it this function, and then also another function to let it handle the memory. Then we pass it on to what's called Milksnake. Milksnake is a library that came out of Century. And what it is is it's for writing Python bindings for CFFI. And this goes the other way, right? Anything that has a CFFI output, Milksnake can bind to. And under the hood, it also uses the library CFFI, which is the more bare bones version of this. So how this works is now I have to allocate some of these C types, and I allocate them in Python. And then I pull out this array, like this C array of C types. And I get out just some contiguous memory thing. And now I have to convert all that stuff into Python objects. And so I do that by just using this list comprehension. And now when that's done, I've copied all the memory. And I call that deallocateVec. And I do it in this try finally, so that even if this fails, I don't leak the memory. And then I return the list, and we're done interacting with Rust. So this is fairly compact. It's not so bad. And it did come with some advantages. And it also brings all out of the same speed. So if you look, if I run this in C, I get about 800 microseconds. If I run it in Rust, it's like 700 microseconds. This is very variable. I wouldn't say that Rust is faster than C because of this. And for Milksnake, I'm getting something of 1.2 milliseconds. So it's a little bit more overhead in this particular example. That's not always going to be the case. But essentially, these are all comparable in speed. And it's really about convenience. So when we're looking at this so far, I've just been saying, oh, here's all the different ways we can do this. But the one question is, should we even do this? Is there maybe a better way to do this? Probably the best contender for that would be Scython. Scython is super convenient when you're writing wrappers for C or C++ or you're just trying to get a little bit of a speed boost. You write it essentially like it's Python. And then behind the scenes, this all gets compiled down to C.  And so here, with this simple implementation that doesn't bring in any Rust or any instability or different package managers, I actually get, still, I go from 23 milliseconds to 3 milliseconds. So it's almost 10 times speedup, just with this fairly simple implementation compared to C, which is maybe about three times faster. But maybe you need three times faster. Maybe you don't need it three times faster. So what should you choose of the things we've talked about? Unfortunately, I don't think there is an answer. I can't just be like, yes, pi o 3 or never use any of these. They're all terrible. What I could say is I can just give you some trade-offs. So in terms of speed, looking at this chart, I would call all of these roughly comparable. If you're looking for really good speed, probably milk snake, pi o 3 and C are going to be, well, they're faster than the scython that I write. So I have these caveats. One of one is that I didn't pick some function that is like a representative task for everything that you would generally do as a programmer. I picked something that was going to demonstrate how you have to deallocate vectors in when you use the FFI thing. So that's not exactly a representative task. If you're doing something that doesn't involve that, these numbers could be very different. The other thing is I spent some time optimizing these, but I'm not a super expert scython optimizer, because most of the time, if I need a little bit of speed, just using scython is enough. So take that with a grain of salt. I would definitely say all of these will give you some speed boost. I have found that writing the Rust stuff is a little bit, the stuff that I just naively churn out turns out a little bit faster than the scython stuff that I've written. But if you do decide to use Rust, should you use this FFI or the API? Well, the pros and cons here are if you're using FFI, you get that portable interface we talked about. It also has a smaller Rust dependency. Pi o 3 brings in all these bindings and stuff to the CAPI with the FFI, you have almost no dependency. It's basically just whatever Rust you write. It can also be faster with PiPi for certain types of interface, because PiPi can, I don't know the details of this, but their just-in-time compiler can make better optimizations when it's using CFFI than when it's binding to the CAPI, because it has this interaction layer in between. The downsides are this brings in a runtime dependency on Milksnake and CFFI, which you may not like. There's no support for Python-specific types, so for me, if I wanted to use date times, I have to write all the stuff that creates a date time in Python out of some C memory. So if you're just returning lists of integers and stuff, not a big deal. As you saw, I had to do the memory management in Python, and I also had to write a lot of unsafe Rust directly in my functions, which I didn't really have to do in PiO3. For the API, it's basically all safe Rust. It doesn't have any runtime dependencies, and you're working directly with Python objects. And it has some other nice things, because it knows that it's doing Python for you. But the downside is I've had to change these slides several times, because the API is fairly unstable. I think it still requires nightly Rust, which I haven't found to be a big burden, but some people can't use nightly Rust or don't want to. And there are also certain places where they just haven't really thought too much about optimizing the speed. So I think a lot of these cons will hopefully go away in the future. But what I would say now is if you want something that's going to be in production like tomorrow, I'm not sure that I would choose either of these Rust options. Maybe I would choose FFI, especially if you're using PiPi. But if you're willing to deal with these kinds of things and try and help the ecosystem, it may not be a bad idea to invest in the API. It's also another thing you have to think about is the task that you're trying to do. If you're just trying to write a wrapper for some library that's already written in Rust, the FFI stuff is probably going to be one of the faster ways to do it. And it allows you to write this API, this wrapper, that will hit a whole bunch of different languages.  OK, so I've said that there are some drawbacks to all of these. I think that there are some pretty significant opportunities for improvement here. So this is my call to action.  But you could write a procedural macro that generates this from inputs, just like the Pi03 case, except not Python specific. I think that could work. And if you're ambitious and you want to try that, you could also, if you're not really big into the Rust side of it, I think there's also a lot of improvements that could be made on the Python side. Where this is probably a fairly common pattern where you're going to have to allocate and deallocate things, why not have a library that has wrappers so that you can just decorate your Python functions with this thing. And it will say, oh, I understand that this is like a Rust vector and it's used in this specific way. And here's how I turn it into a list. And then there's Pi03. This is a screenshot I took yesterday.  So this is actually a very actively developed project. They're very welcoming of contributions. And if you ping me, my GitHub is there, I will review your pull request for sure. So this is something it can use a lot of improvement. And it's rapidly improving. And so on both sides, the first things, you would have to take ownership and create your own library. And if that appeals to you, there's definitely opportunities there. And if you're really just trying to get your feet wet, it'll be a very valuable thing to do. And it's much lower, I guess, burden on you. All right, well, that's my time. So thank you for coming to my talk. Thank you very much, Paul. We don't have time for questions in this talk, but I'm sure Paul will be available to chat after the talk.


Welcome to the Gary Stewart show. I'm Joe Wamba joined now with Gary Stewart head coach of the men's basketball team and coach You guys host a conference opponent and like coming this weekend have a pretty solid performance again Then another tight game and some catalysts on the team is Tim Tim McNeil and Cameron Hayes Well, you absolutely right Joe another tight ball game. We we were tied under three minutes left in that one and and that's kind of been our story, you know We've been within one possession of a number of opponents with less than four minutes left Struggling to close games out, but Tim and Cam were were excellent had great energy And we're sort of put the ball on the floor and got to the rim Also, we're able to stretch the defense and hit some threes both those guys are progressing nicely and Cliff Cornish Also progressing nicely having another big game underneath the basket for you We did a good job of getting Cliff the ball in the areas where he's successful And he's a guy obviously that can step out and and make jump shots But we want to anchor him down on the interior for most of his opportunities and our execution was better And when when we involve him consistently along with Mark and Benjamin were difficult to guard You absolutely were with those three big tall guys being able to circle through When either one of them gets into foul trouble or it just doesn't have it tonight They're all stepping up for each other. Yeah, and we need those guys to be productive for us. They're all multi-skilled All bring a unique skill set and one that we have to cinch away to To be successful moving forward and you'll need to lean on that skill set a little bit You guys travel up to New Pulse for a Tuesday evening game this week.  They have a multitude of players that can make Shots from the perimeter. So we're gonna have to get out there and contest shots and limit their opportunities They run an offense that Allows back cuts as well. So we're gonna have to play them in two directions You know, we can't allow them to shoot layups on the interior in a five-on-five setting But we also have to get out to their shooters and identify who they are and make it hard for Well, coach, we wish you the best of luck and hitting those points of interest for you this this Tuesday. Thank you, Joe He's Gary Stewart. I'm Joe Wamba and this has been the Gary Stewart show


So welcome back after the break, before we went for our break, we just looked at a brief introduction to what we will be studying in this APC publication, the book Kingdom Builders, okay, and we will look at chapter one. So if you can all, you know, open to PDF copies, this book Kingdom Builders, I think I've already put that under, you know, in the course content, or you can even find it in our APC publication, do you all have access to that, the APC publication Kingdom Builders, what about the others, okay, you can go to our website and now website, you can go to the resources and publication, English books, and then there you can find this publication Kingdom Builders, okay, so we can follow along with us, it will follow along with me and the rest of us, it will be nice. Okay, so we're looking at the first chapter, the Kingdom and the Church, now this is something that we already studied in the book the Kingdom of God, we looked at the king and his kingdom in chapter two, and the church, the kingdom of God, we looked at it in chapter three, so what we are just going to look in chapter one, we'll just be reiterating a few things that we already have learned in the book, the Kingdom of God in chapters two and three, okay, so we know that, you know, the words or the terms, the kingdom of God and the kingdom of heaven are used interchangeably, they, what mean one and the same, okay, the kingdom of God actually describes whose kingdom it is, it is God's kingdom, and the kingdom of heaven is actually revealing to us that the kingdom of God originates from our realm that is outside of this world, that is not part of this world, and it's also revealing to us that it is a kingdom from heaven and hence it is a spiritual kingdom, it belongs to a spiritual realm called heaven, and that's why Jesus said in John chapter 18 verse 36, my kingdom is not of this world, so we already looked at, you know, these terms kingdom of God, kingdom of heaven, we studied this in chapter one of, you know, the book the kingdom of God, okay, so we also saw in chapter two that we also learned that, you know, that God is the king of the kingdom, okay, he's the, who's the king of this kingdom, it is God himself who is the king, and we know that his kingdom, you know, is one where we see the king's rule, we see his dominion, it's a place where he reigns, where his lordship is extended, where we can see his power and his influence, and also it's a place, the kingdom of God is a place where the king's will is established, and all that he purposes, all that he wants to do, even before that he had planned and purposed, even before the foundations of the world, that is what he does or brings about accomplishes in and through his kingdom, also we know that, you know, his kingdom rules over all, okay, like we read in Psalm 103 verse 19, the Lord establishes throne in heaven, and his kingdom rules over all, okay, and who initiated or introduced the kingdom into our realm, it is Jesus himself who, you know, who introduced the kingdom of God when he said, you know, the repent for the kingdom of God is at hand, okay, we've already looked at this, so all of what we're going to say in today in the first chapter is just reiterating what we had already studied in the previous book, okay, and we know that Jesus came to bring us into the kingdom, and you know, he also came to bring the kingdom to us, so there are two things that he did, he came to bring the kingdom of God, of the kingdom of heaven to us, he just wanted us to show, he wanted to show us how God's kingdom is, what is, you know, it's a kingdom of power, it's a kingdom of love, it's a kingdom of forgiveness, compassion, it's a kingdom where the king is not just a ruler who treats us like slaves, but it's a kingdom where the king is a father, you know, so it will be the father heart of God, of this king, who's the king of the kingdom, and you know, and also Jesus brought the kingdom into our life, so he brought the kingdom of God to us, and he also brought the kingdom of God into us, which means when he died on the cross, you know, he made a way for us to be part of the kingdom, he made a way for us to come back to God, to be his sons and daughters, to be heirs of God, and co-heirs with Christ Jesus, so you know, we know that we have, we were once living in the kingdom of darkness, kingdom of Satan, kingdom of slavery and sin and death, but we have been delivered from that kingdom, you know, like we read in, and we've been ushered into the kingdom of light, as we read in Colossians chapter 1 verse 13, where it says he has delivered us from the powers of darkness, and conveyed us into the kingdom of the son of his love, in whom we have redemption through his blood, the forgiveness of sins, so through the blood of Jesus, we have redemption, we have forgiveness of sins, and hence we have been, you know, conveyed from, delivered from the power of darkness and conveyed into the kingdom of God, the kingdom of heaven, and we also know that the kingdom of God was established in our hearts, okay, Luke chapter 17 verse 21, you know, Jesus says, now will they say see here or see there for indeed the kingdom of God is within you, so we've spoken quite a lot about this, reiterated this over and over again, so the kingdom of God is a spiritual kingdom, you know, when we are born again, we are born, our spirit man is born again, we are born again, and we experience a spiritual aspect of the kingdom of God, the spiritual dimension of the kingdom of God, where the king's rule, domain, power, authority is all in our hearts and in our lives, and through us it's released or penetrates into our world, we also know that, you know, once we become children of God, we are adopted into God's family by the spirit of adoption, the Holy Spirit that tells us that we are sons and daughters, reminds us of our standing, who we are, our identity, so if anyone asks you what is your birth certificate, you have to just show them Romans chapter 8 verse 17, you know, where it talks about that we have been adopted into, you know, by the spirit of adoption of being sons of being children of God, and that's why we are called hairs of God and joint hairs with Christ, and we also know that, you know, just like God gave, when he created Adam and Eve, we put them in the garden, he told them to, he blessed them and asked them to multiply and also to have dominion and to subdue, so, you know, that means to rule, to have dominion, to subdue the evil one, but we see that, you know, when they sinned, they gave over the rights of ownership to Satan, they became his slaves and when Jesus died on the cross, he purchased back, you know, that the authority that is ours and he has vested that authority to the church and the church comprises of UN me, so he's given us the keys of the kingdom, he's given us the authority and he has given us back the authority to rule and have dominion on the earth, and we also know that we are called the sons of the kingdom of God as we read in Matthew chapter 13 verse 38, we also saw that, you know, the kingdom of God is a pervasive kingdom, it extends to all of human life, like we read in Matthew chapter 13 verses 31 to 33, where it says, you know, the kingdom of heaven is like a mustard seed, you know, which a man took and sold it in his field, you know, which is the smallest of all seeds, but when it grows, you know, it grows into this, it's greater than all the other herbs, it becomes a tree so that the birds of the air can come and nest in its branches, and also we see, you know, in verse 33, he says, Jesus spoke another parable and he said that the kingdom of God is like a leaf in which one took and, you know, and hid in three measures of meal till it was all leave it, okay, so we are that, like we just said, in the first hour of our class, you know, we are that mustard seed that leave in that God is, you know, you know, you might be small, but God is going to use us to, you know, to extend his kingdom into all spheres of our human life, okay, so there are two aspects of the kingdom that we saw, it's a spiritual aspect, which I just said, there's also the natural dimension or the literal kingdom that will be established, we also looked at this in a whole chapter in the book, the kingdom of God, and we know that when Jesus comes again, he will establish his kingdom, he will reign over the house of Jacob forever, and of his kingdom there will be no end, like we read in Luke chapter 1 verse 33, we also looked at the various aspects of, you know, about the king and his kingdom and his government by looking at the various names in Isaiah chapter 9 verses 6 and 7, we looked at, you know, how Isaiah unfolds the aspects, the government that the Son of God would administer when he comes back and, you know, he points back to his names, all the names that we see in Isaiah chapter 9 verse 6 as described to God that, you know, a wonderful counselor, prince of peace, mighty God, everlasting father, okay, so all of, we saw that the names of God are an expression of who he is, and he wants his kingdom here on earth to be an expression of who he is and what he does, that to be, you know, revealed in and through his kingdom, okay, and we also know that when he comes he will establish the throne, you know, there will be no end to his kingdom and he will bring about order and justice from that time forward to and forever more, okay, and we also looked at or learned that in that millenium kingdom that God will establish here, the physical kingdom, you know, each one of us who are saints, who are believers will be given this different responsibility, different positions according to our faith, according to the faithful, according to how faithful we have been in what we have done and what God has entrusted to us here while we are living this life in the spiritual dimension of the kingdom, so, you know, sometimes we think that, you know, there's no point in being faithful, I don't see any rewards, you know, I'm just suffering, I'm just laboring heart for the Lord, but, you know, there's nothing that I'm perceiving, but, you know, we need to just end here, we need to persevere, we need to fix our eyes on Jesus, continue running our race, because there will be a reward in the millenium kingdom, you know, depending on how faithful we have been, how good stewards we have been of what God has entrusted to us, how we have been engaging with this world and bringing about multiplication for what God is looking at, produce multiplication, productivity, you know, based on that we will be given ranks, orders, races of position in the administration of the physical kingdom that God, or the literal kingdom that God will establish when he comes here on the earth, okay, and we know that, you know, all of this is something that God had already planned even before the foundations of the world, okay, his, and he has invited us to inherit this kingdom that he had prepared for us even before the foundation of the world as we read in Matthew chapter 25 verse 34, and so since we've received such a kingdom, you know, we need to, you know, serve God in a way that is acceptable to him, and also that will bring about reverence and godly fear, Hebrews chapter 12 verse 28, okay, so all this we've already looked at, we're just kind of reiterating what we had studied, the kingdom of God and the church, you know, now the kingdom of God that we see in the present time is in his spiritual form, and when Jesus died on the cross, you know, he took back the keys of authority from Satan, he gave it, he gave those keys of authority, or he gave the kingdom to the church, and the church is basically the body of Christ, so the church is part of the kingdom of God, and it represents his kingdom here on earth, okay, and hence we are called to pray like Jesus taught us in Matthew chapter 6 verse 10, your kingdom come, you will be done on earth as it is in heaven, and if you look at this verse in Matthew chapter 16 verses 18 and 19, we know that, you know, we have been given the keys of authority, verse 19 it says, and I will give you the keys, the kingdom of heaven, keys means dissembles authority, and we can also, you know, we've been given the authority to come against the gates of Hades, okay, the gates of hell, we have been given the power and the authority to overthrow and overpower the gates of hell, we know that gates are places of importance of where, you know, there's people have access to come in or, you know, are restricted from coming in, hence when, and in Jesus time, gates also resembled places where, you know, judgments would be passed at the gates, you know, people, the elders would sit and they would bring about justice and they would pass judgments, so gates actually also resemble, you know, demonic influence, demonic domination, demonic authority and power, and the church has to advance against the gates of hell, now the gates don't move, they're stationary, you know, so the church has to, you know, go against the kingdom of God, we have to engage in tearing down the forces of darkness and pulling down the centers of demonic domination on the earth, and God has given us the keys, the keys symbolizes authority, okay, not only having been given authority and power but just as Jesus, you know, ushered in the kingdom, he proclaimed, he talked, he preached the kingdom of God in the same way, likewise, we need to preach and teach about the kingdom of God, and also we need to, you know, heal the sick, raise the dead, cleanse the lepers, because freely we have received, freely we need to get, and we need to teach people, you know, how to live according to kingdom thinking, kingdom culture, and grow in kingdom lifestyle, okay, that was just a quick review of what we've been studying, we also know that the church is a spiritual body, because the kingdom of God is in a spiritual form, and hence the church is a spiritual body, but it's a spiritual body consisting of all believers, consisting of people, and hence it has a natural expression in people, because, you know, people comprise the church, and it's, who are the people who comprise the church as those who have been redeemed by the blood of the Lamb, okay, so we don't fight against each other, because each one of us has been redeemed by the blood of the Lamb, we are precious in God's sight, so we honor, respect, love each other, we esteem others more than we can esteem ourselves, because each one of us are precious in God's sight, because we have been redeemed by the blood of the Lamb, okay, so even as we are believers, and we belong to the body of Christ, but yet there are different denominations, there are different groups of people, there are different churches based on our culture, based on the way we worship our personal preferences, our individual preferences, and you know, all of these are natural differences, because this is how we like to worship God, this is how some other people like to worship God, but you know, these have become, sadly have become reasons for separation or division in the body of Christ, and it has caused the church to be a divided house and a divided kingdom, so the whole purpose of you know, studying this book on kingdom builders is to help us you know, as kingdom builders to rise above all our natural opinions, our natural preferences, our natural differences of the way we worship, what style of worship we are comfortable with, how we like to worship God, it's all okay to do that, but we need to make sure that you know, it does not separate us, but we need to work together in establishing the kingdom of God, so we need to remember that you know, each of us in our own denominations, we are not a kingdom by ourselves, you know, we are just part of that body of Christ, and we all belong to that one kingdom, which we need to keep in mind, okay, so anyone has any questions about lesson one, we just kind of reiterated all that we've been studying, any questions? Are all of you with me? Am I too fast? Do we have some responses please? All of you with me? Or am I too fast? I need to slow down my pace, okay, it's only one S from one person, okay, so here on page number nine in your book, there is a chorus called Majesty, anyone knows that song? Anyone knows the song? Jefina, you know the song? Zealotoli, do you sing the song in your church? Okay, okay, John Paul, you'd like to sing for us? Yeah, we can sing it, you can lead us, we'll all mute our mics and we can all sing and you can lead us. Is that okay, John? Yes, Master. Majesty, worship his majesty, come to Jesus, be all glory, all majesty, kingdom, authority, flows from his throne unto his own, his emblem ring, so lift up on high the name of Jesus, magnify glory, Christ Jesus the king, Majesty, worship his majesty, unto Jesus, be all glory, kingdom, authority, flows from his throne unto his own, his emblem ring. Thank you so much, John. It just, you know, some of these choruses and hymns that are, you know, in this publication, so powerful, it just reminds us, you know, even as kingdom builders, it's so important for us to know that, you know, who is the king of the kingdom? Sometimes we can come and take that place of the king and so here it says that, you know, Jesus who died now glorified king of all kings. He's a king of all kings and we need to magnify his name, we need to give him the glory, honor and praise and the way we serve him and the way we relate with him and the way we adore him and the way we honor him and everything that we do. Okay. Okay, we'll move on to chapter two, Christ the king of the kingdom. Again, Christ the king of the kingdom. Now, just, you know, mentioned there is Apostle Paul who was used greatly and mightily by God, you know, to establish and expand God's kingdom and, you know, we see him as a true kingdom builder, one whose heart was, you know, set on, was set on glorifying Christ and seeing his kingdom come. Okay. And that's what Paul says, you know, many places he mentions this but just one place that I would like to, you know, bring to your attention as Philippians chapter three verse eight here he says, you know, I count all things lost for the excellence of the knowledge of Christ Jesus my Lord, for whom I have suffered the loss of all things and count them as rubbish that I may gain Christ. Okay. So here we see, you know, Paul saying that, you know, he was, he's a, he's a great scholar, he studied under Gamaliel, he studied under great scholars, he knows all of the Old Testament, Torah, the laws, everything.  And he says, you know, suffered the loss of all things and count them as rubbish that I may gain Christ. Okay. So we see that, you know, Paul was, his heart was set on glorifying Christ and seeing his kingdom come. We just like to point two references here and also mention that, you know, even you look at Paul's episodes, you know, he always begins by saying in a few episodes, he says, you know, Paul, a born servant of Christ Jesus.  But slaves were free to, you know, to go after serving their masters for seven years. But after seven years, if they still want to stay with their master, because they love their masters, their masters have been kind to them, no, they can, they can choose to live with their master for the rest of their life, you know, willing to submit to them, willing to take orders from them, willing to willing to do anything for them. So it's the choice that they do willingly.  And so Paul is saying that, you know, Paul, a born servant of Christ Jesus, which means that, you know, he says that, you know, willingly by choice, I have chosen to, you know, submit to Jesus Christ, to serve him for the rest of my life, to do everything that I have to do to build his kingdom. And so we also read, you know, in the book of Corinthians, where he talks a couple of verses where he says, all the sufferings that he has gone through, how many times he's beaten, the rods, the whips that he's taken, he suffered so much for Christ. And in 2 Corinthians chapter 4 verse 10 to 11, he says, now I'm always, Paul is saying, I'm always carrying in my body the dying of the Lord Jesus Christ, that the life of Jesus can also be manifested in my body. So he says, for who, for we who live are always being delivered to death for Jesus sake, the life of Jesus also may be manifested in our mortal flesh.  We know that, you know, Paul was also persecuted, he was beaten up, you know, he was put into prison, he was whipped. But he says he's, he is, you know, willing to do all that for the sake of Jesus Christ. Okay, that the life of Jesus Christ can be manifested in his body that has been delivered to death day in and day out. Okay. And, you know, one of the examples we can read is in Acts chapter 14 verses 19 to 21, you know, Paul goes to the places in Galatia, he's preaching and teaching there, you know, the cities in Galatia, Iconia, Listra, Derby. And so he goes from Antioch to these places and the Jews in these cities, you know, they persuade the crowds and they stone Paul. Okay. And we know that stoning basically in the Old Testament concept is stoning a person until they are dead. And so we read that, you know, Paul was dragged out of the city supposing him to be dead.  However, when it says it was 20 of Acts chapter 14, however, when the disciples gathered around him, he rose up and went into the city. Now, isn't that amazing? Because a man who's been stoned and left for dead, you know, must be having, you know, wounds and cuts and, you know, just imagine he got up himself instead of being put on a stretcher and bandaged, he walks into the city and it says amazingly dead. And the next day in the same verse 20 of chapter 14 says in the next day, he departed with Barnabas to Derby and was 21, he says, and they had preached the gospel to that city and made many disciples and returned to Listra, Iconium and Antioch, strengthening the souls of the disciples, exhorting them to continue in the faith and saying, we must through many tribulations enter the kingdom of God. I mean, isn't this just so amazing?  He's not put on a stretcher. He goes to the city and the very next day, he goes to Derby with Barnabas and what does he go to do? He goes to preach the gospel in that city. And when he preaches a gospel there, he makes many disciples and he comes back, you know, to the same city where they persecuted and they stoned him, they left him for dead. He comes and what is he doing? He's strengthening the souls of the disciples there and exhorting them to continue in the faith and saying that we must go through tribulations to enter the kingdom of God. So what Paul actually said in 2nd Corinthians chapter 4 verses 10 to 11 makes so much of sense because he's saying he's always been delivered to death for Jesus sake, but the life of Jesus also may be manifested in our mortal body. So what he's saying is, you know, the power, the resurrection power, the life of Jesus, the zoe life of Jesus can also be manifested in our mortal body.  The power of God will be manifested in our mortal flesh, like we see here what Paul does. And nothing stops him from, you know, advancing the kingdom of God and giving glory to Christ Jesus. Nothing stops him from seeing the kingdom of God established in the lives of people. Okay, so let's just look at one reference here, page number 13. 1 Corinthians chapter 3 was 6 and verses 9 to 11. Can somebody read that please? 1 Corinthians 3 was 6 and 9 to 11. I planted up all this water, but God gave the increase. For we are God's fellow workers, you are God's field, you are God's building. According to the grace of God, which was given to me as a wise master builder, I have laid the foundation and another builds on it, but let each one take heed how he builds on it. For no other foundation can anyone lay that, that which is laid, which is Jesus Christ. Thank you, Jeffina. So there's several important things that we can learn here. Paul is saying that the church represents a field where there are many workers and these workers must, you know, cooperate with each other in tilling the ground, in sowing the seeds and taking care of the plants that are growing so that they can reap a rich harvest. So it's not just one man's job, but it, you know, the church represents a field where there are different workers doing their own jobs to help in reaping a great harvest. And he's also saying that, you know, the church is compared to a building, you know, where the walls are raised up together by co-workers. So, you know, in the kingdom of God, all of us are co-workers. Okay.  We're all here to build his kingdom. Okay. I think this is something that we need to, you know, take heart. We need to hold on to that, you know, we are here to build his kingdom. We are here to build God's kingdom and not our own kingdom. So here Paul is comparing the church to God's field and God's building, you know, and as being co-workers in God's field and God's building, we need to, you know, help in growth, in production, in doing our job and not quarreling with each other. We know that if the workers quarrel with each other, then, you know, work cannot be done, can be done in the field, no harvest can, you know, there won't be a harvest that can be reaped. We also know if workers do not, you know, cooperate with each other and work together in building a building, you know, things will get delayed. Okay. So, you know, being co-workers with God, it means that we work together in unity, in oneness to achieve what God desires. He achieves that we all be, you know, a part of this building the church and we're all one and, you know, unity is so important for the Godhead. You know, remember in John chapter 17, the High Priestly Prayer, Jesus prayed, Father, let them be one, let them, means he's talking about the believers. He says, let them be one as we are one. So, we see in the Trinity, there's perfect unity, there's perfect oneness, even though each one of them have their own roles, you know, but we see that even in that, you know, there is perfect unity, there's perfect oneness. So, we need to remember that, you know, in the kingdom of God, we need to work with other pastors, other believers, other ministers, you know, bishops and pastors and, you know, the saints, all those who are in the church, we need to work with each other. And also, we see here that kingdom building is all about building people because it says in verse 9, you are God's field, you are God's building. Okay. And in verse 9 and 10, 6, 9 and 10, he says, you know, another important thing that we can learn is that kingdom building is all about partnership. It's about working together. Okay. So, how do we know this? Because Paul says, you know, I planted a polished watered, but God gave the increase. Okay.  We are doing the hard work, you know, the hard work of praying, of, you know, evangelizing, of meeting people, of learning the language of that place. And then we bring in the people into the church. But that God calls us to leave that and to go somewhere else. And then he brings in someone else to nurture the people that we have brought into the church. So, we can say, hey, how can God do that? That's unfair. But that is how God works. You know, he, it's not that I plant, I water, I reap, I do everything. It's about co-laboring. It's about co-working. So, sometimes God can cause us to do all, and we can say, oh, I did the hard work.  And this person who comes in, you know, I've set up everything. I have done everything. This person who comes in is having a good time, you know. Everything is set up. They just have to continue things. And, you know, they're getting all the credit. So, it's, it's, it's all of them. It's who plant, who water, and the harvesters reap. Everybody, you know, gets an equal share. All of them will be rewarded by God. And we looked at this even when we, when we, we looked at, you know, Elijah and Elisha, even though Elisha got a double portion of Elijah's anointing, yet we see that, you know, the Prophet will come in the, in like, like Elijah. Okay, not like Elisha, but like Elijah. So, you know, those who start the work, the pioneers of the work, you know, are the fathers of that work, are the fathers of the faith, and they will be rewarded. They will be given recognition. So, you know, it's all about partnership. And then this person who is, comes in second, who again, works, builds up things. And, you know, he has to leave or God calls him or whatever, you know, and the third person comes in and he's just sleeping the fruits of the hard work done by A and by B. Okay, so it's not the person seeing who's done everything, but it's everyone together, A, B and C, who have labelled in that place.  He will reward everyone. So, you don't worry, you know, say, how can I leave this and go? You know, this is what I started, this is what I did.  Okay, so God can use one man to sow, he can use another man to water and yet he can use another woman to reap the harvest. So, you know, one man lays the foundation, another one builds on it, you know, the other one takes it further or just living in the finished work, the grandeur, easiness of everything, regardless of what each one are doing in the different seasons or different times, you know, each one of them, what they have done is equally important and everyone is equally important. Okay, like we read in Romans chapter 12, again, Romans chapter 12 verses 14 and 6, 4 to 6, Romans chapter 12 verses 4 and 5. Can somebody read Romans chapter 12 verses 4 and 5? Okay, Romans chapter 12 verse 4 and 5 says, for us, we have many members in one body, but all the members do not have the same functions. So, we being many are one body in Christ and individually members of one and other. So, here it talks about, you know, that each one of us have different members, different jobs or responsibilities in the body of Christ. We have many members, each one of us have different roles, different responsibilities, different gifts that God has given to us. All of us don't do the same function, but each one of us are important. If one of us are not doing the admin work, you know, things will be difficult. If one of, if those of us have to leave worship, don't leave worship, then it will be difficult. You know, those of us who have to serve, if you're not there to serve, then, you know, or set, you know, lay the chairs or clean up or, you know, serve the tea, then, you know, things suffered in during a church service or in the body of Christ. So, all of us have different functions, you know, but all of us, you know, though we are many with different functions, we are in one body in Christ and each of us as individual members have to fulfill our functions to one another. Okay, so it says in verse five, so we being many are one body in Christ and individually members of one another. That means even though we are individual members in the body of Christ, but we are individual members, we are not, you know, we are not individuals in the sense that we work independently, but we are individuals in the sense that we are interdependent on each other, we need each other, others need us and we need them. In Ephesians chapter four verses 11 and 12, you know, it says that, you know, and he, which means the Holy Spirit or God himself gave some to be apostles, some to be prophets, some to be evangelists, some to be pastors and teachers. So, even in the body of Christ, we all have different, you know, callings, different offices, but all of these callings and offices are important. Why? Because in verse 12, it says, for the equipping of the saints for the work of the ministry and for the edifying of the body of Christ. So, all of these offices in the body of Christ are so important because all of these offices, you know, help in equipping the saints and edifying the body of Christ. It's not saying edifying the local church, it's not saying it's edifying each of our own ministries, but it's edifying the body of Christ. So, what I'm saying here is, you know, that like we just pointed out an important thing here, it says, you know, we need each other, each one of us are equally important in the body of Christ. And one more reference I like us to see is Ephesians chapter 4, verses 15 and 16. You know, Paul says, speaking the truth and love, you know, we need to grow up with all things into him who is the head that is Christ, from whom the whole body is joined and knitted together by what every joint supplies according to the effective working by which every part does a share, causes growth of the body for the edifying of itself in love. So, here we see that, you know, the church is the body of Christ and who is the head? It's not the pastor, it's not the bishop, it's not you or I, it's the Christ is the head. And it says here that, you know, all of us, you know, have to do our share for the effective working of the body of Christ. So, if the body of Christ has to work effectively, each one of us have to do our share. So, we can't say, hey, I'm not a pastor, I'm not an apostle, I'm not a teacher, I'm just somebody who does, you know, serves tea, I'm not important when you are involved. Each one of us, you know, irrespective of what we are doing, each one of us, you know, when we do our bit, when we do what God has called us to do, it helps in effective working, which causes the growth of the body for the edifying of the church. Okay, the church is the body of Christ. So, this is something that we really need to understand this concept, put it in our minds because, you know, this is where we can fall, you know, this is where we can say, hey, you know, I don't want this person to step into my role because I have done all this hard work. I don't want him to take the glory and to reap all the rewards. Or, you know, we can say, I don't want to cooperate with him, let him do his own thing, I'll do my own thing, but it's so important in the body of Christ that we understand the head is Christ, that each one of us have to do our share. And when we do our share, it causes the growth of the body of Christ and edifies self-in-love. And also, we see that Kingdom Building is about Christ, Christ is the foundation and Christ is the starting point. Okay, so we'll stop here. We'll continue with chapter 2. Anyone has any questions? No questions? Okay. Okay, thank you all for joining class. Have a blessed week and I'll see you next Wednesday. Thank you, everyone. Thank you, West. Thank you, Jefina. Thank you, Mom. Thank you, Isaac. Thank you, Postum.


So my name is Michael, I'm the CTO of AMAZIO and also the other AMAZ companies and we do hosting and we do a lot of things with containers. And in the last couple of times that I talked with people, I see there's a lot of confusion of what are they exactly, what are they here for, are they going away, is it the VM, is it not and things like that. So the session today should really be about an overview. What are they actually? And what are they used for and will they go away or not? So we're gonna talk first about what are containers. Then we're gonna talk about containers and Docker because there's a lot of confusion between the two. And we're gonna try to look a bit in the future of containers and you can already see, no they're not going away. But let's first look at containers. So when I'm hearing people explaining containers, they are using, yeah, they're kind of something like VMs. I'm sorry to say, no, they are not. It's very similar and you can do similar things but there's very important parts.  So let's first look at physical servers. Let's look at the physical server as a city. Where multiple people live, we have a lot of things in there. In cities, we have things like streets. We have stuff like a water system. We have power grids. And if you compare that to a physical server, we could say like, we have a CPU. It's like maybe the street. The ramps is the water system and the storage is the power grid. And if we look at the highways of a city, that's actually the network between multiple servers. So cities provide us with infrastructure as humans that we need and physical servers provide our apps, so resources like CPU, RAM, storage and the possibility to talk to each other like we move between cities, we visit friends and things like that. So if you think about now a virtual machine, a virtual machine is a house. And within a house is within a city. So a VM is within a physical server. And the house though has its own plumbing system. The house has its own heating system. The house also has its own power distribution system. And very important, a house has doors and fences. So now that everybody goes in and takes that. So if you need a house and you need another one, you take the infrastructure of a city and you put your house there and you have another house. With the VMs, it's exactly the same. A virtual machine has a full operating system. It has its full own network stack. It's at its own kernel. And also it has its own firewall. So if you wanna clone a VM to another physical server, or we just wanna clone a VM in general, we copy everything. We start the full operating system, we start the full network stack, we start the full kernel, and we start the full firewall. And the problem is a bit first that takes quite some time to boot an operating system and everything. And it's also gonna be very heavy. A virtual machine usually is between, probably the smallest one, you can maybe go down to 200 megabytes. But usually a virtual machine has a couple of gigabytes with the full operating system and the network stack and all the stuff in there. They're not bad because in the past, we started physical servers. Every time we had a new app or we had a new version of our app, we actually put like a new servers in there. So VMs made a lot of things possible. And now let's look at the containers and you can guess it, containers or apartments. So if you look at an apartment, an apartment has a shared plumbing system. An apartment has shared heating. You're reusing an existing heat system. You can still control in your own apartment how hot or cold it is, but the actual heating produced is somewhere in the building. And you also have a shared power distribution system. So the power comes into and is shared among everybody. And we also have shared doors and fences. Not everybody can have a very secure door. So we put one very secure door at the bottom where the people actually walk in. So the doors of the individual apartments, they don't need to be that secure anymore because we have one very secure one. So we also share security. And containers, you guessed it, is exactly that. So a container is a minimal operating system. It's much, much, much smaller than what actually is needed in a full virtual machine. It shares the kernel, all containers together running on the same server are sharing the kernel. They have a common container engine, like the power distribution system. They all use the same container engine and they also have a shared firewall. Like in the apartment, we have one big door. The containers, they have a big firewall in front of them that does everything. Does that make sense? Nothing? Okay. So what are containers exactly? First of all, they are super lightweight. A container can start at like two or three megabytes. You can start and stop a container. And everything that is necessary to run in there is running in that single container. So it's much smaller than a full virtual machine. Also, they're really, really fast. A container can start within milliseconds. And not a virtual machine that has to boot everything and load different init systems and whatever. A kernel, a container that just starts. And it also stops again very fast. It is, though, fully secure because within the containers, they are separate. It's like in your apartment building, if you're in your apartment, you cannot just walk into the other apartment in there because there's a door again. So it's the same with containers. If you are in a container, you cannot see what the others containers are doing. You cannot change what the others containers are doing. You know they're there, but you don't actually see what's happened. And because of all of that, containers allow us microservice architectures. Actually, a whole other topic and would allow another three hours talking. But because they are so small, because they start so fast, it allows us to put one single service into one container. If we talk about Drupal hosting, the PHP FPM can be in one container. The nginx can be in another container. The varnish can be in another container. You wanna have as small things as possible because you can reuse them, you can distribute them and stuff like that. And if you have VMs, good, you can still run container systems on VMs. You can still, you still need, like if we look at the house or if you look at an apartment, you still need a plumbing system, you still need a power distribution system that's just shared. The same is for VMs. So if you usually look at like graphs, how Docker is used, you have the physical server at the bottom. You have the operating system and you have the Docker engine. What that Docker engine exactly does or a container engine, we will see later. And on top, the three different apps, these are our containers. So there are our apartment buildings and all the stuff at the bottom is the things that is in the bottom usually of the apartment house. But we have our app in there and we maybe have some libraries like our Drupal code is in there and maybe an nginx or something like that. And we have multiple of them. But in here, there's no virtual machine. So it's still possible to run containers inside a virtual machine. So this is a setup where we have a hypervisor, which is basically what the virtual machine is doing. It hypervises multiple operating systems. So we still have the physical server at the bottom. Then we have a hypervisor there and then we have an operating system with then a Docker or a container engine with then again, multiple apps. And this is actually what you're getting if you go to any cloud provider today, they will do the hypervising stuff for you. So if you go to Azure, AWS, Google Cloud or whatever, they are having for you, you don't see it but they're running in hypervisor for you and they're running the physical servers for you. Yes, it's the cloud and it's somebody else's server. It's still there. You may be not seeing it. So what you're doing, you're actually doing the top part. So you're installing the operating system on top of that virtual machine and you're having the Docker engine or a container engine that then runs the actual containers. So a lot of people say like, okay, yeah, that's cool and who actually uses containers? Well, turns out all your Drupal friendly hosters, they're all using containers, you just don't see it. There are other companies. Visa, for example, runs 100,000 transactions through containers every day and they're starting to do more and more. The Netflix series that you watched maybe on the weekend got encoded inside a container. Netflix starts one million containers per week and yes, they also throw them away again. So they moved all of their infrastructure onto containers and everything that happens on Netflix is happening in containers. And you ever heard about Alibaba, the singles day? They made 12 billion dollars in one single day and it all ran on containers. So the big companies, they're already there. They're already using it. Why? Because they are like that, they are fast and you can reuse your existing infrastructure even better because you don't have to move virtual machines around, you're just moving containers around. So that means they actually reduce their amount of hardware sometimes even up to 50% and it's better for the developer as well because we will see later how exactly that works. So all of that now was about containers. But what does it actually has to do with Docker? Because everybody uses the same in the same sentence and using the same. Well, so what Docker is is an implementation of containers. If you run a Docker, it starts you a container but Docker is much more than just running a single container. So Docker, for example, has the Docker engine. We saw that now a couple of times. So the Docker engine is responsible for running the containers, for looking that they're actually running. So you can tell Docker if the container dies, please restart it again for me automatically. You have networking in there. So it creates virtual networks, virtual interfaces, stuff like that. It makes sure that you have storage. You can connect storage to your physical storage or you can connect to somewhere else. It makes sure that nobody else can access it, that the security is given and Docker even has a plugging system. So if you want to extend the functionality, you can do that. That's everything given if you install Docker on your local computer. You install the Docker engine, which brings all these things which technically have nothing to do with the container itself. It's just stuff that has been built around because containers actually exist since a long, long time. They were just not really usable. They were not easy to use. You didn't just run one single command, Docker run, and you had it. But now Docker actually brings that in. Docker also introduces the ideas of images. So a Docker image is a full representation of the app that you would like to run. So I can build a Docker image on my computer and I can send it to a hosting company or to my server, and everything that is necessary, so all the files and all the configuration of that container is all in that single Docker image and I can push that around. So it's a very easy way to distribute stuff. It's like a virtual machine image, just going back, it's much smaller. The smallest Docker images are maybe two or three megabytes. You can still build them very big, you shouldn't, but. And the very interesting thing that Docker did, they implemented a layer system. What does it mean? If I'm building a Docker file completely fresh and I'm pushing it to my server, the whole Docker file is gonna pushed up there. So let's say my Docker file with my Drupal site in it is 400 megabytes, I'm pushing 400 megabytes up there. Now I'm changing just let's say one single file or a couple of files in my Drupal, build a Docker image again and push it again. The Docker's layer, the image layer will realize that only parts have changed and will only push the changes, let's say 10 megabytes over there. So the rest of the 390 megabytes, they're not pushed because what happens, they're hashing it and they're comparing these two hashes and realize I don't have to push that anymore. So it's very, very fast. You can deploy changes in a very, very fast matter because the system actually realizes what has changed. That is something that got introduced by Docker and has also, that's one of the reasons that why Docker is so successful because you can now push a tiny change within seconds to the production side. The next thing they do, there's a Docker registry. The Docker registry is the storage for your Docker images. The most famous one is the Docker Hub where a lot of people go but you can actually, the Docker registry itself is a container so you can run it in your already existing Docker environment and it just allows you to storage for all your images. You can push them there, you can have private ones, you have authentication so that not everybody can run your Drupal site on their own servers even though that would actually be a cool idea but people don't like doing that so it also makes the whole thing safe. And the last thing you maybe heard about is Docker Swarm and Docker Swarm is an orchestration system. Not a term, okay, let's look at that. So what is orchestration? Other orchestration tools or like Docker Swarm that we just talked about, that's Docker's own invention and that's what they're pushing obviously but there is also Kubernetes, there is OpenShafe, there is Rancher. So the problem a bit because containers can start very fast and you can move them around very easily that also means they're dying very fast and dying containers is not a lot of fun because then your Drupal site is down. So you need a system that orchestrates like a group of containers. So the orchestration system, you tell the orchestration system like I wanna have five containers of my Drupal site running and that orchestration system looks which servers or VMs are available, which ones are used and distributes them. If one of them, let's say the whole VM dies, the orchestration system realizes oh I only have four running, now I start another one or it can also do scaling so we can look at and say like oh we have a lot of traffic coming in I'm starting more containers. So it's the system that on top is and looks at what exactly happens, what should I need, et cetera.  They are not made to be there forever and if we go back to the Netflix, yes they are starting one million containers per week but they're also stopping one million containers. And I think that's the weirdest part to understand. A lot of times if we talk about physical servers or virtual machines, we think about something that is started once and stays there until I stop it. With a Docker container for example, if we deploy new Drupal code for you, we're not exchanging the Drupal code in the existing container, we are starting a new container with the new code. Make sure that everything is good. And then we move the traffic from the old container to the new container, are still monitoring if there are any errors or problems and only after some seconds that we are sure that the code in that new container is good, we're stopping the old one. If during that time we're realizing that something is flaky and there is errors, we just move the traffic back to the old one and we stop the new one and tell you hey there was an error and we show you the error. Something that has never been possible before with virtual machines, because with virtual machines we're replacing code all the time and now go back to what you had an hour before. It's very hard with containers that is possible. Again, all handled by an orchestration system. So why should you care? So the very interesting thing about Docker or containers in general, these Docker files can be written by developers. In the past, if you as a developer wanted to, let's say, deploy your own elastic search, you had to learn about configuration management systems like Puppet and Ansible and they were complex and things like that. Now with Docker, you can do it and you can actually run it on your local computer first. You can write the Docker file, you can create an image and you can run it locally to make sure it works and then you push it the image, you push up to the system and it's gonna run there and you can be sure it's exactly the same. With VMs, technically that's also possible. You could build your own VM locally and you could push it to somewhere else. The problem is you're gonna wait 10 minutes because it's gonna transfer multiple 100 megabytes and with Docker, even if you do it once and you push it, the next time, it will only push the changes. So it's very fast. And now you wonder, why do I care about that? Well, the problem is in Drupal itself, Drupal is much more than just an NGINX the PHP and the MySQL. We have now, right now, three different PHP versions. We have varnishes, we have NGINX, we have sites that use Node.js, we have MongoDB, we have Elasticsearch, we have CouchDB. So suddenly, it's much more. So the hosting company that tries to run your Drupal site doesn't even know anymore what they should run because there are so many different ways of running a Drupal site now and connecting into different systems. With Docker, the developer can locally configure everything he needs for his website. It's his own choice if he needs PHP 7, PHP 7.1, if he wants to use Elasticsearch or MongoDB, whatever. After he has all of that done, he pushes all the images to your hosting company and the hosting company is just gonna run the images in there. So there is no necessary to go to UI of the hosting company and select, like, oh, I wanna have an Elasticsearch, but I've never tested it locally because so I don't know if it worked and these things. You can run it everything locally and test it. And the next is containers are used more and more and more. I was at DockerCon last week. There are companies thinking about running containers in cars. So they are implementing self-driving cars and the neural network that will drive your car is running inside a container. Why? The same reason. They can very easily distribute that. If you wanna distribute a new system to cars, you have 100 millions of cars driving around in the world and overnight you wanna update all of them, you push them a new container image. And all the system, all the problems are gonna be fixed that you like how to distribute them. So a lot of people are trying to use containers even in maybe the beginning, very weird ways, but if you think about it, it makes a lot of sense. So let's look at the future. Docker just turned four. It's a technology that really has been involved over the last four years. That's very short. That's like yesterday in technology terms. So if you look at the future, we have now operating systems which say instead of actually running a service, so your network stack or your syslog instead of starting them, they're starting a container that runs them again. So everything inside your operating system is running within a container. It's just the operating system running, Docker running, and then everything single is a container. Windows or Microsoft announced, they're already having it running, you can now run Windows inside containers. And not only that, you can also run now Linux containers on Windows machines. And I'm not sure if people really understand that. That means if your client runs everything on Windows and forces you to run on Windows, you can still do everything on Linux. You just send them the Docker images. They sit in there, they do Docker run, and it runs. They are happy because it all runs on Microsoft infrastructure, they don't have to change anything, and you're happy because we can use the Linux that we all use all the time to host. Then there is an open container initiative which actually defines how a container should look like, how a container should behave. Because there is not only Docker, there are other container systems coming up like Rocket or other companies are also thinking about doing them. So it's not only gonna be about Docker itself, it's gonna be about containers where Docker is just one of the flavors. But we want that let's say one container that has been built on Docker also runs on the Rocket container engine and things like that. And that's what the open container initiative is about. So it's like in HTML, we all have a common standard of how HTML looks like. So I don't have to build my site for different browsers because they're all doing something different. The same we do also in containers. We decide together as a community, how should the container look like and how should we do it. And that's gonna boost the adaption and the possibility with containers much more. That's it. We have three minutes for questions. No, it's a very short presentation. Yes, can you come to the microphone? Can you talk about the relationship between like containers Docker and the underlining operating system like CoreOS or something like that? Yes. So technically it's not necessary for operating systems to actually know what you're running. So like you can run Docker on almost any Opera Linux operating system. Like if Ubuntu I'm just installing Docker and I'm running it. The thing though that there are some things that the Docker engine has to change on the operating system in order to work very well. And so what obviously happens is that now we have operating systems that are implemented from the beginning or architecture from the beginning to run on containers. And one of them is RancherOS that has everything in there. There's CoreOS as well. That just makes it easier to run Docker on them. Because if you never think about let's say running directly and a web server on an operating system you can remove that part from the operating system from the beginning. And that's what happens. So the operating system implement or builders, they're building stuff directly from containers. Hi, thank you. My name's Mark. So I love the idea of making everything repeatable, replacing containers. We do some of that not with containers but with using Ansible to script our configurations things like that. I'm curious, you talked about just replacing a container. How does that work with a database container? Persistent storage is very hard because if you have something that dies and starts all the time, your storage, you wanna have to be persistent. So you can run containers or you can run databases in containers. It's not easy. It's possible. Basically the key is that let's say you have a cluster or you have a Docker cluster of like 500 nodes that technically your MySQL container could start at one of them. So what do you have? You have an underlining storage system that allows you to connect it to any of them. So if you talk for example in AWS, the storage of your container is actually attached to like an EBS volume or an EFS volume. And then wherever the container then starts again it attaches it again to that storage. So that's all handled by the orchestration system. So a container in an orchestration system can say I need persistent storage. And when I start again on another node I wanna have the same again. So then it's connects all the things together. Good question though. It's not easy to run. Okay, we have to already move. If you have more questions I'm around the whole week happy to answer anything.


Hi, and welcome to Learn WordPress. Let's have a closer look at using block patterns. Block patterns might just become one of your favorite tools within WordPress. You will have access to adding pre-made designs directly into your site. Block patterns are basically layouts of group blocks ready for the picking. It will essentially save you time but also enhance creativity and design. Instead of nesting and grouping blocks together, patterns have already done that for you. And in one click, you will have access to beautiful and functional layouts from call to actions, headers, columns, galleries, and more. To add a pattern, click on the plus icon top left, also called the insertter, and open the patterns tab on the right next to blocks. They are organized into a variety of categories to help you find what you need. Once you click on the category, you will see a preview of all the available patterns. And then you can just scroll down. You can also select explore all patterns at the bottom to get a bird's eye view of the patterns that come with your theme. And you can also go through them category by category. Let's look at a quick example. When you select a pattern, in this case one from my featured category, you will be able to modify the pattern to meet your design requirements. It can easily be edited in the same way as any other block. So once I've changed my heading, I can replace the images and, for example, change the background color of my group block. Some blocks, such as the query loop block, have patterns built into the settings of the block. So when you add your query loop block, it says you can choose a pattern for the query loop or start blank. So if you click on choose, you will be able to scroll through all the available patterns. And when you find the pattern you are looking for, you can merely click on it and it will insert into your page. And now you can go ahead and modify it according to your needs. The patterns that come with your theme are limited. If you want more patterns to choose from, you can explore the block pattern directory. And to do that, let's make our way to the WordPress.org website. Hover over download and extend and click on patterns. Here you can search and find new patterns to use on your website. You can type in the search block, search via categories, or browse to all the available options until you find what you are looking for. Once you find the pattern you were after, you can merely click on copy, return to your website and paste it into your page or post. And now we can start modifying it. And this is what my pattern looks like after altering it to meet my design needs. When you make your way to the site editor to set up your templates, you also have header and footer patterns at your disposal. Templates create a design for a web page, and this is usually done by adding header and footer template parts. So when you select the current header and click on the three vertical dots and then on replace header, you will notice there are various patterns to choose from. And once you find a pattern you like, you can just click on it and it will insert into your template. And now you can keep this pattern as is or use it as a base to work from. And now we can do exactly the same for the footer. Select the footer, click on the three vertical dots and select replace footer. And then choose a footer pattern that works for you. In this case, I'm going to select the footer called footer with background color and three columns. You can also add a new header or footer template part. And in this case, let's add a new header template part. Name it appropriately. In this case, I will just call it example header and then click create. And now we can add a header and then select one of the patterns. You will notice at the top it says existing template parts, ones we've already created but if you scroll down, you will notice some patterns that you can choose from. And then I will select a pattern that appeals to me. We trust patterns will help you save loads of time and also spark new design ideas. Visit Learn WordPress for more tutorials and training material.


Hello everybody, Andrea Mayesca here with dental L. So this is kind of like part two of a video that I had just done showing my new amazing scrub tops that I had ordered from the company Genu. They are awesome. So J-A-A-N-U-U dot com. It took me forever to know the correct spelling but I will leave the link for you guys on the bottom because you can get $25 off anything from that website. If you're in the U.S., it is awesome because I think it's like free shipping. Here in Canada, thankfully they do ship to us too.   They are so nice. Like check this out you guys. You can't find nice tops like this and they just look a lot less frumpy. They're more form-fitting. I have the size extra small so I do suggest going a size down if you're new to the company because I would typically order a small but I'm glad that I did do an extra small because I think I saw on their website to go a size down. So but check this out in the end like this neat like little zipper part here. I don't know it just looks more professional I think and when you have like nice tops you just work happier you work better in my opinion you're just happier to go to work right and trust me people will say to you oh my god that top is so cool where did you get that everyone will want these tops. I do have some pants too. I actually ordered the pants a couple years ago but they were a bit too small for me so I didn't really wear them that much to be honest but they do have amazing pants too. I just have to get the right size. I probably ordered an extra small in the pants too but I needed a small so I just need to get better sizes but their tops are always a win and as you guys can see I love dental. I have my dental watch. I have my bracelet. I have a couple of these bracelets actually. I love them but I will leave the links for you guys on the bottom. Thank you so much for watching. The sun is coming out so I hope you guys can still see me because my currents are kind of sheer. Well they are sheer. If I was like this it'd be even sunnier trust me. So sorry it was kind of hard to see me for the last part but thank you guys so much for watching and I'll see you in the next one.