Extending SAP Data Intelligence Part 2: Packaging, deploying and running solution containing custom application
Introduction
This post documents the hands-on technical steps I followed during my journey of exploring extensibility of SAP Data Intelligence and is a continuation of my post titled “Extending SAP Data Intelligence Part 1: Configuring a Custom Solution for TensorBoard”. In the first post, I described how to develop the application descriptor and solution manifest file required to create a custom solution. As with the first post, take this as the result of personal experience and not as a “best practice” guide.
Prerequisites
- Access to an SAP Data Intelligence instance.
- SAP Data Intelligence (cloud edition) Version: 2006.1.8 was used in this post.
- You will need to have
admin
permissions on the SAP DI tenant to install the application and create custom policies. - To use
Jupyter Notebooks
you will need a user that has access toML Scenario Manager
andTensorBoard App
Overview
In this post, I will go through the steps of packaging, deploying a custom solution for SAP Data Intelligence. I also included animated GIFs that I created to visually explain where to go if you are not familiar with the UI.
At the time writing the post I noticed that it was a bit too lengthy to pack into a single post. For that reason, I split it into 2 separate posts to show what I did for my colleagues:
- Part 1: Configuring a Custom Solution for TensorBoard in SAP DI (previous post) and
- Part 2: Packaging, deploying and running solution containing the custom application (this post).
The environment to TensorBoard consists of the following systems and tools:
- SAP Data Intelligence
- ML Scenario Manager
- TensorBoard
- Tensorflow installed in Jupyter Lab
Create a deployable Solution
- Create the Solution directory structure:
user@home ~ % mkdir -p custom_tensorboard_solution/content/vsystem/{apps,icons}
- Create
manifest.json
:user@home ~ % cd custom_tensorboard_solution user@home ~ % cat << EOF > manifest.json { "name": "tensorboard-app", "version": "0.0.2", "format": "2", "dependencies": [] } EOF
- Create blank application descriptor and copy/paste descriptor from the previous article or download from a GitHub Gist link:
user@home ~ % touch content/vsystem/apps/tensorboard-app.json
- Get an icon for the project:
user@home ~ % curl https://tensorboard.dev/static/tb_sharing_2.png -o \ content/vsystem/icons/TensorBoard.png
- Display solution structure:
user@home ~ % tree . . ├── content │ └── vsystem │ ├── apps │ │ └── tensorboard-app.json │ └── icons │ └── TensorBoard.png └── manifest.json 4 directories, 3 files
- Create a solution package
user@home ~ % zip -r tensorboard-app.zip manifest.json content/
Alternatively, if you have the System Management Command-Line Client (vctl) installed then the packaging can be done as follows:
user@home ~ % vctl solution bundle custom_tensorboard_solution/
Deploy Custom Solution
- Find the Solution package
tensorboard-app.zip
created in the previous step. - Add the Solution to your tenant as described in the official Manage Strategies documentation. The steps are:
- Log in as
tenant administrator
on your SAP Data Intelligence tenant.
- Open the
System Management
application. - Go to
Tenant
, selectSolutions
, and click+
. - Choose the
tensorboard-app.zip
file in the file dialog and confirm. - Go to the
Strategies
section and clickEdit Pencil
.
Add the newly addedtensorboard-app
to the strategy and click save.
NOTE: In case you are not able to edit the strategy (edit button does not exist) you need to login to the SAP Data Intelligence system tenant and assign the solution to the strategy there.
- The
TensorBoard
application will now show up in the launchpad of all users who have rights to start any application.
- Log in as
Create custom policies
- Create the policies and user in your tenant as described in the official Manage Policies and Manage Users documentation. The steps to do this are:
- Log in as
tenant administrator
on your SAP DI tenant. - Open the
Policy Management
application. - Create a new policy by clicking on
+
. - Enter
custom.tensorboard.start
as thePolicy Id
and deselect theExposed
option. Add a new resource by clicking+
and enter the app nametensorboard-app
, clickOkay
and thenCreate
. - Create another policy by clicking on + once again.
- Enter
custom.developer
as thePolicy Id
, add the policy created in step 4 and clickCreate
. - Navigate to the
System Management
application. - Go to
Users
, create a new user or select an existing user. - Click on
+
and select the role created in step 6 and clickAssign
.
- Log in as
The user will now have access to start an instance of the TensorBoard application
Create a scenario in ML Scenario Manager
- Log in as an
ML User
on your SAP Data Intelligence tenant. - Open the
ML Scenario Manager
application. - Click
Create
, enterTensorBoard Sample
inname
and clickCreate
.
- Navigate to the Notebooks section and click
Create
. In the dialog window, enterTensorBoard Test
inname
and clickCreate
.
- Launch a terminal from the file menu and install TensorFlow by entering
pip install tensorflow==1.15
in the terminal and pressingenter
.
- Add sample code to notebook
TensorBoard Test
run each cell and clicksave icon
.
NOTE: I used a tutorial for TensorBoard code from this link to test if the app is working.# Import TensorFlow and show version import tensorflow as tf tf.__version__
import numpy as np X_train = (np.random.sample((10000,5))) y_train = (np.random.sample((10000,1))) X_train.shape feature_columns = [ tf.feature_column.numeric_column('x', shape=X_train.shape[1:])] DNN_reg = tf.estimator.DNNRegressor(feature_columns=feature_columns, # Indicate where to store the log file model_dir='/vhome/tf/train/linreg', hidden_units=[500, 300], optimizer=tf.train.ProximalAdagradOptimizer( learning_rate=0.1, l1_regularization_strength=0.001 ) ) # Train the estimator train_input = tf.estimator.inputs.numpy_input_fn( x={"x": X_train}, y=y_train, shuffle=False,num_epochs=None) DNN_reg.train(train_input,steps=3000)
- Click on the Quick Launch navigation for TensorBoard and see written logs.
Closing and further reading
It was a great experience exploring how to extend SAP Data Intelligence with custom solutions and applications. Creating and deploying is really easy once you understand the components and the steps in creating a Solution.
I hope you enjoyed this blog post and that it gives you a general understanding of components that are part of a custom solution and how to deploy a solution in SAP Data Intelligence. Let me know if you have questions or feedback in the comments section.
If you want more information about everything SAP Data Intelligence related I recommend the following:
- openSAP: SAP Data Intelligence for Enterprise AI
- openSAP: Freedom of Data with SAP Data Hub
- Official SAP Data Intelligence 3.0 Administration Guide
- Official SAP Data Intelligence Cloud Page
- SAP Data Intelligence: Git Workflow and CI/CD Process Blog by Christian Sengstock (@christian.sengstock)
- SAP Data Intelligence 3.0 Walkthrough Blog by Swapan Saha (@swapan.saha)
- Zen and the Art of SAP Data Intelligence. Episode 3: vctl, the hidden pearl you must know by Gianluca De Lorenzo (@gianlucadelorenzo)