node-rfc icon indicating copy to clipboard operation
node-rfc copied to clipboard

Cloud Foundry support

Open rahul4sap opened this issue 6 years ago • 11 comments

Hello,

Is there any way (simpler) by which we can deploy the Node-RFC application on Cloud Foundry? I mean download the SDK in the project folder and refer the node_modules to this custom path and then deploy whole folder as a package to Cloud Foundry?

Thanks, Rahul

rahul4sap avatar Mar 18 '19 16:03 rahul4sap

Related #24

bsrdjan avatar Mar 18 '19 22:03 bsrdjan

The RFC connectivity on SAP Cloud Foundry works with Java buildpacks only. It s not supported for nodejs buildpacks, referring to SAP Cloud Foundry Connectivity -> Restrictions -> Protocols:

You can communicate with SAP systems down to SAP R/3 release 4.6C. Supported runtime environment is SAP Java Buildpack with a minimal version of 1.8.0.

I would suggest discussing this as a feature request for SAP Cloud Connector, rather than here.

bsrdjan avatar Mar 18 '19 23:03 bsrdjan

Hello Rahul, actually, this would not be a feature request to Cloud Connector, which is already supporting RFC, but more or less to NW RFC SDK to be supported within SAP Cloud Platform Connectivity context and to be able to use the Cloud Connector channel.

Best regards, Markus

mtolksdorf avatar Mar 19 '19 13:03 mtolksdorf

Hi Mtolsdorf,

Can u share the docs regarding how to use the cloud Connector channel?

Thanks && Regards,

R.Ram

ramachandrareddy1 avatar Sep 06 '19 05:09 ramachandrareddy1

Hi ramachandrareddy1,

as already written, this would be a feature request. There is no SAP CP variant of NW RFC SDK that would support this channel. In SAP CP, only Java runtimes in Neo and the SAP Java Buildpack in Cloud Foundry support the communication with RFC over SCC using JCo APIs.

Best regards, Markus

mtolksdorf avatar Sep 06 '19 06:09 mtolksdorf

I finally figured out a way to get this done. First of all let me get you through issues.

#Issue : Error: /var/task/node_modules/node-rfc/lib/binding/sapnwrfc.node: invalid ELF header Solved: Created Node modules.

#Issue: Error: libsapnwrfc.so: cannot open shared object file: No such file or directory Solved: Copy nwrfcsdk libraries in lib folder and zip with code.

#Issue: Not able to load libraries from lib folder. Solved: Lambda has LD_LIBRARY_PATH set to /var/task/lib where I was putting the libraries in /var/task/libs

#Issue: Error: libuuid.so.1: cannot open shared object file: No such file or directory Solved:

AWS Lambda uses the amzn2-ami-hvm-2.0.20190313-x86_64-gp2 Linux study gives: lib, lib64 folder may contain system libraries. get all the files required from amazon linux docker. paste it inside lib folder. Steps to get it done.

Create a layer in aws lambda with node-rfc modules.

  • ref link: https://epsagon.com/blog/aws-lambda-layers-getting-started-guide/ Create a folder named "lib" and add all nwrfcsdk lib files inside it. Pull Amazon Linux docker and go to Lib64 folder . basically you need to copy three files in your "lib" folder i.e. libuuid.so.1, libmount.so.1, libblkid.so.1 image Create a lambda function with lambda credentials i.e index.js and zip it together with "lib" folder. Upload lambda with aws as aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip directly through console. In aws lambda set environment variable as LD_LIBRARY_PATH : /var/task/lib Thats all. All above issues will be resolved and SDK problem is also solved.

manishvyas1911 avatar Jun 08 '20 06:06 manishvyas1911

Created a demo video on how to? It may help https://www.youtube.com/watch?v=rhY4jVtl0k8&t=39s

manishvyas1911 avatar Jun 09 '20 14:06 manishvyas1911

Thanks @manishvyas1911, it can help people interested in deploying packages with binary dependencies to AWS Lambda.

In node-rfc / NWRFC SDK context, the usage is rather theoretical because the ABAP backend connectivity is not possible, without the above mentioned feature request implemented by SAP.

bsrdjan avatar Jun 09 '20 16:06 bsrdjan

The feature request to enable the usage of SAP NWRFC SDK within the Connectivity context of SAP Cloud Platform can be created for Security Services category of the SAP Cloud Platform – Platform Foundation campaign.

bsrdjan avatar Oct 26 '20 11:10 bsrdjan

You may vote for the new request, linked here: https://github.com/SAP/node-rfc/issues/145#issuecomment-781209573

bsrdjan avatar Feb 18 '21 14:02 bsrdjan