tigergraph / pyTigerGraph

Python package for utilizing TigerGraph Databases
https://docs.tigergraph.com/pytigergraph/current/intro/
Apache License 2.0
29 stars 13 forks source link

Algorithm functions bug and tgcloud.io Connection Failure #59

Closed tonymhl closed 1 year ago

tonymhl commented 2 years ago

We are using pyTigerGraph to do tg_louvain alogorithm on our graph database. We tried to do this in two ways.

  1. As the screen shot shown below, we have set up a local TG database(3.7) on our local server and successfully get connected through pyTigerGraph(1.1) connection.(python 3.8)

image

However, when trying to use installAlgorithm or runAlgorithm functions, we meet a connection error as shown below:

image

It would be much appreciated If this problem can be solved.

  1. Alternatively, we tried to connect to TigerGraph cloud db to see if it works. However, the connection could not be set up. It seems that the updated 3.7.0/3.6.2 versions of TG online clusters are not well documented. We couldn't find helpful guidlines or tutorials to make the pyTigerGraph connection successful.

image image image

parkererickson commented 2 years ago

Hi @tonymhl - can you tell us more about the environment you are running the notebook in? The first issue appears to be that pyTigerGraph cannot access the Louvain query on our github repo. Does the machine you are running it on have internet access?

The TG cloud issue is due to the way you should specify usernames and passwords. It is not your login info, rather, you need to set up users in the access management screen you took a screenshot of.

Hope this helps!

tonymhl commented 2 years ago

Hi @parkererickson - The environment I am running the notebook is Python3.8. The machine we are running it on does have the internet access. Curretly, we have almost resolved issue of connecting tgcloud, by adding SSL certificate on local server, which missing will stop the server connecting to tgcloud. We are getting assistance from CUSTOMER SUPPORT#46248, where provided below script to connect tgcloud solution:

import pyTigerGraph as tg

hostName = "https://mydb.i.tgcloud.io" graphName = "Cora" secret = "token" userName = "tigergraph" password = ""

conn = tg.TigerGraphConnection(host=hostName, graphname=graphName)

authToken = conn.getToken(secret) authToken = authToken[0] print(f"SHHHH.... Keep this a secret. Here's your token:\n {authToken}")

Establish Connection

conn = tg.TigerGraphConnection(host=hostName, graphname=graphName, username="GSQLsecret", password="token", apiToken=authToken) print("hello")

ls_results = conn.gsql("LS") print("ls result", ls_results)

results = conn.getSchema() print(results)


or I am simply doing:

from pyTigerGraph import TigerGraphConnection conn = TigerGraphConnection(host="https://mydb.i.tgcloud.io", graphname="Cora", gsqlSecret="token") conn.getToken('token')

We notice that when we run the notebook on Google Cloab, the runAlgorithm function will run successfully. However, if we do it on our local Linux server installed with TigerGraph Community edition, the runAlgorithm function might report ConnectionError. We can successfully have our local Linux server installed with TigerGraph Community edition, and have our python notebook connected to it, as the picture shows: image It can successfully show all the available algorithms, e.g. Louvain query, on TG github repo, as shown below: img_v2_1063b4d7-0b42-4d76-884b-ca7ac410c50g

However, whenever we try to run any specific algorithm, for example, tg_louvain, we get ConnectionError: image

We tried to install the algorithm manually in advance, we see that installAlgorithm part gets pass, however the runAlgorithm part still gets ConnectionError: image Kinda wondering why running installed query still requires connection to TG github repo? (*If running installed query no longer requires connection to TG github repo, this issue will get resolved.)

We have figured out that it is an issue with the VPN for Internet access on our machine that caused the ConnectionError, since switching VPN could resolve the issue.

In conclude, We are trying to implement this project which is available on GitHub: https://github.com/KstecGit2021/TG-mlworkbench-docs-kr/tree/main/tutorials/basics The main issue is about this Feature Engineering part, which involves doing TG Algorithms: https://github.com/KstecGit2021/TG-mlworkbench-docs-kr/blob/main/tutorials/basics/2_feature_engineering.ipynb In brief, our final goal is that we make this workflow run successfully, either through local TigerGraph Community version or through tgcloud . For tgcloud, we see that Google Cloab managed to run the workflow successfully, however, since Colab is a google service, we cannot move on to our next stage of software engineering which involves packaging our workflow into a program. We need to have a successful and stable workflow on our local python script, either through local TigerGraph Community version or tgcloud.

Thank you.