 All right, welcome, everybody. I think we're ready to get started. Today, we're going to talk about monitoring and managing your OpenStack Cloud on the go. My name is Megan Kostick, and I'm a software engineer for IBM Cloud Group, right now focusing on Swift at IBM. And this is my colleague, Michael Brewer, and he's also a software engineer in the IBM Cloud Group with focus on Swift at IBM. The two of us work on this website right now, the IBM Swift package catalog. If any of you are familiar with MPM, it's something similar. You can go and search for Apple Swift packages that others have written and open sourced on GitHub and find things like need something that decodes your JSON or sets up a web server, those sorts of things. But today for the agenda, we're going to talk about why mobile applications, some real world scenarios for taking OpenStack mobile, how to develop mobile apps in Apple Swift, do a design overview of our application, as well as a demo for you guys. So to start with, why mobile? So nowadays, the first thing that you interact with in the morning is usually your phone, and it's also the last thing you interact with before you go to bed at night. And so pretty much anything can be done on a phone. And going the term, there's an app for that. 64% of all adults, 18 to 65, have a smartphone these days. And also, emerging markets, mobile is really big there. It dominates the market. It's easier to access, and it's more affordable. So taking things mobile there is really important. And also, with a mobile phone, you can take it anywhere you want. You're out on the go, those sorts of things. And also, I just recently read that meal times at restaurants has increased by 25% because of mobile phones. People are posting their food to Instagram, Yelp reviewing their restaurants, all those sorts of things. So it's very ingrained in what we do every day. So some real world scenarios with OpenStack in mobile. So you can picture yourself a server administrator constantly wants to make sure their environment is up and healthy. They could do this while they're out at dinner, those sorts of things. Even a manager, he takes the day off, go play a little golf. But he's got a new employee coming in. So he's going to spin up a training VM so it's ready for them to go on their first day. Another example, a developer needs to make use of their commute in the morning. So on the train, it's just going to have a new API endpoint ready to go once they get into the office. And lastly, a team lead, they're watching their budget. This would allow them to be checking the cost and consumption at all hours, maybe in line at the grocery store while they wait to check out. So as we move on, we're going to jump in now to looking at developing mobile apps, specifically in Apple Swift. So who here has heard of Apple Swift programming language? Awesome. So we just wanted to break down some of the advantages that we have found when using Apple Swift. So anyone that has a Mac has access to Xcode. And that's Apple's IDE tool. And they've really made UI development really easy and quick to jump into by use of their storyboards, which we'll see later in our presentation. It's integrated with iOS, so you can have a more native feel to your app if you're going to publish it for iPhone or iPad. The language is very compact. There's a lot less code. I read that Lyft, when Swift was open source, the ride sharing app, they completely rewrote their app from scratch in Swift. And it went from 75,000 lines of code to 25,000 lines of code. So a lot more containable. It's open source, which is always awesome. You have some sort of input to the language itself, and you can see it as it grows and changes. They also have the idea of Swift Playgrounds, which is actually really great for kids or people new to programming, because it kind of creates an interactive way for a user to start learning Swift. And it's really easy code for both iOS and Linux, which is really cool that it's able to run there as well. So a few things specifically while developing our app is we found it's really easy to jump in and start building your mobile application, because neither of us have built a mobile application before, and we were able to jump in and just get started. The code itself is really fast. It's asynchronous, so that's nice. You know, it runs through, things are quick. The libraries are very descriptive, which is helpful when you're learning, and also the error messages as well when you have mistakes in your code. So I'm going to hand it over to Michael, and he's going to dive more into the specifics of our application. No? Yes. So to go over just really quick, some of the challenges that we ran to while working on this mobile application that we're going to get to in a minute. First, some of the challenges were it's a consistently evolving language, so it was open sourced in 2015, December. And so since then, we're now on Swift 3.0, and we expect Swift 4.0 is not too far down the pipeline, but even since June when we started working more heavily on this app, there's been several changes. So constantly changing how the libraries were, how the function calls built-in foundation, that was one thing that we ran into. The next was the brand new mobile app. We are brand new to mobile application development, so we are mostly server-side coders, so we'd never really worked with UIs or trying to figure out how to put an application onto your phone. Next was working specifically with JSON in Swift. We just wanted to call this one out because it's used a lot when working with OpenStack. So JSON's not inherently native to Swift, so they were still up through at least this current release. There was several issues with trying to make it work very well. They're really close to having it done by Swift 4.0. It's probably going to be significantly better, but it is working. Then finally, UI design. As we said, we hadn't really worked on any mobile apps before, so trying to design a functional and also good-looking UI was a challenge for us. But so some of our current features that we have in our mobile app, we currently have, obviously, Keystone off-doken because you can't do anything without Keystone. We have provision, delete virtual machines. We have start, stop, restart of virtual machines. We have provision and delete volumes, view current servers, images, and volumes. And we have attach and detach. So some of the things we're looking to do in the future. User login. So having the ability for anyone to just use your mobile application on your phone to log into their OpenStack cloud. The next would be failover recovery, so in the event that something goes wrong with your phone, like you lose power, or in the event that you lose connection to your OpenStack, that it wouldn't cause any damage to your cloud itself. Neutron supports, we would like to have the ability to be able to create networks as well as attach servers to networks, routers, et cetera. Then we would like tenant and user administration so that while you're out on the go, you could just add a user to your cloud and then add them to a tenant. And then we would like to improve the UI design because we're not UI designers, but we're working on it. And then some of the tools that we did use, Xcode8, as well as Swift 3.0, which those came together in one release. We used DevStack Newton, so that's what you'll be seeing us use. Ubuntu 16.04 was where we've installed our DevStack, and then the one external library we used was so that we could handle the JSON better, was the Swifti JSON library from IBM Swift. So to go now into the actual app, to look at the actual UI architecture. So it might be a little hard to see at the back with some of these white boxes, but the overall design is there's five tabs currently, images, volumes, servers, and then we have just one tab to show you that it's actually getting tokens from Keystone and then the home screen. Just to give you a code example, it's very probably hard to see as well, but so at the top of this particular code snippet, this function is going to, this is the entire function to create a server, so at the top we're going to get an auth token and inside of that particular function you have at the top we're creating a dictionary, which will then be created into a JSON object down below with a JSON serialization. The NOVA request is where we're creating a URL request to be able to actually do basically a curl at our OpenStack Cloud, and then down below we create the headers so that we can use the Keystone auth token, then we create a session, which the session is what takes the URL itself with all of its headers and the method that it's using, and then we make the data task to call the actual request to the OpenStack Cloud, which is the very bottom right below the perform request in green. And then the final thing at the bottom is the resume, which the resume, this is an asynchronous language, so resume tells it to go ahead and kick that off and perform the action above. So to go to the actual demo, I'm gonna go out to see the actual app that we've been working on, just minimize, okay. So here's the application on the left, we're using Xcode to simulate this as an iPhone 7, so right over here is our home screen, and I'm going to go ahead and click on to the auth tab that we've created just to show you that it actually is working, so I can go ahead and click this button here, and so it actually, that's an auth token returning from our Keystone, which is somewhere over in Dallas, and then I can go ahead and reset, it goes away, and this we were using just to test different functions that we were adding as we were moving along through the development process. Next, to go to the actual, more functionalities of OpenStack, here we have images that came with the DevStack, these, this list would keep going in the event that you added more. We were going to eventually also add delete, but since we were only working with the default ones, we didn't actually want them to go away, so we left that unfinished, but here's our actual servers, you can see that we have two that are currently running, one that's in a stopped state or also like an unknown or error state, and if we look at the actual server itself, we can see that nothing is attached to it, no volumes, it is active, and I can go ahead and stop this one. If I come over here then to our horizon, we can see that third is shut off now, and if I go back over here to servers, it's switched to the red box. I can come back and I can start it again. Go ahead and click instances, and it is now active. So then we can go back to servers. Next I'm going to create a new server from here, we're going to name this one fourth server just to follow the convention. We can spend this to choose which image we would like, and then we can spend this to also choose which flavor we would like, we can go ahead and go with small. So if I create that, we can load over here to show that it actually is going to pop up. So now we have fourth, and if I drag this down to tell it to refresh, and I'll have fourth. Next, we will come back to this, but next I'm going to show you the volumes. So these are four volumes that we have, I don't know if you're able to see, but down below the volume ID, there's the name of the volume, the size of the volume, and then the state of the volume, this one's currently available. I'm going to go ahead and create a new one really quick as we demo volume, and it's going to be one size, size of one gigabytes just to save resources. So I can come over here to volumes, and I just named that one demo volume. It is now currently active, and you can see the description was created via mobile stack app. And if I come back over here, it's now popped up. So currently, it's not attached to anything, because it's currently in the state of available, but I can go ahead and choose which server I would like to, so I will attach it to fourth, which we just created. And if I go refresh this side, and go back over here, it's now in use, and it is now attached to fourth, which we can also see if we go look at the server itself. So next, we can look over here, and we can see that it is now in the list of attached volumes. Going back, the last thing I'm going to do is we did implement deleting of servers, so I'm going to go ahead and delete the fourth server. You can see this is currently over here still active. I'm going to click done, reload the instances, and it is now gone, and it is also pulling this down will no longer bring it back. And if we go back just to check, that volume that we created earlier, demo volume is now switched to available. Okay, and then I think that was all right, okay. Going back here, we're going to play from the current slide, and at this point, we're going to pass it back to Megan, and she has a few more things for you. Thank you, Michael. So actually, we're going to hop out of this, and we're going to go into Xcode. So we showed you earlier, this is what the storyboard looks like when you're in Xcode, and if you zoom in, you know, you can see all of your views and pieces and how they work together, your navigation controllers. Michael talked about us having like this tab bar controller for our general layout and flow, but what I was actually going to show you guys is just a quick implementation of an action to actually add in detaching a volume. So over here, let me, normally you kind of have your library of UI pieces you can add in, so we need a button. So we grab a button from over here, we're going to drag it in and drop it below attached. And if we look over here, this kind of gives you your options for configuring this new UI piece. So what we want to do is change it to not say button, we're going to change that to detach, and we're just going to set the font color to be something that's a little more visible. And so now that we got our button, it's all set on our UI looking nice, we are going to click this tab that it's kind of like the assistant editor is what it calls, but what it does is it brings up the code that is related to this view. So if we click that, you're going to see it pop up. We have it in a manual setting, so it brings up the interface, but if we were to choose the automatic, this is where all of our functionality for this view is stored. So what I'm going to do is each UI piece needs to be linked as either an outlet or an action. So what we're going to do is if you press control, click, and then you drag, let's drag it right here. It pops up with this little menu and we are going to make an action because buttons have actions, we want something to happen when they're clicked. And we're going to call this detach volume button. So we have some form of identifier and we're going to let it be any object, touch up inside is fine and it comes from the center. So when we click connect, it puts in this default function value for us to fill in. So what I'm actually going to do is I'm going to grab the code from attach because it's very similar just so you guys don't have to watch me type a million lines. There we go. And then I also have this saved just so here we are. Okay, so what we're doing here is we're listing all the volume attachments. OpenStack has an API that returns all the volumes and then we cycle through them to detach the one specific to the server you're asking about. So we need to make a couple of changes though because we wouldn't want our popup to say attaching. We'll say detaching volume and everything else should be good to go. So I'm just going to show you guys where that detach function that we've already implemented is at. So right down here we have the detach volume from server and so Michael had talked about this a little earlier in that code snippet, but essentially we're building kind of like a curl request or a HTTP request to detach or in this case it's a delete request. That's handled and passed on and does what we need it to do. So let's take a look at this change that we just made. So our app has refreshed. If we go over to the volumes page we should now see we have our detached button. So what I'm going to do is actually I'm going to attach this, well actually let me make a new server to attach it to or I'm just going to make sure I attach it to one without a volume, yep, let's attach it to third. So we'll attach that. It's attaching, let's see over here. Yep, it shows it's attached. It should show that in volumes as well. So we saw earlier, yep, attach to third. And so now let's try to detach. Click detach, it shows our detaching volumes message and it says it's available. See that the server doesn't have anything, nothing's listed. Let's refresh our page over here and we're not attached anymore. So we're good to go. So yep, so that's just how quick and easy it is to implement something on your UI. So let's head back over to the presentation. So this we just created as an open source kind of something just for us to get started creating mobile apps and hopefully something that other people would enjoy and get to play around with. It's available here on GitHub and right now since we don't have the user login functionality integrated all you have to do is there is a config file where you'll enter your information so your password, those sorts of things, all your ports and IPs and what tenant ID you're using. And if you built the app with that then it would connect to your OpenStack cloud. So I can show you guys that really quick. Yep, so it's just out here, all open source ready to go and the config file is right up here. So yep, that's all you'd have to do. So does anyone have any questions for us? All right, well thank you guys and if you wanna come up to us after and ask any questions about Swift or using OpenStack mobile, let us know. Thanks for coming.