 Hi, yeah, thank you. I'm surprised happy and scared that so many people are here actually So this is my second conference talk So in case I collapse and faint, please don't make pictures. Okay, be cool So welcome to my talk dog. I meet Python a look on the dog a SDK for Python and What I'm gonna talk about is briefly introduced myself and then the dog a demon and service what that is Then of course the dog SDK. So that's the topic. All right, so where you can get it and some ideas of possibly use cases So hi, my name is young 32 years old not married but engaged No kids yet. So that's good for me at the moment I'm a data science consultant at xantec. That's a small consultant company in Germany with different locations all around Germany and of course like every company here we focus on data So if you're interested in job wise or project wise just get in touch with me You can do that via email social media or github I will put the slides on github later, but they are already on the conference page. So if you want to look them up All right, doger who few has used doger Okay, that's good. So you basically know what it is and how it works So after you installed doger on your systems on your local laptop, I'm assuming just a local laptop The demon or the service is reachable per default within the from within the system So from local host or you can configure it to be reachable from outside and If you have the demon, of course, you want to talk to it kind of And there are different ways to do that. So I separated the command line You know, it just put in doger something something Or you can use Graphical user interfaces like catmatic or the doger extension for visual studio code, which I personally like a lot Or you can use yeah, webgoo is like portano but well Sometimes depending what you want to do these options are too big or too small And maybe not customize customizable enough for you So this is where the doger stk comes into place. So just build your own To get it it's easy. It's officially available for python and golang There's an awesome documentation available So it's really just pip pip three install doger And for conda, there's also a package available On some small code examples If you go to the website, the code examples are written in python 2 I don't know why it is supported, but I wrote them to yeah, you see it on the print statement on in python 3 So on the left side, you see what you would usually type into the command line And on the right side, you will see the equivalent if you would use a python script and use the doger stk So it's really just import doger Then you get you use some name like client that would be best practice Doger dot from nth without any further parameters. This means you want to connect to your local Doger service. You can also connect to a remote one Yeah, and then you can pretty much do whatever you want Um in this example the print statement is only because hello world usually I guess you who did the hello world example from doger Only a few Okay, if you start this this is just an image starting up a container printing on subtext stopping the container and that's it So if you use the print statement here, you will see what was given out on the standard out Um, you can put an image in this example the alpine image. Um, it's yeah pretty straightforward Nevertheless a hint if you use to use the command line interface from doger Um, you usually type doger image doger container Doger images is uh, yeah Exception that works on the command line, but if you use the um stk, it's always images and containers. So uh plural and um Yeah, if you use a proper ide auto complete will solve this problem But if you just go into I don't know some easy text editor, this might be a trap all right So when I wrote the proposal, um I was thinking about some ideas and use cases and some that I use and one is um Yeah, just to use python as a container starting script um, these are two examples more or less like the original on the, uh, hub doger hub side for postgres And uh, depending what you want to start these commands get really really long and um Complex and if you want to change something in the middle, you have to use your back keys and You might Save them in the text file and copy paste them to your command line But that's somehow not so cool So my first idea was okay python comes batteries included just import os and then With os.system you can give a command directly to your systems shell But I want to show you the doger stk. So This is maybe one example how it could work with the stk. So you just um, yeah declare your variables with strings or with a list of strings then um You get again the the The client object the doger object um Yeah in the variable client and then you can just put in to the Parameters all your variables and that way you can um Yeah, easily list up all your parameters Yeah, more easy more better to read maybe easier to change if you have to change them regularly and um I think sometimes this is quite useful You could also extend it a little bit So you could um if if a container is running at the moment You could go and Yeah, get the idea get that container and stop it you can prune it or delete it in that case If you haven't started with the command that it should delete automatically after you stopped it Then of course you can build a new image from a doger file that is From a doger file that is saved somewhere And you can get the idea and then start again a new container with a new image that you just built another idea was Yeah to get the logs Yeah, you can just stream the logs of one container And yeah write your logs wherever you need them maybe in a separate text file Maybe directly into some database that you set up um Or whatever comes to your mind and whatever is helpful for you Of course you can do this with several containers and not just one then Another idea that I had when I wrote the proposal was okay Why not save all your python files in one folder use it as mounting point Then spin up different um containers with different python versions and Mount your python files there and then run pytest And I have to admit that When I started to prepare the talk and then started to work out on this use case Somewhere in the middle. I was like, okay, that's It it can work But maybe it's not really useful So in that sense maybe just um Yeah, write a whole CI CD pipeline if you're at that point, maybe that's really the better choice And yeah, I'm noticing I'm way too fast Like really way too fast Means this is already a wrap up Um, but I guess you're not so angry about it to get to the coffee break Um, so um, yeah, depending on your task at hand that you want to solve on your on your laptop Um, python might be a better choice than for example a best script. Um, especially if you want to Maintain it and maybe keep it readable kind of And the doggie stk might sometimes be a better choice than um, yeah import os or equivalents and Yeah, at this point, I hope that you at least have a high level idea about the doggie stk and some inspiration there for you for a day to day work and say Last hint, um, I can really recommend the doggie documentation. So for the stk or for doggie itself it is Usually up to date and really good and a lot of informations So now that I was so fast, we have a lot of time for questions. Thank you Thank you very much for the fast talk. And as you said, we have now a lot of time for questions. So I So first a comment I have been doing talks for like 13 years and yesterday I was also early by 10 minutes. So yes You created the client by calling docker.from.mv. What does it do exactly and what are the other options for creating clients? um so What it does exactly exactly I can't I can't answer But was it what but it does that basically creates an object that is connected to your local Demon to your local service docker service And of course you can give it parameters to connect some to some remote docker service You can use it with authentication with hdps and so on and so forth Thank you Hi, thank you. Uh, how is your experience with windows with this sdk? um okay But there's that any issue. Yeah, so if you install docker on your on your windows laptop um It works if you don't have Like virtual box install that does not work in parallel. You have to activate and deactivate What is it called hyper v? um, so that's one point another point is if you install docker on a windows laptop You have to give the service explicit resources like a memory CPUs and so and so on so it doesn't take that on need And on the other side all these resources are locked if you have the demon running without any usage Uh, so it works, but on a linux system it works better At the end is us working with a command line. Yeah, okay. Thank you Any further questions? Cool, then. Okay, then thank you very much again and have a