Using on-prem vRA 8 and the on-prem FaaS provider for ABX fails trying to resolve node_modules dependencies that have been uploaded via zip. This works fine if you set the FaaS provider to AWS. Anyone have any workarounds or know if there is already an open issue for it? It's a critical issue as we cannot use AWS/Azure FaaS nor can we pull dependencies from npmjs.org (due to both proxy issues for ABX runtime and corporate policy).
Unlike looking in AWS at the created lambda function, I don't know where to go looking on the appliance to even start to see what's going wrong (e.g., is node_modules completely missing or is the abx_wrapper.js broken for on-prem, etc.)
Steps to reproduce:
Extensibility -> Action -> Create
Set language to nodejs and provider to on-prem
Set script source to "Import Package"
Upload zip (see attached, or create your own basic nodejs test)
Set main function to "index.handler" (or your main if you make your own)
Click Save and then click test
You should receive an error that it cannot find module "diagnostics" (or whatever module you are trying to 'require')
Appreciate any help!
An update for anyone interested.
I had a look in the container that ABX deploys on the appliance. It renames the function entry point script (for reasons?) and has failed to upload any other scripts, folders or dependencies (node_modules in this case). Updating the container and committing a new image (as latest) doesn't work unfortunately, and the deployed containers have rootfs as read only.
I have raised an issue with GSS and will report back on any fixes/workarounds.
Have you checked the instructions from here: Create a ZIP package for Node.js runtime extensibility actions ?
ABX modifies the entrypoint to wrap the original code with some extra code to handle some ABX logic (preparing special inputs, handling outputs and so on).
I hope that helps.
Yep, I've checked those instructions.
As I mentioned in the original post, its working with AWS lambda (which does not rename the main script), though do use different abx_wrapper.js scripts
Thanks for the update, and it's great to hear that a fix will be coming by 8.0.1.
Is nodejs used to build the python containers as well? I just tested an on-prem FaaS Python ABX through zip import and it has the same behaviour. None of the additional files in my zip are uploaded and requirements.txt is blank.
Could you elaborate how to you browsed the container on the appliance? This could be pretty handy for troubleshooting and I can't seem to find any documentation on it.
Use "docker list images" and "docker ps | grep" to find the right container. Then use "docker exec" to run a command or connect interactively, or "docker run" if you want to deploy a separate container to the ABX one.
For anyone interested the issue was fixed for Python ABX in 8.0.1
Unfortunately nodejs wound up even more broken. I have an SR open that Engineering have confirmed a fix is "coming".
I'll provide another update later.
Do you if there is any published documentation which explains how to correctly package a python dependency for import into vRA 8? or do you have an example zip? I looked at the one you posted for nodeJS and your infoblox offline example, but I couldn't make heads or tails of it.
I didn't, I just made a package; at a quick glance it should be enough to get you started.
It should be noted you do not need to use a Linux shell, unless you require dependencies that are compiled (like netifaces which is a common package). Of course your best bet is to be using containers for creating and testing your package anyway.