 Okay, so thank you for coming. So I'm Clement Verna, I'm working on Fedora infrastructure and I'm maintaining the container build system and today with Rado, we're going to talk to you about container testing with a library that Rado maintains, Konu. So my name is Rado Butenac, I'm maintaining Konu, I'm Clement, working for Fedora, and I'm also working in the user space containerization team in Red Hat. So today, how do we test containers? So we are living in the edge of CI, CD, all applications have unit tests, integration tests, and we have like continuous delivery, continuous deployment. But we are not really have a good and an easy way, a good framework to test containers that we are building and running on OpenShift Kubernetes as a black box. So that's the problem that Konu is trying to solve. And we have like really two main use case, it's testing standalone application, so make it easy to just spin a container and run some tests against this container. But also being able to test orchestrated application when you can actually bring up a cluster of containers and test interaction between each of your services. So here Konu comes to the way, and Konu is simple, a Python API for containers, and the word containers is important because it supports many container engines, also for standalone containers and orchestrated engines, and also provides helpful functions for testing containers. So I think the best way to show the demo. Yeah, we don't have many slides, it's mostly some demos. It's okay, the phone size. So I've prepared to turn on the book for this. So let's start with some Docker example. So it's as simple as import Docker backend from Konu. Here I'm just simply creating it. And I want to work with the NGNX image, so I will create the image instance. I already cached this image, so it's already downloaded. So I can inspect. Here is the output of the inspect. For this we are using Docker. So here I want to run this image as a container. So let's try. And we can verify if the container is running, and also get some useful information about the container, like IP address, ports, container name. And when we are finished with our testing, we can stop the container and verify that it's not running anymore. So this was very simple use case just to play with the Docker. And let's move to a more advanced example, maybe. So here I will use all, which I already pulled. And I will start the simple HTTP server here. So let's run it. So I can see that the server is running at the port 8,000. So I mapped the port 8,000 to the host also. And now I can use the HTTP request function to actually make a request on the container and verify the status of the request. And I can see that it was successful and show the content of the actual page that is served by the server. So we can see that it's just a simple list of directories. So we can make another request. That is on the specific path. Here is ATC. Again, verify that it's OK. And see that this folder is actually there in the content of the request. And this is the same step as we did before. So stop the container and verify that it's not running anymore. OK. So this was the example of the standalone image. But usually we want to test if our images are working in the orchestrated environment, like Kubernetes and OpenShift. So for this, Konu has also Kubernetes and OpenShift backend. So the workflow is the same as with Docker backend. So I will just create instance of Kubernetes backend. And in this example, I will combine these two. So I will also use Docker backend in the same way as in the previous example. So I will just don't want the OpenShift, the whole OpenShift image. And right now I can really easily try if my image is running in the Kubernetes with this method that is running in POT. We just specify just namespace. So now I can see that the POT, the whole OpenShift is starting. So I can verify if it's ready. And yes, it's ready now. And I can see some useful information about the POT. And when I'm finished with testing, I can easily delete it from the cluster and verify that it's already in the terminating state. So this is also the simple example of using the Kubernetes. But there is, for example, usually we want to use deployments in Kubernetes. So Konu has also support for this. And here I will do the same steps. I will just initialize the backend. And here I will use this simple template, or deployment template, and create the deployment object from this template. So let's run it. Okay, so I can see that there's a deployment creating and it's not ready yet. So I can, here I can get the status in the adjacent format. But anyway, it's ready and now it's ready. So all POTs for this deployment are ready now. And you can easily, again, delete the deployment. So this was for Kubernetes. And there is also support for OpenShift. So let's look at it. The beginning is just the same as the other backends. And here I'm just going to deploy this image. I'm using MariaDB. With MariaDB I need to specify some environment variables. Like this one is required. It's just root password. And I specify the project. So it's first import the image into the OpenShift internal registry. And then it creates new app. So I will verify if the POTs are ready. And yes, POTs are ready. Right now I can get walks from the deployment. And I can see that there was like MariaDB deployment. Don't be scared. It's like a full walk on this. But it's just all deployment of MariaDB. Okay. I can verify the status of my cluster and clean the cluster from the objects that were created by label of my app. So now I'm deleting all objects with label of my app. So that was like really easy way how to just try your image and deploy it in OpenShift. And verify that it works properly. But sometimes we want to get advantage of using source to I in OpenShift. So I prepared example also for this. So just check the status. So here I'm using the method create new app from source. And only difference is that I'm also specifying the source, which is actually the GitHub repo with my app. In this case it's Django. And I'm using source to I image of Python 3.6. So let's deploy it. So this is the same process. The image is imported. And the app is being created. So I can check the status. And I see that the build is running. And the deployment is actually... So now it's not ready yet. I need to wait a little bit. It's ready now. So the app is running in this spot. And the same way I can just clean my OpenShift cluster from the object that I deployed. So this was the quick demo. Like what you can do with OpenShift. But there is more things that you can do. And you can find it in our upstream repository, which is user.com. If you want to see... It's in examples here in docs. And there is like many more examples of how you can take advantage of Konu and test your containers with it. So right now the project is in the space that we would like to hear your feedback, actually. So if you would run some tests and try to write tests for your container, we would be happy if you provide us some feedback or some feature requests. So that would be great. Okay. This was for the demo. So in Fedora infrastructure we have started to use Konu to test our services. Because in particular, BODY, which is the Fedora update system, this is a very central service in our infrastructure that talks with the build system, talks also with the result of the CI that we run on the packages. So it's relatively important when we do our tests not to do only unit tests, but we wanted to be able to have integration tests and see how the interaction between all those services are working. So if you want to have an example of how we use Konu, the nice thing of Konu also is all the helper functions that it provides. And it provides a very nice interface to PyTest. So you can very easily create fixtures that are starting containers. And that's what we have in BODY examples. So if you want to have a look at what we have done, I've put a link to a very simple example. It's the PyTest fixtures that will start PostgreSQL container. And then you can use this container in Overtest to run your tests. That's very easy to use and quite convenient. We are also starting to build the CI pipeline for our containers. So in Fedora, we are building the Fedora-based image, but we are also building other services like PostgreSQL, MariaDB, or Source2Image images. And we would like to test the same way we are running CI on RPM packages. We would like to run CI on those containers and release those containers in function of the test results we have. So we are using the same framework that the RPM packages CI is using, but we are using Konu to be able to run tests and really as a black box testing, we start the image and we will just run a few tests to check if the container is behaving correctly. And I think that's it. So if you have any questions, we are happy to answer. So the question was can you use Konu to write tests that will be able to run on multiple back-ends, so maybe locally you want to run on Docker. So it might be doable using the fixtures in PyTest, so most of your test case would be generic and you would have a fixture per back-end, so you could actually choose, in function of the back-end, you would like to run, you could just swap the fixture. Yeah, we don't have a use case like that, but that's how I would try to do it. Any other questions? Yes, so the question was are there any ways of cleaning the containers in case of exceptions? So the question is, is there any plan to support container on AWS? And if it runs like, actually that might be a good feature request, as you said. So currently, I don't think there is any work on that, but there could be a valid use case. Any other questions? So the question was if you have already a configuration for your OpenShift cluster, can you feed it to Konu and manage and just reuse the same cluster configuration that you have that you deployed to run your test on? And if you can do with the specific objects from template in Konu? Yeah, I have a template that creates templates. Okay, and if you can individually work with these ports? Yeah, that's the good question. I think there is no support for this right now. But you can list your posts. Yeah, you can do this. You can see what objects you have right now and get the list of that. So technically you can do this, but in this one more step in between. For the use case where Docker Compose are used to set up developer environments, could you replace Docker Compose for Konu? So the question was, in the use case of a developer environment, can you replace, could you use Konu to replace Docker Compose using the podman backend? I think that could be. So the answer was that that could be done, but maybe Ansible is a better alternative for that. Okay, one more question? Thank you very much.