Jump to content

Issues with installing custom Python package TIBCO services and nodes


Li Mingchao

Recommended Posts

I want to install custom Python packages with special function on my Spotfire to ensure that they can be used by web and clients like Pandas. My Spotfire adminstrator told me that we have 1 spotftre service and 1 node manager, if I want to install a custom Python package need to setup a new node dedicate for python service.But in my understanding, our spotfire can now use Pandas and Numpy and other modules normally, we do not need to install specialized nodes for custom Python packages. Is my understanding correct?

image.thumb.png.64d1b84c66fd2987d45b9ec41d159bdb.png 



Link to comment
Share on other sites

Hello,

Well, technically you don't need a separate node just for *custom* Python packages but you should have a separate node for the Python service in the first place (i.e. not e.g. having the Web Player and Python service running on the same Node Manager).

  

Make sure to check the system requirements (https://docs.tibco.com/pub/spotfire/general/sr/sr/topics/spotfire_service_for_python_1_15.html) > the "Spotfire Software" section, which e.g. states the following

"Note: For production environments, we strongly advise that you deploy each of the different types of Spotfire services on separate, dedicated computers (physical computers, virtual machines, or containers)."

AND

"Important: This service supports only one instance per node manager. If you set the instance value to other than 1, then the service does not work as expected."

These requirements are there for a good reason - I have seen many examples of issues resulting from putting multiple services on the same node.  

Link to comment
Share on other sites

Hi Fredrik.

Thank you for you reply. I have a other question about Python service, because I call Pandas module normally in Spotfire's Data Function, does it mean that I already insatlled the mentioned Python service, so I don't need to install a new Python service for my customized python package? Or that the Pandas I see in the following image is based on Spotfire itself and does not rely on seprate Python service, only the custom Python packages I need to install require a new node for Python services?

image.png.cce9bd536f824c6053f7b492006a3cb8.png

Link to comment
Share on other sites

Hello,

Short answer (to the question in the picture): no, that information can not be used to determine if you have a Python service in your Spotfire environment.

 

TIBCO Spotfire Analyst is in general not dependent on the Python service - it can use it for running Python data functions, but can also run those locally, using the Python engine that ships with the Analyst. The Package management dialog in your screenshot is for managing the Python packages in an individual installation of Spotfire Analyst.

However, in order to be able to use Python from a web client (as you mentioned wanting to do), you must have Python Service(s) installed ("TIBCO Spotfire Services for Python" to use the correct name), which are installed on the "server side", on a Node Manager.

 

For more information, refer to the Spotfire Service for Python Installation And Administration manual:

https://docs.tibco.com/pub/sf-pysrv/1.15.0/doc/html/TIB_sf-pysrv_install/pyinstall/topics/the_tibco_spotfire_service_for_python.html

 

Link to comment
Share on other sites

  • 4 weeks later...

Dear Fredrik,

Sorry to bother you again, I have a question to confirm with you. The following image shows that we have already installed Python services. Could you please help me see if I can add a custom package on this Python service node?

image.thumb.png.24b942e55c6ca97344c6db03f2700cb5.pngDo you have detailed guidance documents or videos on how to package and add custom Python code to Spotfire's client and web?

Link to comment
Share on other sites

Hello again!

It seems that you are using Spotfire 11.4, so you should be using version 1.3.x of the Python service, so I'll use links to to the 1.3.x documentation.

I would start here - this gives an overview of how its done, and links to other relevant pages:

Package Management for Spotfire Service for Python

https://docs.tibco.com/pub/sf-pysrv/1.3.10/doc/html/TIB_sf-pysrv_1.3.10_install/install/topics/package_management_for_spotfire_service_for_python.html

Here in the community, you could also take a look at "How to Deploy Custom Python Modules for Use in TIBCO Spotfire":

https://community.spotfire.com/s/article/how-deploy-custom-python-modules-use-tibco-spotfirer

Link to comment
Share on other sites

Thank you for your reply,I have read the second document you mentioned, but I still have a question about the step2. Does this mean that we must first install an SDK tool and use it to generate the corresponding Python code into an SPK file?

image.thumb.png.0ff8d43505c25d4121e0f61a37ad43d8.pngFinally, I have another question. How can I understand this sentence 'This Spotfire installation provides a specialized Python package, called 'spotfire', that creates an SPK to hold packages or an alternative Python interpreter' and whether it is a Spotfire package that can create an SPK file?

image.thumb.png.2b8f0fe0a764f035908444a8ecbeec09.png 

I'm very sorry to continue bothering you, and thank you for your patient response

Link to comment
Share on other sites

Good morning,

Sorry - I missed the latest question here!

First, so the multiple ways the word "packages" is used is clear below, I just want to state that Spotfire packages (SPK) files (that e.g. can be created using the Spotfire Package Builder in the SDK), which is the general mechanism in Spotfire for packaging functionality so it can be deployed on the server and distributed to various clients like the Analyst, has nothing to do with Python packages. However, you could package Python packages into an SPK to distribute them within your Spotfire environment. There is also a Spotfire python package called "spotfire" that can be used to build SPK:s.

  

Using the SDK (the Spotfire Package Builder tool) is one way to build an SPK, but there is also another way - the Spotfire python package named "spotfire" can be used to create SPK:s. You can read about how that is done in the manual:  

Creating a Spotfire Package for Python Packages on the Node Manager

https://docs.tibco.com/pub/sf-pysrv/1.3.10/doc/html/TIB_sf-pysrv_1.3.10_install/install/topics/creating_a_spotfire_package_for_python_packages_from_the_node_manager.html

There may also be use cases where you don't think you need to create an SPK file that can then be managed using Spotfires general package management mechanism - if you e.g. have a small environment, installing and managing Python Packages manually (which does not require creating an SPK file) may be an option for you. You can read more about that option here:

Installing Python Packages Manually

https://docs.tibco.com/pub/sf-pysrv/1.3.10/doc/html/TIB_sf-pysrv_1.3.10_install/install/topics/installing_python_packages_manually.html

The way I think of this (disclaimer: I'm not an expert on this topic and it's not something I do myself very often)

* If you want to distribute Python packages that are available in PyPI, you can use the non-SDK/Package Builder options above. 

* If you have custom Python code (and don't want turn it into a package and upload to PyPI), use the SDK/Spotfire Package Builder option.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...