Skip to content

GML-1991 Update Document#15

Merged
chengbiao-jin merged 2 commits into
mainfrom
GML-1991-Doc-Improvement
Nov 3, 2025
Merged

GML-1991 Update Document#15
chengbiao-jin merged 2 commits into
mainfrom
GML-1991-Doc-Improvement

Conversation

@chengbiao-jin

@chengbiao-jin chengbiao-jin commented Nov 1, 2025

Copy link
Copy Markdown
Collaborator

PR Type

Documentation, Enhancement


Description

  • Add GraphRAG quickstart scripts and configs

  • Provide Docker Compose and Kubernetes deployment manifests

  • Add tutorial notebooks and Python usage examples

  • Revamp README with setup and LLM configuration


Diagram Walkthrough

flowchart LR
  readme["Updated README with quickstart and configs"]
  scripts["Setup and demo shell scripts"]
  compose["Docker Compose and Nginx configs"]
  k8s["Kubernetes deployment manifest"]
  examples["Python examples and tutorial notebook"]
  data["Sample tutorials dataset"]

  readme -- "guides" --> scripts
  readme -- "references" --> compose
  readme -- "references" --> k8s
  scripts -- "drives" --> examples
  compose -- "runs" --> examples
  examples -- "uses" --> data
Loading

File Walkthrough

Relevant files
Documentation
6 files
answer_question.py
Example script to query GraphRAG answers                                 
+49/-0   
init_graphrag.py
Initialize graph, ingest data, update GraphRAG                     
+38/-0   
README.md
Overhaul docs with quickstart and configuration                   
+281/-109
GraphRAGDemo.ipynb
End-to-end GraphRAG document QA notebook                                 
+471/-0 
GraphRAGDemo.ipynb
Adjust dataset path in existing notebook                                 
+1/-1     
tg_tutorials.jsonl
Add sample tutorials JSONL dataset                                             
[link]   
Enhancement
3 files
setup_graphrag_tg.sh
Setup GraphRAG against existing TigerGraph instance           
+73/-0   
setup_graphrag.sh
One-step local GraphRAG deployment with TigerGraph             
+64/-0   
graphrag_demo.sh
Demo driver initializes GraphRAG and queries                         
+31/-0   
Configuration changes
5 files
graphrag-k8s.yml
Kubernetes manifests for GraphRAG stack                                   
+322/-0 
docker-compose.yml
Docker Compose stack including TigerGraph                               
+86/-0   
docker-compose-tg.yml
Compose stack for external TigerGraph deployments               
+74/-0   
server_config.json
Sample server configuration with LLM settings                       
+47/-0   
nginx.conf
Nginx reverse proxy for UI and API                                             
+32/-0   
Miscellaneous
1 files
data
Reference to shared tutorials data directory                         
+1/-0     

@tg-pr-agent

tg-pr-agent Bot commented Nov 1, 2025

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 Security concerns

Remote code execution and credential handling:

  • The README recommends piping curl to sh and uses -k (TLS verification disabled):
    curl -k ... | sh. This pattern is vulnerable to MITM and remote code execution. Suggest using a pinned tag/commit with curl -fsSL and explicitly executing a downloaded, verified script.
  • setup_graphrag_tg.sh writes plaintext database credentials into configs/server_config.json. Consider environment variables, Docker/K8s secrets, or prompting the user to supply them securely.
  • K8s manifests use hostPath volumes for configs, which is risky in multi-tenant clusters. Prefer ConfigMaps/Secrets and avoid hostPath unless necessary.
  • Images are pinned to :latest in Compose/K8s, which can lead to supply-chain drift. Recommend pinning immutable digests or versioned tags.
⚡ Recommended focus areas for review

Possible Issue

The script references an undefined variable (tg_version) when templating the Docker Compose file and contains an early exit that prevents services from starting. This will break the quickstart path.

curl -s https://raw.githubusercontent.com/tigergraph/graphrag/refs/heads/main/docs/tutorials/docker-compose-tg.yml | sed "s/community:4.2.1/community:${tg_version}/g" > docker-compose.yml
curl -s https://raw.githubusercontent.com/tigergraph/graphrag/refs/heads/main/docs/tutorials/nginx.conf -o configs/nginx.conf
curl -s https://raw.githubusercontent.com/tigergraph/graphrag/refs/heads/main/docs/tutorials/server_config.json | sed '/"gsPort": "14240"/a\
    "username": "'${tg_username}'",\
    "password": "'${tg_password}'",
' | sed "s#http://tigergraph#${tg_host}#g; s/14240/${tg_port}/g"> configs/server_config.json

exit
echo "Starting GraphRAG sevices.."
docker compose up -d
sleep 5
Logic Error

The Python version check regex is too strict and likely fails on valid versions, and the log polling looks for "Done" while the grep pattern is "DONE", causing a loop that may never exit. These issues will break the demo flow.

if ! python --version 2>&1 | grep "Python 3\.1.\." >/dev/null; then
  echo "Python 3.11+ is needed, please check Python version or use virutal environment"
  exit 1
fi

if ! pip freeze 2>&1 | grep pyTigerGraph >/dev/null; then
  echo "pyTigerGraph is needed, please install it by running: pip install pyTigerGraph"
  exit 2
fi

echo "Initializing GraphRAG. It may take 5 to 10 minutes."
python ./init_graphrag.py

current_stage=
while :; do
  stage=$(docker logs graphrag-ecc 2>&1 | grep "Processing Start\|DONE. graphrag.run" | tail -1)
  if [[ -n "$stage" && ! "$stage" == "$current_stage" ]]; then
    if [[ "$stage" =~ Processing ]]; then
      echo $stage | cut -d ' ' -f5-7
    elif [[ "$stage" =~ Done ]]; then
      echo "GraphRAG initialization is done."
      break
    fi
  fi
  current_stage=$stage
  sleep 5
done
Misconfigured Namespace

The tigergraph Deployment/Service and the PVC are created without the graphrag namespace, while the rest of the stack uses it. This cross-namespace mismatch will prevent service discovery (e.g., http://tigergraph) from working.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: tigergraph-data
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: tigergraph
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tigergraph
  template:
    metadata:
      labels:
        app: tigergraph
    spec:
      containers:
        - name: tigergraph
          image: tigergraph/community:4.2.2
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 14240
          volumeMounts:
            - mountPath: /home/tigergraph/tigergraph/data
              name: tigergraph-storage
      volumes:
        - name: tigergraph-storage
          persistentVolumeClaim:
            claimName: tigergraph-data
---
apiVersion: v1
kind: Service
metadata:
  name: tigergraph
spec:
  selector:
    app: tigergraph
  ports:
    - protocol: TCP
      port: 14240
      targetPort: 14240
  type: ClusterIP

@chengbiao-jin
chengbiao-jin merged commit 50e1c5f into main Nov 3, 2025
1 check failed
@chengbiao-jin
chengbiao-jin deleted the GML-1991-Doc-Improvement branch November 3, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant