Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Dan_Wroblewski
Developer Advocate
Developer Advocate
I simply wanted to deploy a Hello World endpoint on SAP Cloud Platform.

Yes, every programming journey is filled with setbacks, wrought with obstacles, and designed to tax the soul. I still thought it would be easier than this.

Let's start at the beginning.

Excited to learn something new


I wanted to learn to build chat bots with SAP Conversational AI, in order to build a set of tutorials*. Learning this product has been fun, and the product managers are clearly focused on making it simple and clear. No complaints here.

The next tutorial that I wanted to create was on how to build a Python endpoint deployed to SAP Cloud Platform for the bot to call during a conversation. I used fukuhara's blog post Create simple Flask REST API using Cloud Foundry -- a great post, short, simple, easy to follow. Again, no complaints.

Early signs of trouble


With a little existing knowledge about Cloud Foundry, I installed Cloud Foundry CLI, but when I ran a CF command, it failed because it thought my home drive was my U drive, but I did not have a U drive.



I tried to set my home drive, but it was always temporary. Then I tried to set it via environment variables, but this did not work. Then, I opened up an IT ticket -- since this is something they seem to set automatically -- but they just didn't understand the issues.

Finally, I found that I could set an environment variable called CF_PLUGIN_HOME or CF_HOME to tell CF directly what directory to use. First problem solved.

The pressure intensifies


I followed Yohei's tutorial, which was really simple and easy to do. But immediately, I had a problem with SAP Cloud Platform (just to be clear, this was not an issue with Yohei's tutorial).


At SAP, I have been working with some of the people in SAP Cloud Platform development, so I had heard somewhat about needing to set quota and entitlements for subaccount, and some of the recent changes to the trial landscape. But I didn't know exactly how to add routes.

There were 2 things that confused me.

Quota


I assumed I had to take some of my global quota and give it to a subaccount, and I assumed you would do this at a global level. But I had to enter the subaccount and create a quota plan, and then assign that to each space that needed quota.

But when creating the plan, I got this screen, which suggests I have to raise the org limit, but I could not find where to raise the org limit. And then I started to go around in circles trying to find a way to raise the org limits, until I realized -- I can ignore these messages and just set the quota.


In the end, I was able to specify routes and other quota, despite the error message, and save and assign the quota to my space.

Entitlements


I set a quota plan for letting me create routes, but I still got the same message. So I figured I had to assign entitlements somehow, but I had no idea what entitlements I needed and which ones would give me some routes.

So I gave myself all the entitlements that seemed like they might help. It seems that giving my space Application Runtime entitlements did the trick.

But ...

Python also stings


After getting the right quota and entitlements, I tried to push my application, and it created routes and everything, but then I got the following:


Ooof!!

I must admit I am only now learning Python, and find all the different frameworks and tools and versions and buildpacks confusing. But I was trying. And so, after reading a bunch of Python blogs, after learning on Lynda.com, after studying SAP Cloud Platform quota, after writing a bunch of colleagues -- I was stuck again!

After a little more research, though, I somehow figured out that I had to change the specified Python runtime (3.8.1 worked for me). And then it got deployed and it worked!! (I forget how I figured this out.)



Epilogue 1


There is a really nice tutorial on understanding entitlements in SAP Cloud Platform, Manage Entitlements on SAP Cloud Platform Trial.

Epilogue 2


There is a great sense of accomplishment when you persevere through difficult issues and get your app running, more than if it had been simple. But maybe it wouldn't be so bad if programming were a little bit simpler?




Check out my first 3 SAP Conversational AI tutorials (many more to come, including on creating a Python webhook):