 Hi again Red Hat Developers. This is Jason with the Red Hat Developers program on day two of Summit 2017 or 2017. We're in the dev zone with Ken Finnegan. He's going to talk to us about Wildfly Swarm on OpenShift. Hi everyone. Thanks for being here. As Jason said, my name is Ken Finnegan. I'm one of the leads of the Wildfly Swarm project and I'm going to talk to you today about Wildfly Swarm and running it on OpenShift. So I'm going to cover Wildfly Swarm briefly. So what is it? We start with Wildfly and Java EE and we take a modern cloud application look at things and we add some non-Java EE pieces to give us those extra cloud native capabilities we need. And one of the big differences with Wildfly Swarm versus Wildfly is we package things in an uber jar which includes your deployment or the other option is to use what we call a hollow uber jar where your deployment is excluded. Now this has a slight advantage in that you can define all the pieces of Wildfly Swarm you want and create a hollow jar that can be used with many different web applications. So it gives you a lot of reuse there. So Wildfly Swarm is just enough app server. So we as I said we bundle your deployment whether it's a jar or a wire and then we have what we call fractions which define the pieces of Wildfly that you include in your uber jar. And so we can see on the right here we've got a Jaxrs application and we only bundle Jaxrs. We don't bundle EJBs or CDI if you don't use those things in your application. Along with the fractions inside the uber jar we have an internal Maven repository which has all the dependencies the project needs. It's also possible to specify that you don't want to bundle those but then you need a fully populated Maven repo locally to where Wildfly Swarm is running for that to work. And then there's some bootstrap code in there as well to fire up the Wildfly server. So fractions I've already mentioned but to go in a bit more detail they enable different Wildfly subsystems such as Infinispan or Weld but it's not just Wildfly subsystems. They can integrate additional frameworks and services so for instance Wildfly Swarm has a topology infrastructure for doing service registry and discovery. We can provide deployments that get added into the server as well such as the Swagger UI or the Jalokia wire. And using the Wildfly Swarm fractions brings in whatever API dependencies might be needed. So in the case of the Jaxrs fraction that will bring in the Jaxrs API from Java EE that are needed to code your application. And we can also alter deployments and modify the behavior of the application. So we can do this with Keycloak where we automatically propagate the bearer token through requests for you without you having to manually code it. These fractions are expressed as Maven GAV coordinates so we can see here that they have the group idea of Org Wildfly Swarm and then the fraction name and the version. So on the line below we can see that there's an example of the undertow fraction and the 21750 version which came out a couple of days ago. Currently we have about 184 fractions 158 of those are stable and 26 are what we call experimental or unstable. So these are things that might be new to swarm or areas that we're not completely familiar with so we want to give them some time in the community to bake and become more stable before we say we're happy with these and these are available for regular use. So of those 184 currently about 80 percent of them wrap Wildfly features. So whether that be Java EE or Wildfly Camel or any internal pieces of Wildfly that might be needed to run the server. And there's more coming in the pipeline all the time and we've recently added ones for Flyway and Drool Server and just to name a few and we're always looking for additional community contributions of fractions. So now I'm going to do a bit of a demo using launch.openshift.io. So this is the main page of launch.openshift.io and in the top right corner here we've got the request early access button so feel free to do this in your own time and request access. We'll be looking to grant access over time to this site but for right now I'm just going to take you through how we can do things here. So we can see we've got a choice of three different runtimes, one of them being Wildfly Swarm. So if we were to go through this process we then get the choice of how we want to get the deployment whether it's with a continuous delivery model or providing a zip file that you can then do whatever you want with. So in this case I've chosen continuous delivery and then we get the list of missions. So at the moment there's a health check or a basic rest mission available. We're looking to expand these over time so I've chosen in this case the rest and then on the next screen we get to choose the runtime and obviously I'm choosing Wildfly Swarm as that's what I'm talking about. So then from there we define some basic project info giving a project name to OpenShift. I've chosen to leave the GitHub repo blank so it gets the same name as the project and then there's some group and artifact IDs and versions that you can customize if you choose. And from there we get a review screen where it basically goes through everything that we're going to do when you click launch. So when you click launch it goes away and in each step it'll go through and create a GitHub repository, it'll push all the booster code into that GitHub repository for you, then it'll create the project on OpenShift Online and then it'll set up the build pipeline and also the web hooks into GitHub. So if we see that in action we can see here that this is the cloned GitHub project that it created for me and it's now available in the OpenShift web console. So this we have in the bottom we have the Jenkins master and slaves and this gives us the continuous delivery pipeline. The top one here is the actual booster with Wildfly Swarm that we created. So if we click on this it'll load that and it's not a short URL but it's accessible to the public and without doing anything I can just hit the invoke button and we can get the response back saying hello world from Java 1. Well that's not right so let's go in and fix that. So I've already cloned the repo so I have it locally and this is the code here. So if I go into the endpoint and I want to change this to be Red Hat Summit 2017 and now I obviously need to add that into a new commit and then we need to push that up to the GitHub project and then now that that's started we can go back and we should see over here that we've kicked off a new build process so that's going through the continuous delivery pipeline taking the changes we made from GitHub and then going to push them back into the project. So while that's going on it shouldn't take too long hopefully it's hard to know with OpenShift online sometimes things are very quick and sometimes they're not. So at the moment we've still got the old code running over here and we can pass in names and it works as it should and let's see if we can see what the pipeline's doing if it's actually doing anything. So it seems to be taking a little longer than it should to start. I'm not sure how much time have I got left Jason. Oh I'm fine on time okay. So we'll leave that going for a minute and hopefully that'll kick off soon enough. So we have the project over here and if I refresh the project in GitHub we can see we've now got the new commit over here already that it's picked up as part of the build. And while that's going on I can just be briefly tell you about the book I've started writing and is now available in Meep. It's Java microservices in action. It's focused on wildfire swarm but also covers some of the other projects that deal with uber jars and just enough run times and the like. And you can see here we have a 39% discount code for any Manning book if you use that code right there. And please go take a look at the book. I'm still working on it now but I hope you'll enjoy it and it's you'll enjoy it and it's a benefit and certainly provide any feedback that you can always appreciate it. So if we go back to the web console and that's still in a state of new okay let's see if we can see what's going on over here. So we're going to log into the Jenkins console as you can see I haven't done this before so just going to give it some access okay. For some reason that hasn't started a build and seems to be working but not working. So not quite sure what's going on there so we'll circumvent that for now and I'll just basically show it running locally. So we'll start up wildfire swarm and of course we're doing running tests as part of every build. So it's going to go quickly and run a test which obviously fails because I've changed things so let's skip the test for now. So this will do an inline packaging of the uber jar and run it and we can see there we're using Jax RS. And now that's available so if we go back to a browser and we hit local host and we can make that a bit smaller and that's a new version so if we click okay invoke then we can see now we've got the message of Hello Wolf from Red Hat Summit 2017. We'll have a quick look over here but I don't think yeah I'm not sure what's going on there but for some reason that build didn't kick off properly. Normally it works and it did work perfectly fine last night so I'm not quite sure what happened in the meantime. So we'll just carry on and that's pretty much it so if there's any questions from anyone nope okay well thanks very much for your time and I hope you enjoyed it.