How can I use modules in Azure ML studio designer pipeline? - azure

I am currently using a python script in my Azure pipeline
Import data as Dataframe --> Run Python Script --> Export Dataframe
My script is developed locally and I get import errors when trying to import tensorflow... No problem, guess I just have to add it to environment dependencies somewhere -- and it is here the documentation fails me. They seem to rely on the SDK without touching the GUI, but I am using the designer.
I have at this point already build some enviroments with the dependencies, but utilizing these environments on the run or script level is not obvious to me.
It seems trivial, so any help as to use modules is greatly appreciated.

To use the modules that are not preinstalled(see Preinstalled Python packages). You need to add the zipped file containing new Python packages on Script bundle. See below description in the document:
To include new Python packages or code, connect the zipped file that contains these custom resources to Script bundle port. Or if your script is larger than 16 KB, use the Script Bundle port to avoid errors like CommandLine exceeds the limit of 16597 characters.
Bundle the script and other custom resources to a zip file.
Upload the zip file as a File Dataset to the studio.
Drag the dataset module from the Datasets list in the left module pane in the designer authoring page.
Connect the dataset module to the Script Bundle port of Execute Python Script module.
Please check out document How to configure Execute Python Script.
For more information about how to prepare and upload these resources, see Unpack Zipped Data
You can also check out this similar thread.

Related

Is it possible to use Node.js in NetSuite/SuiteScript?

I am wondering if it is possible to reference node modules in SuiteScript. For example, I am aware that I can create a third party library in the file cabinet and reference the moment.js file. However, is it possible to do an npm install moment on your suitecloud project and then have access moment in that script by simply importing it as you would in Node?
Actually you cannot use Node.js inside suite script. But you can trigger scripts from Node.js. Example if you want to create a record from a json file, you can trigger node.js to pass the json to a Map/Reduce or RestLet script.
is it possible to do an npm install moment on your suitecloud project and then have access moment in that script by simply importing it as you would in Node?
Yes and no. What you could do in this case is to copy the required .js files along with the SuiteScript files when doing the deployment, having in mind that the SS files would be referencing the library using a relative path.
All of this could be programmed as a task in node (or maybe webpack), which would all execute in your machine, and then upload the results to NetSuite.

Deploy Python app with textract module to Google Cloud Platform

I want to create a Python script that will parse 40.000 PDF files(text and images). Since I saw that there is no easy method to check if a page contains images I think I should use textract module.
Ideally I would deploy to Google App Engine.
My question is, for textract I've also installed other packages beside Python to my system. Can I deploy the script(with proper requirements.txt file) on Google Cloud App Engine without problem? or I will to use something else?
It is possible to use App Engine, but only with the Flexible environment and using a custom runtime, which allows you to add non-python dependencies (and also python dependencies not installable via pip):
Custom runtimes allow you to define new runtime environments, which
might include additional components like language interpreters or
application servers.
See also Building Custom Runtimes.

Missing libraries/modules from Perfect framework on Linux

I am a newbie learning how to code in Swift on Linux.
Right now I am trying to use Perfect framework so I can create th REST service (or something like that) I am following instructions in this
https://videos.raywenderlich.com/courses/77-server-side-swift-with-perfect/lessons/1
video (I have found a link on perfect.org site) and I did everything just like in the video, but the problem occurs when I have to edit the main.swift file and use include to use the PerfectLib, PerfectHTTP and PerfectHTTPServer libraries/modules(?). When I run it the error shows on the terminal saying:
main.swift:1:8: error: no such module 'PerfectHTTP'
import PerfectHTTP
Same with other modules. Do I have to place downloaded files from Perfect to some special directory within swift directory? Or maybe the files in download link are not complete?
before doing any Server Side Swift, please temporarily forget Xcode and try a new tool chain called Swift Package Manager. Open a terminal in a blank folder and type swift package init then it will setup a blank project which contains a Package.swift, a folder named Sources and a Tests directory as well.
Now you have to edit the Package.swift before import anything into your source code. For example, the starter template Perfect server has such a Package.swift:
import PackageDescription
let package = Package(
name: "PerfectTemplate",
targets: [],
dependencies: [
.Package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", majorVersion: 2)
]
)
Then you can import any Perfect libraries included in the Perfect-HTTPServer.git
Here is the importing part as defined in the main.swift of PerfectTemplate:
import PerfectLib
import PerfectHTTP
import PerfectHTTPServer
So I will suggest that the best practice is to try Perfect Assistant: https://assistant.perfect.org/perfectassistant/Perfect%20Assistant.dmg which can save most tricky operations such as dependency management, building on linux and production server deployment.
For more information about Perfect other than tutorial video, see this link: http://www.perfect.org/docs/

Building VTK from source (trunk)

I am trying to build VTK from sources as it is a dependency to PLC library which I am trying to build.
I use ccmake.. to select all relevant groups to be built (including Group_imaging), and I can build VTK with no particular problems.
Though, I cannot find vtkImageLoader2.h (and many other headers) anywhere in the system. As these files are required by PCL, this is a problem.
I checked that the original file exists inside the source tree, and it is indeed inside IO/Image.
I can't understand why the file is not being build and deployed to /usr/local/include, I made sure all modules (groups) are ON in ccmake.
Is this file deprecated, or am I missing the way to deploy it?
EDIT: I discovered that the file belongs to module vtkIOImage that is part of the "StandAlone" group. The StandAlone group is set "ON" when i run ccmake. Is this a bug in the build scripts of VTK?

How can apportable build to generate a share object(.so) file instead of api file?

Is there a way to generate a shared object file instead of a AKP file, if I build a static library Xcode project? If it can be done, how to invoke the exported function?
Thanks.
The apportable build process
Creates an archive file of your app - lib{appname}.a
Links it along with some system objects into an so - libverde.so
Packages and zips libverde.so, other .so's and various Android resources into - {appname}.apk
You can modify this process by changing the python scripts in ~/.apportable/SDK/site_scons

Resources