Skip to content
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

Deployment on AWS Lambda #40

Open
bsrdjan opened this issue Dec 4, 2017 · 11 comments
Open

Deployment on AWS Lambda #40

bsrdjan opened this issue Dec 4, 2017 · 11 comments

Comments

@bsrdjan
Copy link
Member

bsrdjan commented Dec 4, 2017

Following a question posted in #35, the node-rfc deployment on AWS Lambda requires SAP NW RFC libraries copied to location different from the the usual one, `/usr/local'.

The SAP NW RFC libs location must be configured for the operating system runtime, as described here and it must be configured in SAPNWRFC_HOME env variable, referenced in binding.gyp, for building from source.

Regarding operating system runtime, LD_LIBRARY_PATH env variable can be used, to add the library for the current session. For permanent change, a path should be added under /etc.ld.so.conf.d, like described in node-rfc documentation but that is probably not permitted on AWS Lambda?

Regarding building from source, is it required on AWS Lambda? You could eventually compile once and install that precompiled binary, together with SAP dependencies, added to LD_LIBRARY_PATH ?

Id build from source required, could a script eventually determine a current working directory and set SAPNWRFC_HOME accordingly? As far I could find in node-gyp documentation, node-gyp does not support relative paths.

@PrakashSadasivam
Copy link

@bsrdjan , nope I don't have docker image to test AWS lambda in local. You can try AWS SAM.

@StefanScherer
Copy link

@PrakashSadasivam Here is a small example with a Dockerfile, and a minimal sample app with a package.json and an app.js that tests loading the module and shared lib: https://github.com/StefanScherer/node-rfc-docker

In the Dockerfile you can change SAPNWRFC_HOME to something else than /where/you/want/the/nwrfcsdk, the last directory name should be nwrfcsdk as it's part of the SAR file.

If there's a better way to enforce compilation of the binding during the npm install --production other than patching the /etc/hosts file I would be glad to improve that. But this example worked for me to show how to compile it inside a Docker container.

@bsrdjan
Copy link
Member Author

bsrdjan commented Dec 5, 2017

npm install --build-from-source should help avoid /etc/hosts patching

@bsrdjan
Copy link
Member Author

bsrdjan commented Dec 5, 2017

@PrakashSadasivam, I have no capacity atm for experimenting with deployment on AWS Lambda and hope hints above could help to start.

Can you share any more details on use-case here? SAP nwrfcsdk lib supports backend sessions and caches remote functions' modules metadata internally, to preserve them across repetitive calls, increasing the performance. Both features might be lost on serverless environment like AWS Lambda and if they do matter in your use case, another environment might be worth of considering? Although the node-rfc should technically work on AWS Lambda, serverless environment might not be always optimal choice for RFC protocol in general.

@bsrdjan bsrdjan closed this as completed Apr 3, 2018
@heri16
Copy link

heri16 commented May 27, 2018

Just a tip to others... I have successfully implemented a gRPC to rfc bridge. By using gRPC from AWS Lambda, it works great. No performance issues if we keep nwrfcsdk lib running in a daemon as a bridge.

@Suncatcher
Copy link

@heri16 could you share the exact steps, please?

@bsrdjan
Copy link
Member Author

bsrdjan commented Mar 2, 2020

Where the ABAP backend system should be installed, to be reached from AWS Lambda?

@manishvyas1911
Copy link

Just a tip to others... I have successfully implemented a gRPC to rfc bridge. By using gRPC from AWS Lambda, it works great. No performance issues if we keep nwrfcsdk lib running in a daemon as a bridge.

Can you share more regarding this?

@manishvyas1911
Copy link

I created a demo on how to use node-rfc on AWS Lambda with NWRFCSDK
https://www.youtube.com/watch?v=rhY4jVtl0k8&t=39s
It may help. Thanks!

@bsrdjan
Copy link
Member Author

bsrdjan commented Nov 3, 2020

The feature request to enable SAP NWRFC SDK usage on AWS Lambda, in Connectivity context, can be created for:

Security Services category of the SAP Cloud Platform – Platform Foundation

@bsrdjan
Copy link
Member Author

bsrdjan commented Feb 18, 2021

You may vote for the new request, linked here: #145 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants