Creating Applications for Fusion Using Docker Images

– My name is Dikshita Deuri, and I’m working for customer support team here in Lucidworks for past one and a half year Today, my colleague Vrinda and I will be presenting on creating application for Fusion, using Docker images We will be using AppStudio Enterprise search template for creating a UI application So before getting forward, I would request Vrinda to please introduce herself – [Vrinda] Hi everyone, I’m Vrinda And I work as a technical lead in the support team And I’ll be presenting ASE on Docker images, along with Dikshita – Okay, so now let’s move to the agenda for today’s talk Okay? So first we’ll see what AppStudio Enterprise search is Let me like go to the agenda (indistinct) So we’ll see first what AppStudio Enterprise search is We’ll see how it is different from the AppStudio Wizard that is available on Fusion 4x UI We’ll see how ASE is compatible with different version of Fusion In the talk itself, we’ll also have a short demo on how we can use different ways to deploy our search application WAR file on both Fusion 4x as well as Fusion 5x We’ll see how ASE Docker image deployment is done on Docker in Kubernetes And to compliment it, we’ll have a demonstration on how to generate a Docker file, and push our search application to the Google Kubernetes Engine We’ll discuss during the demonstration process itself regarding few of the troubleshooting technique And at last we’ll end the talk by discussing about benefits of running ASE on Kubernetes So now let’s start with it Okay Creating an enterprise search application, or if you say creating search application, shouldn’t be an overwhelming job Here in AppStudio, gives us a way to connect people with the search data, by building modern user-friendly front-end search application AppStudio Enterprise is an AppKit-bASEd web application, that connects your Fusion instance or any other data sources to the AppKit design framework It comes preloaded with a starter search app template, which can be used as an entry point for building a standalone search application ASE is a successor to the embedded AppStudio Wizard, which is available on Fusion 4x UI Both ASE as well as AppStudio Wizard are powered by AppKit framework AppStudio expose us to a number of front-end JavaScript services, and these services are bASEd on AngularJS framework Moving forward on Fusion 5, AppStudio will no longer be included on Fusion UI However, we can use AppStudio Enterprise search, to create app or Fusion file And one of the very exciting feature that AppStudio support, is building of Docker image and running it as a container So this gives us even more flexibility and compatibility to work with Fusion 5x Now let’s see how ASE is different from the AppStudio Wizard, which is already available on Fusion 4x As I mentioned earlier, right, that both ASE as well as AppStudio Wizard are powered by AppKit framework But ASE is not included with Fusion UI, it is a standalone Java-bASEd web application, that connects your Fusion instance or any other data sources to the AppKit design framework On the other hand, AppStudio Wizard is an app development wizard building within the Fusion 4x UI Since it is included in 4x UI, therefore its version always matches the version of Fusion it’s running on, which contradict with AppStudio Enterprise as its versions are very loosely tied to the version of AppKit framework it include It releASEs when a new version of AppKit is releASEd So for instance, the AppKit 4.11 just got releASEd, and so as AppKit AppStudio Enterprise search 4.11 As a result, AppStudio Enterprise itself does not need to be updated, to move the latest code from one version to another simple code change of AppKit version can be done in the pom.xml as well as in the package.json Now let’s see how ASE is compatible with different version of Fusion So any version of AppKit framework, can be used with 4x, but there’s a restriction when it come to Fusion 5 In Fusion 5, the AppKit framework 4.6.0+ is only supported Now ASE is compatible with any version of Fusion,

that has worked with Fusion 4x as well as Fusion 5x ASE is also compatible with any AppKit framework Therefore we have our preferences to choose which one to use, bASEd on the availability, and the Fusion version we are working on Now, let’s see how we can upload the WAR file on Fusion 4x as well as Fusion 5x cluster Since Fusion 4x AppStudio is included in UI itself, therefore we can create our project, and then upload our WAR file from the UI itself On the other hand, as I mentioned, in Fusion 5x, AppStudio is not included on the UI Therefore we’ll be creating AppStudio bASEd search application, as well as deploying the WAR file using REST API calls In the upcoming slide, we’ll see what those REST API calls are, and we’ll have a short demo of uploading a WAR file on both 4X as well as 5x cluster So as you can see in the screen, this is a screen snippet of my AWS instance, which I’m displaying here I’ve created a project named as Bannerghatta National Park in the 4x excuse me, in the 4x UI And there’s an Upload button, right? So in that Upload button, you can upload our WAR file And then just above the Upload button, there’s a view publish UI, on click of which, it will navigate us to our AppStudio search application Now generation of WAR file requires script that need to be executed, and that is ./app-studio package And this will create a WAR file as well as the JAR file inside the dist folder I will show you how it is done moving forward If you see, as I mentioned earlier, in Fusion 5, we do not have any UI for creating a project of AppStudio nor to deploy it So we’ll be using REST call The first REST call, as you can see here, the first API call, we’ll be creating are project inside our Fusion app The app name is the name of the Fusion app that will be there in the Fusion cluster And the ID, that is my movie ID as you can see, my movie app, is the name of the project, which I will be using The second command will upload the WAR file As you can see, there is a data binary and the path of the WAR file and this, we will upload it to our project that I just created So there is one more thing in Fusion 5, when it comes to deployment of the WAR file You need to be very sure about what AppKit version you are using If your AppKit version is less than 4.11, then you need to expose your Web App Service with Load Balancer, before accessing the UI Because until and unless you won’t expose it You won’t be able to access your UI There’s a command, as you can see here, of kubectl expose deployment, which we will use to expose our deployment We can do it from the Google console UI as well I’ll show you there, how it does that Now let’s move to the demo (sighs) So I’ll be sharing my screen, just a second I hope you are able to see my screen So this is an AWS instance on which I have deployed 4.2.x Fusion And this is the AppStudio UI, where I have created a project name, Bannerghatta National Park We have an icon of uploading the WAR file, as well as we have the icon of viewing your published UI So, just give me a second As you can see here, So this is my project for a Fusion 4 cluster I have named this project as AppStudio Enterprise 4.10.0 fusion 4, F4 this is the dist folder, if I show you the dist folder I have already generated a WAR file here just a few minutes before, since this process can be a time taking So I have generated a pre-hand To generate the same, what we need to do is we need to execute this command (keys clicking)

And once this command is executed, your WAR file will be created on the dist folder, as mentioned here So what I’ll be doing, I will be uploading the WAR file here (keys clicking) And as it is publishing it, let me like show you how the published UI will look, as this may take a little time So this is the same AWS instance, and this is the published UI As you can see, this is my project, that is deployed with the same WAR file So this is how it is done on Fusion 4x Now, let me show you how it is done on Fusion 5x cluster as well So if you can see, this is my Fusion 5x cluster, it is running on 6764 port And as you can see, I need to log in it once more time, let me login it Yeah, as you can see, we do not have a Build UI option here So we need to use a REST call to do it I already have three of the project running here As you can see, this is the URL where we can see what our projects are There There is animal shelter, animal shelter two, animal shelter one So for the demo, I will be creating one more project So let’s give it the name as an animal shelter three So this is the curl command that we’ll be using This is the Fusion host, and we’ll be executing this command (keys clicking) So as you can see, my upload is completed My project has been created with the name of animal shelter three You can see it here itself also So this is the animal shelter three I do not have a WAR file yet on it, as you can see on other, there are WAR file already present So what I’ll been doing is I’ll be creating a WAR file I will be uploading the WAR file that is already there So this is on my Fusion 5x cluster, the process is same of creating a WAR file So yeah So this will take a little time to upload my WAR file So as it is happening, let me show you, I already have one cluster, one of the project deployed, like, as I mentioned here This is actually animal shelter two So this is already deployed and this is how the UI looks Okay, so we are able to view this, because, as I mentioned, we need to expose our Web App Service, as a Load Balancer So as you can see, this is my Google console, Google cloud console, and this is my Web App Service And in the Web App Service, I have exposed my Web App Service as a Load Balancer You can use the command, as I have mentioned in the previous slide, or you can just go here, we have an Expose option, we can go there, we can select the name as Load Balancer And we have to give the targetPort as 8780, and we can expose it As it is already done, I’m not doing it let me like go back to my command prompt As you can see, yes, my project got uploaded My WAR file got uploaded and you will be able to see it, if I changed to three, the project will get loaded Yes, so this is what it got loaded Here is a small project that we have developed More about it will be described by Vrinda in the coming slide So this is the small demo of how to upload the WAR file Now I request Vrinda to carry forward with the other slides – If you see, this is how your Docker file will look like We have this key for key-pair in the Docker file Let’s start with the From It will just build an image of the Java 8 on your container,

and install it there Then we can pass on the arguments, like the arguments that you define that variable, that user can pass during the build time, okay Furthermore, you can add to a JAR path like where this particular JAR will reside on your container and from where the source will pull this particular JAR set And then you can also provide Java environment variables with the keyword ENV So here I’m not really providing any Java options when I want to build this particular JAR So it is empty Furthermore, I’ll be building this application and exposing on port 8080, which is default AppStudio port So this is what I’ve done like to expose this particular port, that by default it is the TCP port So that’s what we have exposed 8080 for Furthermore, there is a keyword for Entrypoint, so basically where I want to execute this particular JAR So here in the container, it will just execute this particular command say, Java, JAR, and appJAR that has been built, that has been copied from your application or from your image to the container And here I have some Java options for Java security edge This is particularly for grading a random number, in the session of Docker, which we’ll just make the Docker application, to be deployed a little faster So we will not really worry about this one right now And looking to this particular Docker command that has been introduced in ASE, it’s like you just do AppStudio Instead of AppStudio start or package, you can do Docker package, okay This will basically create a JAR or a WAR file again on the dist folder, which will be no good to deploy on any Docker container So here you have this options to package and start at the same time, or just package it With the Profile option, by default, it will be a development profile But you can, when you are deploying it on a production, you might want to change it to production, so that the config files of production will be pulled in this particular JAR file that will be built Lastly, you will have an option to define what should be the name of your Image, the Docker image So, and it will be by default tagged as Latest So I think it would be good if we just now have a small demo of this Let me share my screen Yeah Okay, so I have this here, this is my terminal, let me just see that Yeah, I am in the project AppStudio ASE 10, 4.10 is what I’m using here So if you see, I just create this package, the same command that we just discussed about right now And this is my image that I would want to give So it’s a gcr io lw support team is my cluster name, the project name in the GCP So everything that I packaged and just deployed over the Google cloud console, that’s what we will be using in this particular demo That does not mean it is the only one that is supported You can deploy it on any of the Kubernetes application platform that is AWS or OpenShift So yeah, let me just create a image, which can be pushed to your Docker container registry So this might take a little while This particular image will be tagged as this image name, the production, which will be pushed to your GCP container registry Give me a moment, it will just create a image Yeah Okay, it’s just building it Hmm, yeah, so yeah, while we see that this is deploying, let me just move on to further

Okay, it is tagging this as Latest, and we are good to go Yeah While this is building further steps from here will be that we will just push this particular image that has been created, to the Docker container registry Once this is done, you will be able to see it here Let’s not wait for that process, I have done this in past I’ll just show you how it will look like So this is where your images will be shown in the GCP So I had tagged it as Production So yeah, this is the one latest And once this is completed Okay, yeah, this is done I’ll just push here And once this is pushed, I’ll be able to see my latest application over here And it will be, this particular image, the new one will be tagged as Latest So we can just deploy it as it is, and expose it as a service So yeah, it’s building Further, let’s just see how it can be How can we just make a deployment out of it, once this is done? Okay Did I just Okay Let me just push it rightly Okay, this has been pushed I’ve created a deployment out of it If I go to UI, I will see in the workloads that this particular deployment is present Yeah, it is present This is how your YAML will look like, okay We have this image that is Latest, this is the container If you see, this has been tagged as the latest one Once this is done, you can go ahead and expose it as a service Let’s see, once this is exposed as service of types or Load Balancer, you’ll be able to see it here, okay It is exposed Mm, yeah Here you can see that, I have just used this targetPort as 8080, the same port that we had defined in the Docker file So the one that you define in the Docker file has to match this particular targetPort, okay If this doesn’t match, you will have issues Now, if I go here, this particular has been deployed and I have it ready here, it’s 3483, yeah So this is how it will look like once it is deployed, but lets see where I am on this one Okay, this has been So these are the commands that you can expose And then once this is done, exposed as a service, you can go ahead and do a kubectl, get services, it will give you the IP that we just are accessing This is how our application will be accessible And let me just walk you through the application that we have created I have this date facets here I have few facets that are searched within facets So let me just search and, yeah, okay karnataka Yeah, you have karnataka and kashmir here We have this pie chart that has been shown as a facet You can see what all national parks were created or established in particular year Then we have this Google API that we have exposed So this is just a geo map, that is, I think, a very new feature in ASE, okay You can just select the location and have this as a facet So it comes very handy when you really want to just see what all national parks are there in this particular area So you can use this Google maps API here Then we have this feature to export whatever results you get So here I’m using this media tag to export media tag as an excel Furthermore, I have these tabs here, which I have created one for each data sources

So yeah, this is pretty much how the simple application could go on when you are using ASE So this is pretty much like whatever you had in AppStudio 4 as a part of like wizard UI Yeah, so this is pretty much it Let me just walk you through a few benefits of having Kubernetes, sorry, ASE on Kubernetes platform So first of all, if you see, like Fusion 5 is basically cloud native Yeah, let me just share my screen first, the slides first So if you see a Fusion 5 is a cloud native application, but the few ASE is no more packaged with it So now if you want it to be in the old way, you can deploy ASE on your Fusion, like Kubernetes Fusion cluster as a deployment, and then expose it as a service or having cluster IP and expose it from using ingress So that is one way of keeping everything in one place Apart from that, you can also This deploying it on Kubernetes will be very cost effective So if we think, if during like holiday season, if you want to add more nodes you do not really have to go through very tedious process of deploying on each node, and then everything on tomcat All you need to do is just add a replica and the YAML file, and it will just open up more number of pods and you are good to go there So that is one way of auto scaling in Kubernetes Apart from this, it’s obviously a very fast market As we saw that I just deployed a product I just may pushed the image to the container, and then it was deployed off its own and we are good to go So it’s like very fast, you do not really have to have any third party in between to make this deployment process automated So yeah, you, save a lot of time and money there Apart from this, you can also integrate the deployment process along with the travis/jarvis or say Dockerhub So yeah, there are many ways to do it And it’s not just GCP that we have demo, you can have this on your on-prem cloud or hybrid cloud environment or OCP, Open shift or maybe AWS Kubernetes cluster So this is pretty much flexible when it comes to Kubernetes, like advantages are no less than Kubernetes It is like ASE advantages with Kubernetes it as another less than what you have in K8s So yeah, that’s pretty much it Here are a few references that he used along the way All the steps that we demo, I or Dikshita, are documented as knowledge-based on our support website So you can go ahead and refer those ones when you really want to implement or try it out yourself So yeah, that will come handy then And here are a few links that we used for demonstrating this particular exercise So yeah, that’s pretty much it Thank you guys