Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding ruff, visualization, and fixing ollama #401

Merged
merged 58 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f7d3b6e
adding and fixing files
Vasilije1990 Dec 30, 2024
60c8fd1
ruff format
Vasilije1990 Jan 5, 2025
649fcf2
Fix linter issues
Vasilije1990 Jan 5, 2025
6dafe73
Fix linter issues
Vasilije1990 Jan 5, 2025
5b11559
Fix linter issues
Vasilije1990 Jan 5, 2025
76a0aa7
Fix linter issues
Vasilije1990 Jan 5, 2025
35460e9
Fix linter issues
Vasilije1990 Jan 5, 2025
74e4b90
Fix linter issues
Vasilije1990 Jan 5, 2025
1a10a56
Fix linter issues
Vasilije1990 Jan 5, 2025
41a0a21
Fix linter issues
Vasilije1990 Jan 5, 2025
2675836
Fix linter issues
Vasilije1990 Jan 5, 2025
cbd15b9
Fix linter issues
Vasilije1990 Jan 5, 2025
34bd8b7
Implement PR review
Vasilije1990 Jan 5, 2025
3251025
Comment out profiling
Vasilije1990 Jan 5, 2025
0983e95
Comment out profiling
Vasilije1990 Jan 5, 2025
307aa83
Comment out profiling
Vasilije1990 Jan 5, 2025
becb121
Merge branch 'dev' into COG-adding_html_graph_render
Vasilije1990 Jan 5, 2025
1b96a71
Fix ollama, work on visualization
Vasilije1990 Jan 6, 2025
4c21dd0
Fix visualization
Vasilije1990 Jan 7, 2025
2d10065
Fix visualization
Vasilije1990 Jan 7, 2025
dc426de
Merge branch 'COG-adding_html_graph_render' of github.com:topoteretes…
Vasilije1990 Jan 7, 2025
61897c5
Fix visualization
Vasilije1990 Jan 7, 2025
18c8bc3
Merge branch 'dev' into COG-adding_html_graph_render
hajdul88 Jan 8, 2025
e449286
fix: fixes create_cognee_style_network_with_logo unit test
hajdul88 Jan 8, 2025
42f9f2f
fix: removes accidental remained print
hajdul88 Jan 8, 2025
0ff9ffa
Fix visualization
Vasilije1990 Jan 8, 2025
41b1486
Fix visualization
Vasilije1990 Jan 8, 2025
fdd8ce7
Fix visualization
Vasilije1990 Jan 8, 2025
b13edb0
Fix visualization
Vasilije1990 Jan 8, 2025
e05fc09
Fix visualization
Vasilije1990 Jan 8, 2025
125f2cd
Fix poetry issues
Vasilije1990 Jan 8, 2025
1a885fe
Fix poetry issues
Vasilije1990 Jan 8, 2025
27d1d66
Fix poetry issues
Vasilije1990 Jan 8, 2025
178b3ce
Fix poetry issues
Vasilije1990 Jan 8, 2025
a856c23
Fix poetry issues
Vasilije1990 Jan 8, 2025
deebb76
Fix poetry issues
Vasilije1990 Jan 8, 2025
1a0052b
Fix poetry issues
Vasilije1990 Jan 8, 2025
433dc36
Fix poetry issues
Vasilije1990 Jan 8, 2025
3b649d1
Fix poetry issues
Vasilije1990 Jan 8, 2025
ce4c5b1
chore: Update version of poetry install action
dexters1 Jan 8, 2025
9c2c194
Merge branch 'COG-adding_html_graph_render' of github.com:topoteretes…
dexters1 Jan 8, 2025
cb2b441
chore: Update action to trigger on pull request for any branch
dexters1 Jan 8, 2025
8e1803d
chore: Remove if in github action to allow triggering on push
dexters1 Jan 8, 2025
2e1480d
chore: Remove if condition to allow gh actions to trigger on push to PR
dexters1 Jan 8, 2025
14adb6b
chore: Update poetry version in github actions
dexters1 Jan 8, 2025
4161343
chore: Set fixed ubuntu version to 22.04
dexters1 Jan 8, 2025
148b069
chore: Update py lint to use ubuntu 22.04
dexters1 Jan 8, 2025
ab29a64
chore: update ubuntu version to 22.04
dexters1 Jan 8, 2025
45cff4f
chore: Update python 3.9 gh action to use 3.12 instead
dexters1 Jan 8, 2025
11c6d65
chore: Update formatting of utils.py
dexters1 Jan 8, 2025
a5e993b
Fix poetry issues
Vasilije1990 Jan 8, 2025
70ced35
Merge remote-tracking branch 'origin/COG-adding_html_graph_render' in…
Vasilije1990 Jan 8, 2025
27e7808
Fix poetry issues
Vasilije1990 Jan 8, 2025
5194353
Fix poetry issues
Vasilije1990 Jan 8, 2025
dc91f01
Fix poetry issues
Vasilije1990 Jan 8, 2025
6fe8273
Fix poetry issues
Vasilije1990 Jan 8, 2025
49f018c
Fix poetry issues
Vasilije1990 Jan 8, 2025
7e0e0a5
Fix poetry issues
Vasilije1990 Jan 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

publish_docker_to_ecr:
name: Publish Cognee Docker image
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd_prd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

publish_docker_to_ecr:
name: Publish Docker PromethAI image
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

build_docker:
name: Build Cognee Backend Docker App Image
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Check out Cognee code
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/community_greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request, issues]

jobs:
greeting:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/first-interaction@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker_compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
docker-compose-test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
docker-build-and-push:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
Expand All @@ -32,7 +32,7 @@ jobs:
run: |
IMAGE_NAME=cognee/cognee
TAG_VERSION="${BRANCH_NAME}-${COMMIT_SHA}"

echo "Building image: ${IMAGE_NAME}:${TAG_VERSION}"
docker buildx build \
--platform linux/amd64,linux/arm64 \
Expand Down
94 changes: 48 additions & 46 deletions .github/workflows/profiling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
profiler:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
# Checkout the code from the repository with full history
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
python-version: '3.10'

- name: Install Poetry
uses: snok/install-poetry@v1.3.2
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand All @@ -57,6 +57,8 @@ jobs:
run: |
poetry install --no-interaction --all-extras
poetry run pip install pyinstrument
poetry run pip install parso
poetry run pip install jedi


# Set environment variables for SHAs
Expand All @@ -80,50 +82,50 @@ jobs:
poetry run pyinstrument --renderer json -o base_results.json cognee/api/v1/cognify/code_graph_pipeline.py

# Run profiler on head branch
- name: Run profiler on head branch
env:
HEAD_SHA: ${{ env.HEAD_SHA }}
run: |
echo "Profiling the head branch for code_graph_pipeline.py"
echo "Checking out head SHA: $HEAD_SHA"
git checkout $HEAD_SHA
echo "This is the working directory: $PWD"
# Ensure the script is executable
chmod +x cognee/api/v1/cognify/code_graph_pipeline.py
# Run Scalene
poetry run pyinstrument --renderer json -o head_results.json cognee/api/v1/cognify/code_graph_pipeline.py

# Compare profiling results
- name: Compare profiling results
run: |
python -c '
import json
try:
with open("base_results.json") as f:
base = json.load(f)
with open("head_results.json") as f:
head = json.load(f)
cpu_diff = head.get("total_cpu_samples_python", 0) - base.get("total_cpu_samples_python", 0)
memory_diff = head.get("malloc_samples", 0) - base.get("malloc_samples", 0)
results = [
f"CPU Usage Difference: {cpu_diff}",
f"Memory Usage Difference: {memory_diff} bytes"
]
with open("profiling_diff.txt", "w") as f:
f.write("\\n".join(results) + "\\n")
print("\\n".join(results)) # Print results to terminal
except Exception as e:
error_message = f"Error comparing profiling results: {e}"
with open("profiling_diff.txt", "w") as f:
f.write(error_message + "\\n")
print(error_message) # Print error to terminal
'

- name: Upload profiling diff artifact
uses: actions/upload-artifact@v3
with:
name: profiling-diff
path: profiling_diff.txt
# - name: Run profiler on head branch
# env:
# HEAD_SHA: ${{ env.HEAD_SHA }}
# run: |
# echo "Profiling the head branch for code_graph_pipeline.py"
# echo "Checking out head SHA: $HEAD_SHA"
# git checkout $HEAD_SHA
# echo "This is the working directory: $PWD"
# # Ensure the script is executable
# chmod +x cognee/api/v1/cognify/code_graph_pipeline.py
# # Run Scalene
# poetry run pyinstrument --renderer json -o head_results.json cognee/api/v1/cognify/code_graph_pipeline.py
#
# # Compare profiling results
# - name: Compare profiling results
# run: |
# python -c '
# import json
# try:
# with open("base_results.json") as f:
# base = json.load(f)
# with open("head_results.json") as f:
# head = json.load(f)
# cpu_diff = head.get("total_cpu_samples_python", 0) - base.get("total_cpu_samples_python", 0)
# memory_diff = head.get("malloc_samples", 0) - base.get("malloc_samples", 0)
# results = [
# f"CPU Usage Difference: {cpu_diff}",
# f"Memory Usage Difference: {memory_diff} bytes"
# ]
# with open("profiling_diff.txt", "w") as f:
# f.write("\\n".join(results) + "\\n")
# print("\\n".join(results)) # Print results to terminal
# except Exception as e:
# error_message = f"Error comparing profiling results: {e}"
# with open("profiling_diff.txt", "w") as f:
# f.write(error_message + "\\n")
# print(error_message) # Print error to terminal
# '
#
# - name: Upload profiling diff artifact
# uses: actions/upload-artifact@v3
# with:
# name: profiling-diff
# path: profiling_diff.txt

# Post results to the pull request
# - name: Post profiling results to PR
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/py_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
fail-fast: true
matrix:
os:
- ubuntu-latest
python-version: ["3.8.x", "3.9.x", "3.10.x", "3.11.x"]
- ubuntu-22.04
python-version: ["3.10.x", "3.11.x"]

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_discord_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
github-releases-to-discord:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/reusable_notebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

run_notebook_test:
name: test
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
Expand All @@ -36,7 +36,7 @@ jobs:
python-version: '3.11.x'

- name: Install Poetry
uses: snok/install-poetry@v1.3.2
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand All @@ -58,4 +58,4 @@ jobs:
--to notebook \
--execute ${{ inputs.notebook-location }} \
--output executed_notebook.ipynb \
--ExecutePreprocessor.timeout=1200
--ExecutePreprocessor.timeout=1200
9 changes: 5 additions & 4 deletions .github/workflows/reusable_python_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

run_notebook_test:
name: test
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
Expand All @@ -33,10 +33,10 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11.x'
python-version: '3.12.x'

- name: Install Poetry
uses: snok/install-poetry@v1.3.2
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand All @@ -49,7 +49,8 @@ jobs:
- name: Execute Python Example
env:
ENV: 'dev'
PYTHONFAULTHANDLER: 1
LLM_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GRAPHISTRY_USERNAME: ${{ secrets.GRAPHISTRY_USERNAME }}
GRAPHISTRY_PASSWORD: ${{ secrets.GRAPHISTRY_PASSWORD }}
run: poetry run python ${{ inputs.example-location }}
run: poetry run python ${{ inputs.example-location }}
2 changes: 1 addition & 1 deletion .github/workflows/ruff_format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [ pull_request ]

jobs:
ruff:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ruff_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [ pull_request ]

jobs:
ruff:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v2
5 changes: 2 additions & 3 deletions .github/workflows/test_deduplication.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ env:
jobs:
run_deduplication_test:
name: test
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'run-checks' }}
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
Expand Down Expand Up @@ -46,7 +45,7 @@ jobs:
python-version: '3.11.x'

- name: Install Poetry
uses: snok/install-poetry@v1.3.2
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test_milvus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:

run_milvus:
name: test
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'run-checks' }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
defaults:
Expand All @@ -36,7 +35,7 @@ jobs:

- name: Install Poetry
# https://github.com/snok/install-poetry#running-on-windows
uses: snok/install-poetry@v1.3.2
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test_neo4j.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ env:
jobs:
run_neo4j_integration_test:
name: test
if: ${{ github.event.label.name == 'run-checks' }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

defaults:
run:
Expand All @@ -32,7 +31,7 @@ jobs:
python-version: '3.11.x'

- name: Install Poetry
uses: snok/install-poetry@v1.3.2
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test_pgvector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:

run_pgvector_integration_test:
name: test
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'run-checks' }}
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
Expand Down Expand Up @@ -47,7 +46,7 @@ jobs:
python-version: '3.11.x'

- name: Install Poetry
uses: snok/install-poetry@v1.3.2
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test_python_3_10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ env:
ENV: 'dev'

jobs:

run_common:
name: test
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'run-checks' }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
defaults:
Expand All @@ -36,7 +34,7 @@ jobs:

- name: Install Poetry
# https://github.com/snok/install-poetry#running-on-windows
uses: snok/install-poetry@v1.3.2
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test_python_3_11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:

run_common:
name: test
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'run-checks' }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
defaults:
Expand All @@ -36,7 +35,7 @@ jobs:

- name: Install Poetry
# https://github.com/snok/install-poetry#running-on-windows
uses: snok/install-poetry@v1.3.2
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
Expand Down
Loading