initial scaffold · python/memory.python.org@852bf50 · GitHub
Skip to content

Commit 852bf50

Browse files
committed
initial scaffold
0 parents  commit 852bf50

222 files changed

Lines changed: 50596 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 63 additions & 0 deletions

.github/workflows/benchmark.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Memory Tracker Benchmark
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
commit_range:
7+
description: 'Commit range to benchmark (e.g., HEAD~10..HEAD)'
8+
required: true
9+
default: 'HEAD~5..HEAD'
10+
binary_id:
11+
description: 'Binary ID to use for benchmarking'
12+
required: true
13+
default: 'default'
14+
environment_id:
15+
description: 'Environment ID'
16+
required: true
17+
default: 'linux-x86_64'
18+
server_url:
19+
description: 'Memory tracker server URL'
20+
required: false
21+
default: 'https://memory.python.org'
22+
cpython_repo:
23+
description: 'CPython repository URL'
24+
required: false
25+
default: 'https://github.com/python/cpython.git'
26+
27+
jobs:
28+
benchmark:
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout memory tracker
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: '3.11'
39+
40+
- name: Clone CPython repository
41+
run: |
42+
git clone ${{ github.event.inputs.cpython_repo }} cpython
43+
cd cpython
44+
git fetch --depth=50
45+
46+
- name: Install memory tracker worker
47+
run: |
48+
cd worker
49+
pip install -e .
50+
51+
- name: Install build dependencies
52+
run: |
53+
# Install CPython dependencies using their script
54+
cd cpython
55+
sudo .github/workflows/posix-deps-apt.sh
56+
57+
# Install Memray dependencies
58+
sudo apt-get install -y \
59+
python3-dev \
60+
libdebuginfod-dev \
61+
libunwind-dev \
62+
liblz4-dev
63+
64+
- name: Run memory benchmarks
65+
env:
66+
MEMORY_TRACKER_TOKEN: ${{ secrets.MEMORY_TRACKER_TOKEN }}
67+
run: |
68+
# Build command with preconfigured options
69+
CMD="memory-tracker benchmark ./cpython ${{ github.event.inputs.commit_range }}"
70+
CMD="$CMD --binary-id ${{ github.event.inputs.binary_id }}"
71+
CMD="$CMD --environment-id ${{ github.event.inputs.environment_id }}"
72+
CMD="$CMD --api-base ${{ github.event.inputs.server_url }}"
73+
CMD="$CMD --configure-flags='-C'"
74+
CMD="$CMD --make-flags='-j4'"
75+
CMD="$CMD --output-dir='./benchmark_results'"
76+
CMD="$CMD --force"
77+
CMD="$CMD --local-checkout"
78+
CMD="$CMD -vv"
79+
80+
echo "Running: $CMD"
81+
eval $CMD
82+
83+
- name: Upload benchmark results (if failed)
84+
if: failure()
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: benchmark-logs
88+
path: |
89+
*.log
90+
./benchmark_results/
91+
retention-days: 7
92+
93+
- name: Upload benchmark results (on success)
94+
if: success()
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: benchmark-results
98+
path: ./benchmark_results/
99+
retention-days: 30

.gitignore

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# Python
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
*.so
8+
.Python
9+
build/
10+
develop-eggs/
11+
dist/
12+
downloads/
13+
eggs/
14+
.eggs/
15+
backend/lib/
16+
lib64/
17+
parts/
18+
sdist/
19+
var/
20+
wheels/
21+
share/python-wheels/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
MANIFEST
26+
.venv/
27+
venv/
28+
ENV/
29+
env/
30+
.env
31+
.env.*
32+
!.env.example
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
.tox/
36+
.nox/
37+
.coverage
38+
.coverage.*
39+
.cache
40+
nosetests.xml
41+
coverage.xml
42+
*.cover
43+
*.py,cover
44+
.hypothesis/
45+
.pytest_cache/
46+
cover/
47+
48+
# FastAPI / SQLAlchemy
49+
*.db
50+
*.sqlite
51+
*.sqlite3
52+
database.db
53+
test.db
54+
55+
# IDEs
56+
.vscode/
57+
.idea/
58+
*.swp
59+
*.swo
60+
*~
61+
62+
# OS
63+
.DS_Store
64+
.DS_Store?
65+
._*
66+
.Spotlight-V100
67+
.Trashes
68+
ehthumbs.db
69+
Thumbs.db
70+
71+
# Node.js / Frontend
72+
node_modules/
73+
/.pnp
74+
.pnp.*
75+
.yarn/*
76+
!.yarn/patches
77+
!.yarn/plugins
78+
!.yarn/releases
79+
!.yarn/versions
80+
npm-debug.log*
81+
yarn-debug.log*
82+
yarn-error.log*
83+
.pnpm-debug.log*
84+
85+
# Next.js
86+
/.next/
87+
/out/
88+
next-env.d.ts
89+
*.tsbuildinfo
90+
91+
# Testing
92+
/coverage
93+
.nyc_output
94+
95+
# Production builds
96+
/build
97+
/dist
98+
99+
# Vercel
100+
.vercel
101+
102+
# Logs
103+
*.log
104+
logs/
105+
106+
# Runtime data
107+
pids
108+
*.pid
109+
*.seed
110+
*.pid.lock
111+
112+
# Temporary files
113+
*.tmp
114+
*.temp
115+
.tmp/
116+
.temp/
117+
118+
# Firebase
119+
firebase-debug.log
120+
firestore-debug.log
121+
122+
# Genkit
123+
.genkit/*
124+
125+
# Jupyter Notebook
126+
.ipynb_checkpoints
127+
128+
# pyenv
129+
.python-version
130+
131+
# pipenv
132+
Pipfile.lock
133+
134+
# PEP 582
135+
__pypackages__/
136+
137+
# Celery
138+
celerybeat-schedule
139+
celerybeat.pid
140+
141+
# SageMath parsed files
142+
*.sage.py
143+
144+
# Spyder project settings
145+
.spyderproject
146+
.spyproject
147+
148+
# Rope project settings
149+
.ropeproject
150+
151+
# mkdocs documentation
152+
/site
153+
154+
# mypy
155+
.mypy_cache/
156+
.dmypy.json
157+
dmypy.json
158+
159+
# Pyre type checker
160+
.pyre/
161+
162+
# pytype static type analyzer
163+
.pytype/
164+
165+
# Cython debug symbols
166+
cython_debug/
167+
168+
#Nextjs stuff
169+
frontend/*.next

LICENSE

Lines changed: 21 additions & 0 deletions

0 commit comments

Comments
 (0)