 Hi good. Hey, thank you for thank you for coming today So this is a small presentation today, I'm not going to talk during 40 minutes I wanted to share with you my experience with the how how do we write the puppet modules in the open stack? So my name is Emilia Mackie. I work for Red Hat. I'm French. I'm sorry That's my accent. So you have to deal with that So I work for Red Hat. I'm working on open stack every day My job is to make sure that we can deploy open stack with automation tools and we are using puppet modules So we are contributing and using the puppet modules So this talk this presentation is about how do we write a puppet module? today we have We have a first introduction about the puppet open stack project If you're not familiar with the project, I will give some insight about what do we do? What do we deliver and how you can get involved? the second thing is I want to make sure that You know how you can contribute if you want if you are interested by Contributing or fear if you're already contributing, but you may be want to know a bit more I Will explain how do we build a new modules when some new project is created in open stack? What is the process to create a new puppet module and I will try to make a demo? if it works and Yeah, we will have time for questions So we have a microphone here at the end if you have some questions Please go ahead and I will be very happy to you know to help so first of all, I want to know who in the room is Already using the puppet modules Okay, so we can go to the beach and have fun Okay, so I will I will do an introduction about the project so Open stack is very complex. You know It's a it's a big project You have many many things to deploy if you want to get your first VM running Obviously, you don't need to deploy all the services, but still you have some basic basic things to deploy So I didn't create this picture. I took it from the official documentation, right? All the credits to the docs so yeah, that's very complex and Sometimes people Well, maybe not right now, but a few years ago I I met some people who didn't use any automation tool to deploy open stack and I was feeling like those guys were doing this So I took this picture last week. I was traveling in Spain and I found this very interesting and So yeah, don't try to deploy open stack without automation. That's my first Feedback I give Because it's very complex. You need you need to configure many things that you will you will miss a lot of things if you try manually so That's why a few years ago. We created the puppet modules for open stack So we the the mission statement is to it is to create puppet modules to deploy open stack clouds at scale for like real deployments in production The modules are are written by people deploying open stack so they know what they do and Very very involved in the open stack community. So from the developers and operators. So it's like a good mix of people in the team So how does it work when you try to perpetize open stack? We have a we have a puppet module per project. So if you're deploying if you're deploying Your cloud you will be able to choose which Which puppet modules to use depending of what you want to deploy We are using some modules from puppet labs to deploy for example my sequel rabbit MQ Apache So we we did not create those modules. We are using them from the puppet labs community They are working very great for us and we also have some libraries in in For example open stack Lib is it's a library where we have some common If you're familiar with puppet we have some common classes that we share across all the modules It makes the things more consistent. I will go through the details a bit later So basically If you want to if you want to deploy a new service you have to find for the puppet module And if it doesn't exist so you're in the in the good room because that's what we we are going to see today How do we create this new module for the service? So we already have a lot of services. You can see all those modules already exists And some of them are still a bit experimental, but we are working on this But if you don't see your project in in the list The list is not exhaustive here But if you don't see the your project in the list of modules on github You might want to create a new module if you want to deploy these projects so Most of the puppet modules that we created are almost the same they they share the same structure we have We have some we have some manifest to create the keystone resources. So the endpoints the The keystone service and etc. We also have some manifest to manage the database So you don't have to you have you don't have to create the database with your own manifest We already have this we support my sequel and postgres We don't configure my sequel for you we we just create the database for the open stack service, right? We we also manage the configuration files for open stack So for example in Nova, you have the Nova.conf file Which will be generated by the puppet module and we will create all the sections in the in the in the configuration file for you So you will have the Oslo section the keystone and all the all the parameters that are specific to the project so everything is done by In the module you will see some classes for each service and everything is done by the manifest Some modules are Well, some projects in open stack can be deployed the API service can be deployed with Apache in Whiskey and We we provide a class to to to make it to to deploy it out of the box very quickly so you don't need to configure Apache yourself we already have this this class working and Yeah, every module almost Manage manage all almost every every every services So if you if you want to deploy Nova in the module, you will see that we manage all the Nova services you want The modules are very Composable, okay, so if you want to deploy Nova conductor on this server or if you want to deploy Nova API on this one so you can split everything. It's very Composable all the parameters are documented which means that if you're new to the project and you don't know what you're doing I suggest you I suggest you to look at them at the manifest and You will see that all the parameters and all the classes are very in my opinion well Documented so you can just have a look and see what what it does So this is a very very basic example of how you could deploy Keystone today. So you just have to Well, I did this morning. So maybe I missed something but Basically, you can deploy my SQL and Keystone this way So yeah, just to let you know that yeah That's a kind of manifest that showed you can deploy Keystone very quickly The modules are doing everything for you if you want to do some like custom deployments with a very complex Deployment scenarios with HA and SSL and whatever You will need to obviously make a bit more than than this Like feeding some parameters and and so on So how do we test the module when we went when we when you create a When when you create a patch on your laptop you want to send the patch To the puppet modules you have a like a bug fix or you have a new feature The patch will go through the gates and the gates in OpenStack. We have different kind of tests Some of them can be run or your machine, but some of them are Well, it's very complicated to execute them. So we have the the CI jobs in place So for the one you can run on your on your machine. We have the unit test We use the aspect if you're familiar with aspect that's cool If you need some help you can ask to the team and and we are always happy to to to help when When someone need help to write some tests We are using also beaker beaker. It's a it's a puppet lab framework for Functional testing so we execute the catalog on a machine and we check that We can at least compile the catalog and install the service. We don't make any Test on the service itself. We have some integration tests Integration tests. We are running tempest So if you if you submit a patch in puppet nova for example We have some integration test that will Actually deploy nova and run tempest to make to make sure that you can spawn a VM and so on. So that's actual tests We have at this time. We have four scenarios for integration So we can cover all the projects that we have in the puppet modules Everything is documented in the in the and in the puppet doc, but in the puppet open stack doc, but it's not covered by this presentation We also have some testing By the open stacking steller. So we have triple low and fuel they they use the puppet modules So we every time you submit a patch. We also execute the The triple low and fuel jobs to make sure that we don't break them So that's also a very good feedback for us because fuel and triple low are two installers used by a lot of operators and they are Production ready. They are deploying h.a. Multinode. So it's very close to what you have in your cloud Even if you're not using triple low or fuel, it's it's it's much more close than if you use Dev stack or something else So yeah, that's for the testing a lot of testing we we made a huge progress over the last year because we thought that Testing is very important when you write puppet modules It's actually making sure the things work So now how you can contribute? Who is already contributing to the module in the room? Okay, good 10 people So how to contribute it's very easy There are you don't need to be a developer to contribute you can be a user you can be an operator The first thing I like is giving feedback So if you come to me at the end of the session and you say hey, we use the module it works fine, but That's already a contribution because that's feedback and we need that So if you want to give feedback you can give it through IRC emails or if you can file a bug That's that's the that's a first contribution If you're familiar with puppet you can write some code you can submit New features you can fix some bugs if you want We also have a documentation repo. So if you want to improve the doc And like I said, we have some tests if you're familiar with aspect you can also improve the the testing coverage and if you're like a User with a lot of experience in puppet open stack deployments You can help on IRC with troubleshooting and welcoming new New contributors who wants to you know, like deploy the first time So that's yeah, that's multiple ways to contribute and How to well how to technically doing this contribution there are many ways many channels The first one is to join us on IRC. We have a Free not channel puppet open stack if you're not here you should join maybe And we have a good team that who are here all the day We make good jokes and If you don't have an account for open stack you need to create one I'm not going through the details because that's That's a bit long, but I put the link if you want to you know to do it It's always good to subscribe to mailing list because we are doing a lot of communication on the mailing list like for example when we I don't know when we Change something critical in the modules that will impact you as a user We usually try to communicate through the mailing list making sure that you guys know that we are maybe going to break something And why we are doing that Or we are also doing some communication around the you know the the release management and And some design sometimes so that's also a good way to to get involved We have a weekly meeting on Tuesday And you're always welcome to join if you have any question like even if you're new to the project You want to start contributing you can join the weekly meeting and say hi My name is you know, and I want to help hope what can I do so that's also a good forum for us and Obviously you have the launchpad if you have any bug any feature you want We have a one launchpad So for example, we have one launchpad per per module So if you want to create a bird in puppet Nova, you will have to find the puppet Nova launchpad But if you have any question about launchpad and how the process works You just go on IRC and you can ask people. We just help the same day So okay, so let's go through the real topic today So how do we build a new module? so first of all, I want you to keep calm and wait a little before writing code and because in The last years many people creating new modules and my first feedback on this thing that most of the case people created the module on their own and they try to bring to open stack and That sometimes doesn't work because the module is not consistent with how do we do? so keep calm wait and Learn what we do. So don't create the module on your own github if you can wait and Communicate with the community before making sure that we are doing the right process. That's great So the first step for you is to check on github if the module doesn't exist already So if you want to create a module for I don't know I've heard before someone was working on dragon flow. So we don't have a module for dragon flow So you can check on github if you have a module for this thing That's the first good step making sure that you are not creating something that already exists and then we have We have some process to You know communicate about hey So we don't have module for this project. Can I can I work on it? Can I start this? Making sure that nobody has is already doing this work, you know Because it's a new repo. We need to we need to change some little things in the governance It's nothing. It's nothing Difficult it just a patch to do and usually the core team is doing is doing it for for people So there is nothing to to worry about here The most important thing is to create the the Repository so for that you need to submit a patch in open stacking fraud if you don't know how to do it Don't worry. We have people in the team. They do this very very often So we can even do it for you So the this this thing will create the repo for you. It will create the ci jobs The Garrett permissions and so on so that's the first step before Writing code and writing the module you need to create the repo and then one once we have the repo We will run a tool that's called cookie cutter That will generate the puppet module so the basic structure for you So you don't have to write everything from scratch. We already have all the all the manifest and all the files I will go through the details after But you have a just to execute a script and then you can continue to work on Writing the the the rest of the module. So how does it work cookie cutter? We have a So we have a small process of Generate the module So you have to clone a repository by the way everything is documented I'm going to try the laser Yeah, so everything is documented here like this is like a very rough summary I am doing here, but the whole process is documented here So you don't have to learn everything like this but Yeah, so you have to clown the cookie cutter It's a repository that we created and there is a script. You just run the script. It's asking you which What is the name of the module and I think that's it so it's very easy and When you run the script it will generate all the files that you will need for for the module like a Jam file right file all the spec stuff the testing that you maybe don't know The the manifest that we have in open stack And yeah, all the things you need and at the end when you're done you can submit your patch it's usually a very big patch and The the team will approve this patch and you know, you will be able to continue to write Just the manifest that you you want to be in the in the module so the process is very easy and we created that because We we don't want people to lose time on doing always the same thing So we have this tool which is generating all the basic stuff for you So when you generate this puppet module with cookie cutter, this is what you get You got manifest to Keystone resources like we said before you got manifest for database the logging the unit and functional testing the release notes if you're not familiar with the Reno it's a we know is the official project in open stack for release notes So there are some like specific files for managing the release note in the module everything is generated here and All the puppet dependencies So yeah, it's a data and and so on well demo already. Okay Wait, okay Okay, so Yeah, we thought my hands look So you need to install cookie cutter. It's a python It's a python project. So you need to use pipe to install cookie cutter And then you need to install two gems digest and module sync What? Sorry, yeah, okay This is This is the best I can do Okay, sorry, sorry, so this is the script we just run a new script So I took the example of Nova So you just run the script you say Nova and that will generate the things for you so you create, you know module name Nova the here and It's cloning the repo so puppet Nova is not empty but it's cloning the new repo and it will create all the files and At the end you can go in the repository and check the files. So everything is created for you So you have the initial commits With all the well all the files and all the modifications So this is a first iteration of the module which means that the units manifest is empty There is nothing but you also have the keystone out so you don't have to create the this manifest It's it will be the same at the other modules. It's just that that's for Nova So it creates the Nova endpoints Nova service. You can change the port of the endpoints. That's That's part of the process You can also manage the database my sequel. So we create the Nova database we manage the DB sync with Nova manage and When you're ready get review you send the patch and the team will review the well this first iteration of the module Obviously the next step for you is to You know work on the module to add the services you need all the configuration parameters Usually OpenStack has a lot of parameters. So we used to you know, like try to support them and And questions time. Thank you So if you want to ask anything, please go ahead. There is a bike here and If you have any feedback about the puppet modules or if you have questions about the process Maybe I want to fast for something. Please. I'm very happy to once well Thanks A lot and with these modules and my problem is that there seems to be a really long development cycle like you write a change and to test it you have to do a Deployment and loads of things to make sure that you change doesn't break things Have you found something that kind of shortens it? What's your usual workflow for these things? So is your problem that the test that we we had in the gate take too long time? Is it the problem or not necessarily the test when you're changing something locally You have to apply the manifest again and again and again and sometimes right the unit tests No doing the deployment locally for example or You have to redeploy from scrunch to make sure you don't you have a thing that works so do you Doesn't get easier with time Well the well deploying it depends of how many services do you deploy? I guess you have complex deployment maybe Usually it takes maybe 20 minutes to deploy everything from scratch Like install the packaging and configure and run the services. It takes 20 minutes even the test that take Like maybe five or ten minutes in this thing so I don't have any like Good reply to this my feedback on the test start that If you test locally you might need to use like some snapshots if you want for example When I'm doing functional tests on my laptop, I have a snapshot of a VM and If I do a change in puppet Nova and I realize it doesn't work I come back to the snapshot and I try again, you know, I'm not reinstalling everything from scratch I'm doing snapshots. So that's a way to do it I Hope it helps maybe Hopefully does I think it will all right. Thank you very much. Welcome And so I've been using the Juno versions of the modules for a while I'm just looking at upgrading so I'm looking at all the new versions of the modules as they are now How does the OS service default fact thing you work? I see that a lot in the new modules. It wasn't there previously Have you seen the so can you repeat your question, please like in the new modules now? This is OS right default. Yeah seems to be a fact of some sort. Yeah, I think that work. It's okay. So that's So it's a fact that we wrote and if if the fact is set if if you are using it we have a provider that will just That we just make sure that this parameter is not set in the configuration file. Okay, so which means that for example in Nova if you set OS service default to the parameter, I don't know like Scheduler scheduler backend or something The parameter will be unset in the configuration file. So we we will use the default in Nova, right? So why are we doing that? It's because we don't want puppet modules to override all the parameters We want to We want to we want to add the parameters that you need that you need that you set in the in the configuration But we don't want to be like, you know We don't want to choose for you what you what you configure in the files So we have this fact that we just make sure that the parameter is not set in the file And if it's not working if the default value is not working for you it's maybe a bug in in the project itself and And that's not we don't want to deal with the default value, you know, we have we so we had we had to in the past I remember that the modules used to manage default values We were taking the default values from them from the project. So for example, we were out coding the the scheduler driver in the in the puppet Nova module, but when when Nova used to change the name of the driver The module was broken because we were recording this thing. So we we said, okay Let's stop doing that and use defaults from upstream and if something is broken, it's upstream try to fix it there Obviously, we can fix it in puppet if something is very urgent, you know, but that's that's the welcome. Hi, there's a lot of talk and effort on Containerizing all the the open stack processes and services Where do you guys as a puppet team? See the role for the puppet modules and the future for the puppet modules in that light. That's a good question. So I Can give the example of the project I'm working on I'm working on triple and we are deploying Open stack on containers and we are still using puppets so It depends off. Well, I know also some people I don't know if Matt is in the room and Cody. I don't know. I don't know who Matt is not here, but they are doing a container deployment with puppet modules They are orchestration they are doing orchestration with puppet to deploy the containers and they are still using puppet to generate the config files So there is there are different way to do it So like I said, I'm working on triple O and on triple O we use puppet modules to generate the config But we use something else for the orchestration So we just we just think that the puppet modules are very good to generate Configuration files and then we use it for you know for running the containers so it depends of How do you use puppets? I think all the use case are different and So do you contain or create the configuration files on the host and then attach a directory to the container or the Create a configuration files in the container. So we create a config file in a container and then we ship Well, I'm not working on this today. I don't have the details but basically we create the config file on a container outside and then we build a we build the We build a container and we ship with the config file. I think that's how it works today. I'm not sure I Can maybe catch up after if you want and there are some triple of folks here. So maybe I can have But yeah, we use it to generate the config, right? So the cookie cutter is it only for the very beginning of a project or does it help you to kind of Update something that like if you add add like I think off-token for instance Was added relatively recently. Can you use cookie cutter to then update an existing module to bring in those new features? That's that's a good question. So Cookie getter is for the initial Creation of the module, but we have something else that is called module sync And we have a project for this that it's actually cookie cutter is using module sync to synchronize the repository if you already have a module if you already have a like a Git repo, it's a puppet module and you want to sync with the other puppet module So we have this tool which is not covered by this presentation, but it's all it's also documented I think you have to run one command and it will just you know like trying to synchronize the I Didn't do it. So some people in the room did I know but and I know the guy who did who wrote this tool is here And you know so you can ask Yanis, he knows how it works Yanis, can you rise? Yeah But cookie cutter is for initial Creation of the module right, but it actually use module sync So that's that's the same tools Cool. So we have five minutes. I guess we're done Thank you guys and I I hope you enjoyed the the summits and yeah See you soon