 Helo semua! Helo semua, satu lagi! Sebelum kita mulai sesuatu, hari ini kita sebenarnya membuat 5 kopi yang ini disebabkan pembentangan karnatif. Yang ini tidak teruk. Bagaimana tanya-tanya? Kamu dapat kopi. Tentu saja, saya hanya boleh beri kamu 3 kopi semasa saya. Mereka ada 2 kopi untuk kedua sesi. Jangan lupa tanya-tanya. Kami ada di sini. Mari kita mulai sesi. Nama saya Stopper. Saya bekerja di perniagaan Kod Pipatok. Kita akan bercakap tentang Kod. Seperti yang kamu tahu, ini adalah pembentangan karnatif. Sebenarnya, pembentangan karnatif apabila kamu ingin membuat pembentangan karnatif adalah pertama-tiga, pembentangan karnatif yang telah digunakan seperti PCF membutuhkan kamu sekitar 20 plus VMS. Jadi, ia membuat kamu sangat susah untuk membentangkan masin kamu untuk mencuba sekarang. Kemudian, satu lagi masalah adalah kamu mempunyai untuk menggunakan pembentangan. Jadi, ia tidak membuat pembentangan untuk pembentangan untuk menggunakan pembentangan untuk membuat pembentangan untuk karnatif PCF dan mempunyai untuk dua kali. Tetapi, jika kamu betul-betul ingin mempunyai dua kali pembentangan, kita okey. Sebab itu, pembentangan karnatif membutuhkan kamu. Kemudian, kita akan membutuhkan pembentangan karnatif lagi. Jadi, pembentangan karnatif mempunyai pembentangan untuk pembentangan. Jadi, ia membutuhkan pembentangan karnatif. Jadi, ini adalah pembentangan karnatif untuk membutuhkan karnatif lagi. Jadi, kemudian, sekarang saya tidak mengatakan apa yang pembentangan karnatif adalah. Jadi, jangan risau. Kerana, apa yang kita boleh lihat, itu sebenarnya pembentangan karnatif yang akan memberikan lebih banyak informasi tentang apa yang karnatif adalah. Itu adalah pembentangan karnatif untuk saya. Sekarang, saya akan duduk di sini. Saya akan mulakan pembentangan. Kemudian, ingatlah, saya akan tanya pertanyaan untuk pembentangan karnatif. Tapi pertanyaan karnatif harus berguna pada pembentangan karnatif. Okey. Okey, mari kita mulakan. Kita berharap kita adalah perniagaan lebih tinggi dari pembentangan karnatif. Dan kita sepatutnya berkongsi dengan aplikasi untuk menyelamatkan semua orang. Saya akan berkongsi dengan baik untuk semua orang. Okey, mungkin sebelum itu. Saya minta maaf. Mari kita lihat kenapa kita mulakan pembentangan karnatif. Okey, anda pergi ke pembentangan karnatif, pembentangan karnatif, pembentangan karnatif. Kemudian, anda pergi ke pembentangan karnatif. Kemudian, anda pergi ke pembentangan karnatif. Semoga pembentangan karnatif berlaku sekarang. Okey, dari sini, anda dapat mengalami link. Okey. Ini akan membawa anda ke pembentangan karnatif apabila anda akan mengalami Oh, maaf. Anda akan membawa anda ke pembentangan karnatif apabila anda mempunyai pembentangan karnatif. Untuk saya, sebenarnya, saya sudah melakukannya. Baiklah, ini adalah pembentangan karnatif. Dalam pembentangan karnatif, mari kita tunjukkan. Okey. Okey, ini adalah pembentangan karnatif yang anda mengalami dari pembentangan karnatif. Okey, sangat mudah. Pada perjalanan yang tersebut, anda akan melakukan sebab saya menggunakan pembentangan karnatif. Jadi anda akan melihat seperti Start OSX dan Stock OSX. Ini benar-benar mempunyai pembentangan karnatif. Jadi, hanya mengalami pembentangan karnatif. Untuk pembentangan karnatif, saya tidak akan mengalami dari awal. Ini hanya yang anda akan melihat dari mengalami pembentangan karnatif. Pembentangan OSX. Selepas sekejap, anda akan mengalami pembentangan karnatif dari internet. Ini adalah sekitar 4GB. Jadi, tidak besar. Kemudian, pada keadaan yang terakhir di dalam sekeliling ini, anda akan melihat pembentangan karnatif tentang pembentangan karnatif. Jadi, pembentangan karnatif ini, adalah pembentangan karnatif untuk memperoleh pembentangan karnatif atau memperoleh pembentangan karnatif. Jadi, itu sebabnya kita dapat mempunyai mempunyai sebuah set api, api-api untuk berbincang dengan pembentangan karnatif, pembentangan pembentangan karnatif. Sekarang, mari kita memulai pembentangan karnatif. Okey. Jadi, saya akan memulai pembentangan karnatif ini dan saya akan memulai pembentangan karnatif. Biar saya memulai okey, jadi, saya perlu memulai pembentangan karnatif. Pada masa ini, sebenarnya saya memulai pembentangan karnatif. Jadi, jika anda berlaku memulai pembentangan pembentangan karnatif, anda boleh selalu memulai pembentangan api. Okey, jadi, dari sebuah setelah api, anda dapat memulai pembentangan karnatif. Okey. Biar anda tahu, pcfdev.io tidak benar-benar memulai pembentangan karnatif sebenar. Ini sebenarnya memulai pembentangan pembentangan karnatif. Jadi, jangan cuba memulai apapun di telefon anda. Anda tidak akan mengalami pembentangan karnatif. Okey, jadi, kemudian, sekarang, kami mempunyai pembentangan pembentangan karnatif, memulai pembentangan karnatif saya. Jadi, seperti yang saya katakan, sekarang, kelihatan saya suppu memulai Shelley More pembentangan nama apapun. Okay, mari kita katakan Hello, CF, Mita, Singapura In order to make it a little bit dynamic Other than just show this message itself I mean, probably I want to print the timestamp, okay? Okay, I'm done, let's say I'm done the project, the application Let me do some simple testing PHP, let's say index to PHP Okay, so I can see the result coming from here Okay, now I'm ready to deploy the application Okay, so pay attention to the first CF command Cf, push PHP Okay, this will be the command I'm going to run next Okay, to deploy my application Okay, after a short while You'll see that deployment is successful And let's say at this point I know my application is deployed So maybe you want to give a quick look What other application we have already running right now Cf Cf apps Okay, now it shows you PHP app is already deployed Let's say what did I do Or maybe right now it's time for us to do a quick test To call here this URL Just copy this URL Yes, indeed I have the application running Yes PHP Is just any random name that you have given Yes, exactly So let's go back to PHP app again So when I do Cf push Actually what I do need Maybe you want to Cf help You want to see the sub command What the push is supposed to do Okay, what push supposed to do I actually ask you for an application name Okay, so the PHP app is just my application name So how do I link back to my application So basically Cf apps Okay, so basically that's the PHP app So that's how That's all you need to do to deploy an application Okay, Cf push Kind of like that, yes So you know that you're actually trying to deploy A PHP application Then why up the necessary dependencies Well, you do not need As a developer, you do not need to do So the platform does that for you Okay, that's how easy you can deploy an application I do it Here's your book Two more books, two more copies Okay, so now Now actually it's not bad so far We have the application running on the PHP app Or my domain name Okay, let's say I've done a QA testing We want really, really to push this application life So obviously this is not a good enough domain name But how about let's say we make it a WW Let's say So in order to kind of like Look at this We automatically associate a URL With my application Can I associate another one, let's say What I really want is the WW Let's say my domain name Okay, so you can do that very easily Cfmaproute Then phpapp.pcf.io-n Okay, so once we have done that Okay, all green, cfapps again There you are, we have a new URL Okay, let's just do a quick test Okay, call Cfw, and yes Now my application is live You guys have these greetings Maybe we'll run it again To see the different timestamp Okay, that's how easy you can deploy your application Even though this pcfdev Is running on your local desktop When you're actually talking to a real pcf Full balloon pcf installation The experience is the same You just push your application You do not do any other configuration The rest of the configuration is done By the platform for you Okay Yes, that's exactly What the blind magic happened behind the scene Because what you actually seen me doing Right now is nothing but a psp file There's no confusion, no opportunity No let's say psp No nothing So all of these things Automatically done by the platform for you By the automatic detection mechanism We won't go into details Of all this Detection mechanism Yeah, it is In the end running inside container It's a container Specifically designed for Cloud Foundry Okay, so actual name is called Garden But it's really up to you When you can go online and look up The documentation Can you Which i'm going to do next Okay In that case Wait for the next copy Okay, but actually i lie to you I'm not a psp developer I suck at psp My psp skill is very limited That's the most i can do So along the way actually this project Is so popular as you guys are coming And use my application And i tell my boss I can't really handle this application anymore So what i'm going to do is All i heard about spring actually is good Springboard is good Maybe it's a time for me to pick up springboard Let's just start a springboard application Okay i go to spring starter Let's say i just give a random name Door pivotal Let's say boot And then of course I'm going to use web And generate a project I have the project already I go back to the demo Let's make it larger Okay, so now i have another Application in here Let's just open it And you may expect actually This is a spring Application We go to have a full-blown IDE Okay Okay, let me try it again Okay, we have the project already It's pretty standard springboard project Okay, right now i have nothing Let's just command We say controller for it Rest controller Request mapping And map to slash And then say spring Or maybe i'm making a drop Sorry Okay, let's say Return Hello, CF, meetup Singapore And Plus system.current Okay, so let's say I'm done with my expectation Just pretending i'm done with my expectation And let's just do a local test Before i push the project Okay, best practice Okay, i have been running 8080 There we are Okay, quick test Call localhost 8080 Well, there we are Or maybe we want to make it A little bit specific From boot Run again Okay, i'm going to call again So now we can see We have seen different Hello, CF, meetup Singapore from boot Okay, so i'm fine Before we start the actual deployment Migration from PHP to spring Let's say we want to implement Simulate a Controllers stream of clicks Into my application Okay, so let's just do that Well, true People.w.logcom Okay, CF Okay, so maybe i call Maybe i call Okay, so now this is my So-called production Application Is happily printing all the Grating messages Okay But i say i'm done with PHP I can't really scale this application anymore Okay, let's just Try to switch to spring boot Okay, so Let's do that My application Or maybe Before that, what i'm going to do I'm going to delete the test Make it shorter Medium package Okay, so i still have the test Anyway, i have the application Done Let's do the deployment So who can tell me what Should i do next CF push CF push Sorry Okay, here's Last copy, okay, no more CF push boot Sorry, any action Okay, so this is what i'm going to do To deploy my Java boot Spring boot application, okay So now let's just do this What's the different name of Yeah, it's different URL right now Because you don't want to straight away To mess up with your Beloved application So guys, i'm actually using it right now It's so busy, i don't want to mess up With the production traffic right now Okay Okay, so i'm deployed So let's say CF apps You want to show us the messages one more time Do you like Read about the comment line message Yes, let me show you that So That's the starting of my Comment line So blah blah So we download it Yes Now you can see that actually Cloud Foundry Is a language agnostic As in it can support PHP It can support Java, Ruby Go Maybe let's say a Java script Okay You name it, we support it Okay, no worry Let's say for example, if your language So bizarre, that's not really In the built-in Supported language list You can integrate your own I'm not going to tell you how It's going to be a time consuming Okay, anyway I run CF apps Now i can see Two applications running Of course we have a new URL Maybe i make it later Let's do a quick test before i make it live Okay now i have CF Hello CF metam Okay, all good Now let's say you are my QA Are you happy? Yes Okay, so next Let's say we have done the testing We need to make it live So, remember what did i do Just now to make the PHP On the triple W CF macro Good Oh, by the way I want you to pay attention Around the application Around the command line I want you to pay attention to this panel Okay Pcf.io And triple W Okay, so now i'm going to run this command Let's see what's going to happen next So, voila So our spring application So you can see that the traffic actually bumping Between the PHP and the spring Okay, now i'm in the transition period I just washed my application Now i've been watching that for 10 seconds I say that this is good enough Okay, so maybe it's the time To switch off the PHP Let's make the final blow for this Migration Okay, so Maybe let me show you one more time CF apps Okay, so let's say the URL Both my boot and my PHP application It's under triple W Here and there Okay, so now I say I'm done Yes, yes The actual The actual routing is round robin between the applications But actually that's one thing Probably I haven't really show you The instance, can you see the instance over here Within the same application is actually random Let's say I have more than one instance Of my boot or PHP Then within them is random Between application is round robin Which you can see from here Okay, so now I say I'm fine with the migration My boss is happy, everybody is happy Are you happy? Okay, so now Let's finish the migration Can anyone guess To help me Macro Macro Macro So simple So PHP app Local.pcf.io.n3.w Okay, so I'm going to run Migration script One last step Of my migration Pay attention to this live stream Okay, low and behold My PHP application is gone So from this point on I can see it's my Okay But then you may want to say Oh, maybe sometimes I did make a mistake Let's say the actual migration was Not proper And I made a bug Inside my application So what can I do? One more time You can see your application is still running The PHP application is still running So if anything Like Absolutely run That's always an easy way So Blue-green deployment Are you satisfied? Yes Okay Let's move on Any question before we move on? I still no question Anyway, my application is so good Let's no bug Okay, so another problem So let's say What if my application Crash me away Let's say they run out of memory Or maybe just because Of foreseeable Errors in my code I'm a large developer I made a lot of errors in my application So If you want to kind of demo a random error To kill my application That's going to be random So if not to make it a little bit more deterministic Or like a Comma with a new API To kill my application So request mapping Slash crash So I go to simulate a crash So the easiest way System access Maybe give an error code So maybe you want to do some testing Before you really go to best practice Okay So now my application is running local Let's say call Host I can see Okay Okay, now I'm going to I'm going to crash Okay, actually The application so is gone We'll see that I'm going to try to access this application It's no longer there anymore Then we can see from here The process finish with x equal 1 So basically crashed Or maybe before that we can do some logins Obvious Logger Say logger Log factory Logger Okay, private static Final Okay, maybe I just say logger Maybe let me make it larger Error I am crashing Okay Let's make it a lot of noisy I don't have error I'm sorry Assume my application is there I'll just refresh my application Okay, now we're online So my application is back Nothing special Because it's still my old application So let's say we try to simulate An unfortunate event 3am in the morning So Please pay attention to this panel Assume this is not Your guys love my application so much And keep hitting my application As far as you can So now we say Remember how do I crash my application C4W Local.tcf.io Then I'll crash So Right now pay attention to this panel I'm going to crash my application Oh, my application is like In a bad state Can't really contact that Okay, I just go on C4W 3am in the morning Do I need to wake up? No, no, see here See here, the application is back Okay, I just sleep Through the whole night I come back and fix that tomorrow Okay Okay, obviously I'm manually crashing my application Or maybe we can do it one more time Just for fun I just crash Let it crash So Cloud Foundry is actually doing his work Monitoring your application If, let's say Accidentally, your application just crashed You will spend a new instance to replace it Okay, so maybe let's say Tomorrow morning I came back to office And say, okay I did crash last night Maybe let me see what happened last night So we're going to introduce you another API command line Okay, cfe1 Okay I'm sorry, cfe1s need to give Application name Okay, so Right now, what do you see here? Let me make it larger so Easier for you to read So actually that application crashed Like what we exit Error code 1 Okay, not bad It actually crashed, I know that And cf can actually help me to revive The new instance What happens, I want to know really What happened behind the scene Who killed my application Okay, so that's the new one Cf, logs Okay, so this guy will actually Like Tailing your log What's happening with your application right now Will send to your console So in this case, it's not so I just want to do a quick Quick crash one more time Okay, curl Local Cfw Cff.io And crash Okay, I'm going to make a quick crash And let's say what the log Is telling me Pay attention to this pen right now Okay So application exit Where is my error Message Oh, that I am crashing That's my last error message After that You supposed to come back By yourself Okay Maybe I should crash it too many times I don't know Okay Okay, so maybe I just do a quick deployment And just make it back again, sorry Can you show us Cf apps Cf apps Oh, it actually says I appreciate your life Okay, so anyway Cf logs I really want to show you Cf logs To see the application initialization Wait Watch one For crashing it Now I just crash it one more time Hopefully this one won't fail Anyway, you can see that It doesn't fail actually But this time let's try to be a little more patient Okay Come back It's taking a longer than usual Okay Maybe I just say Cf apps again I'm sorry It's actually started Cf supposed to Pick up that information And start the application for me But it should be checked immediately The moment it crash It should be send a message to the Cloud Foundry Manager And that will restart the application Sorry Oh, you cannot say that Oh Okay Creating container There we are So that's my application start up message Spend Start up message And then my application is there So what is the application still alive Or responding? In that case Because actually the container Can't really tell your application In that state So you can only monitor your process The Java process If the Java process does exit With error code It's a sign for us to restart the application But if your application Taking a long time to respond Or indefinite time to respond Can't really tell So Yes In that case If you have that issue You can poke into your application Tell some kind of insights But in that case you do need Another script to run To monitor your application The Cloud Foundry itself Only monitors the actual process Oh, yeah Then you can install additional Services to monitor that Thanks for the Cf Explore Okay, so Again, this is actually Because I do have my downtime When my application does crash I do have my downtime Or maybe I don't want to see that My boss is not really happy with this behavior For this given period of time And your guys are not happy Cannot get grid Okay, so what I'm going to do next Is skill up my application So if I say one instance of my application crash And I have another backup instance To pick up traffic Then probably I'll be fine So what I'm going to do next I'm going to skill up Skill up my application Adding more instance of trade So now let's do one more time Look at Cf apps Or maybe I should Make this panel a little bit smaller So to make it easier to see Okay, so now I have one instance Of my Springboard application running So I'm going to spin up Skill Boots And you can guess it How many instances you want to skill Okay, maybe I want to let's input trade Okay Look at this Cf logs panel Now we have new containers created And therefore I'm starting in this slide Okay, so now we go to Cf apps One more time to tell Okay, so now I have three different instance Springboard running Okay, my Springboard application Okay, let's do one more time I'm going to crash my application So it's going to crash So now pay attention to this panel Because previously when My application crash We don't have a way to Commentate to my application So let's just crash this application Okay, you can see This guy actually crash Maybe actually Cf apps Only two instance Of this trade So none of you Actually can notice the difference Okay, my application just can crash When it needs to Okay, are you satisfied? Are you happy? Yes What about log application That you want to see the logs of one particular app Or do you look at it? This is the log application over here Let me scroll up I already differentiate between the instances Ya, okay Good question So right now Because I don't log anything It makes sense, let's say you just log anything Let's say log info Type Okay, now I'm going to write anything When I will give you a grade Okay, I only have five minutes I need to speed up Okay, so let's do that Let me just get this guy running The city demo And the boot Maven package So Cf push boot P Target Okay, now I'm going to deploy my newest version of my application To say anytime I send you a greeting message I'm going to log in something in my log So right now what you've actually seen Is really not Okay I see it's more like The actual access log Not so Indikative of which application is serving my traffic Okay, let's just wait for it to finish Okay, so Cf apps Now I have three instances running Okay, let's just give a little time To kind of finish everything So let's pay attention to this guy Okay This is still starting up Okay, there we are Maybe I'll make it Something like this So this is a log line So you can see here Wow, let's keep on moving Okay, application slash zero Then application slash one Application slash three And then zero, and one And two Okay, so now You have a way to basically automatically aggregate All the instances Log into one single stream Okay, are you satisfied? Are you happy? Okay Wow, this is basically The PCF depth For this PCF The full blown installation is Random Yeah So this is the PCF depth Okay, so That's coming from this That's coming from So basically stream boot By default actually write to your standard error And standard out So that's two stream That can be pick up by the cloud foundry Automatically And then aggregate to the stream Automatically So if you are supposed to Let's say run application on top of Let's say cloud foundry The best practice it says And you do not manage the log by yourself Platform will automatically pick up Log for you and aggregate Application instance Into one single stream Okay, so I will say It's much easier to config Don't need to fiddle with any configuration With the logs Okay, actually I have more Demo but I believe I don't have enough Time to finish off Now it's time for questions Oh, two minutes for questions Okay, does it run behind the proxy Can it run behind the proxy Behind the proxy? What do you mean Which one does it run Is it PCF depth or PCF depth PCF depth So I'm running a machine And I'm behind the proxy Okay I believe that should work The only problem Right now is PCF depth For this guy running inside And I'm using a local IP So the The proper setting probably just set up your network interface For the worker box to expose The port The main thing I have to expose the URL So from the other machine You have to resolve for the machine That you have to set It's a virtual IP inside But in the API You have the API of the name So that it has to resolve For the machine that is this guy It's basically this guy Local.pcf.dev.io That only resolves In that machine Let me show you Let's say Okay, so if I'm going to Dig this local.pcf.dev.io And you're going to see that The IP address is a local IP What about IP applications? Are applications which are not of that nature? Well, that's something Maybe the CFSB can tell you Okay, sorry So if you don't You can run an application that's not bad Base So the thing is If you use a protocol to communicate That's not HTTP yet You just release the TCP route So it means that you can route Any app that's TCP based In any app, you cannot route But if you have TCP apps or HTTP You can have it It doesn't have to be HTTP At least TCP Yes, you just release The TCP route So the TCP route allows you to route Any port TCP port In a full blown PCF That's the platform To automatically speed up the apps In order to put the containers Bosch does Bosch is a component that manages the platform Here in this PCF, we don't have Bosch Because everything is in your own machine You don't use a background for that In a full blown, you have a Bosch That's an application that manages the VMs Platform manages the containers And someone, Bosch, that's part of the platform Manages the VMs You can't create the VMs automatically And you can upgrade things With no downtime Because you use the canary updates I believe that's the end of my session I'll be still around So if you have any question Come to me personally Thank you