-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to build Cloud Foundry Python app (including SAP NW RFC SDK)? #205
Comments
The temporary workaround is to install shared object files via ldconfig. I took following steps and now error has disappeared.
I think this could get addressed into library since currently I am trying to use pyrfc in SAP Cloud foundry where root access to container could not be gained and unsure how to create Credits: https://medium.com/codingtown/install-sap-nw-rfc-sdk-in-ubuntu-18-04-3-lts-50e42b4dfe66 |
If you look only 4 lines above the Your main questions I think are how to deploy SAP NWRFC SDK to Cloud Foundry and how to use the PyRFC from Cloud Foundry. Technically, SAP NWRFC SDK can be deployed using CF Pre-Runtime Hooks and PyRFC can be also deployed the standard way. The challenge is RFC channel from SAP Cloud Platform to ABAP backend, currently supported only for Java runtimes in Neo and the SAP Java Buildpack in Cloud Foundry. For Python (and/or NodeJS) you can create the feature request for SAP Secure Cloud Connector, to enable SAP NWRFC SDK usage within SAP Cloud Platform Connectivity context and be able to use the Cloud Connector also from Python. Please see the same question for NodeJS: SAP-archive/node-rfc#79 |
Thanks @bsrdjan for changing title 👍 To run ldconfig via cf push using .profile, it requires root level permissions since it returns Permission Denied error.
Is there any way to get Shared object files uploaded before running requirments.txt? |
Sorry that I can't help further with PyRFC and NWRFC SDK packaging on Cloud Foundry, without SAP NWRFC SDK being supported on Cloud Foundry. Would you mind to create a feature request for that on influence.sap.com ? |
I was able to push pyrfc with NWRFC's shared object into sap cloud foundry via docker image. Thanks for your assistance @bsrdjan |
The feature request to enable SAP NWRFC SDK usage on Cloud Foundry, in Connectivity context, can be created for:
|
Here the feature request for node-rfc cloud connectivity. You may comment or vote or create similar request for PyRFC |
Here the current status and how to build Cloud Foundry Node.JS app with SAP NW RFC SDK: ABAP RFC connectivity from Kyma and BTP Node.JS buildpack It works the same way with Python: https://blogs.sap.com/2023/10/30/abap-rfc-connectivity-from-btp-python-buildpack/ |
Hello,
I am using Ubuntu based environment to run PyRFC. I took following steps:
export SAPNWRFC_HOME=/root/nwrfcsdk
pip3 install cython
pip3 install pynwrfc
python3
from pyrfc import Connection
This immediately gave following error message:
If I look inside init.py, I see it is trying to load SO (shared object) file as module using
os.add_dll_directory(os.path.join(os.environ["SAPNWRFC_HOME"], "lib"))
Which can be found here
https://github.com/SAP/PyRFC/blob/master/src/pyrfc/init.py
I am not sure this is the correct approach to load Shared object files in linux since method add_dll_directory is being called after checking OS type as nt, I could not see any check mechanism to detect unix OS type.
Also please find the screenshot below for the structure of /root/nwrfcsdk
What exactly needs to be done here to get this thing working?
Thanks
EDIT: I see no code for unix os types is written in this library.
I will try to push unix adaptation but I think it would be better that someone managing this repo can take care of it.
The text was updated successfully, but these errors were encountered: