Deploy Machine Learning/Exploratory Data Analysis ...
Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
DISCLAIMER: Please note that the content of this blog post is for demonstration purpose only, it should not be used productively without impact evaluation on production environment.
Introduction:
In this blog, we will implement an end to end solution for Python based web application(Flask) on SAP Business Technology Platform.
We will use a cloud based HANA DB, and will leverage python package hdbcli to fetch the relevant data using SQL statement.
We will be using python data science packages such as pandas,seaborn and matplotlib to display various graphs showing Exploratory Data Analysis.
Node js will be used as a single point of entry to access our Python Application.Python package xssec will be used for authentication.
Finally we will deploy this application on Launchpad.
Above references/links will be used for implementing the complete implementation steps.
Main Part :
Data Preparation:
Firstly lets upload the downloaded CSV file(owid-co2-codebook.csv) into SAP HANA Cloud database using Database Explorer as mentioned in above tutorial 1.
Make country and year as the primary key.
Connecting Python with SAP HANA Cloud:
Connect to the SAP HANA Cloud DB with the help of tutorial 2.
Download the GITHUB files from here, for reference purpose.
Replace the USERNAME,PASSWORD and URL in file env_cloud.json with your instance details.
URL can be retrieved from Copy SQL Endpoint by removing port number.Provide port number in port field.
Update manifest.yml file with the application names as per your needs.
Update requirements.txt with the python packages you want to use while developing the model.
Update runtime.txt with the python runtime version supported.
Deployment of Application:
Install CLI with the help of tutorial 4, please note cf.exe file should exist in the same directory as you have manifest.yml file.
Login to Cloud Foundry using commands cf login or cf login --sso
Push the extracted and modified folder containing above files using command cf push
In case of successful push , you will be able to see both the applications running in BTP Cockpit.
In case of any runtime error in python , error log can be inspected in SAP BTP.
Application can be opened using application route :
Configure the application on Launchpad:
Configure the launchpad using tutorial 5 including Application/Catalog and Group.
Provide application route as per your application in URL:
Conclusion:
Demonstration:
Configured application is deployed to the launchpad.
Application will display a link to the Flask frame-work python Application. We can click on it to display the details as well.
We can see different graphs showing the correlation between the features.
Congratulations we have finally completed the end to end implementation of application development with SAP Business Technology Platform.
In case of errors do let me know in the comments 🙂