Skip to content

Commit 2f4a019

Browse files
authored
Merge branch 'staging' into patch-1
2 parents b93cffa + ac174d1 commit 2f4a019

Some content is hidden

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

73 files changed

+3722
-2136
lines changed

.github/workflows/docker_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020
- name: Check out code
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222

2323
- name: Install cosign
2424
uses: sigstore/cosign-installer@v3
@@ -48,4 +48,4 @@ jobs:
4848
DIGEST: ${{ steps.build.outputs.digest }}
4949
TAGS: ${{ steps.build.outputs.tags }}
5050
run: |
51-
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
51+
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

.github/workflows/e2e-subtensor-tests.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
branches: [master, development, staging]
1313
types: [ opened, synchronize, reopened, ready_for_review ]
1414

15+
schedule:
16+
- cron: '0 9 * * *' # Run every night at 2:00 PST
17+
1518
workflow_dispatch:
1619
inputs:
1720
verbose:
@@ -107,7 +110,7 @@ jobs:
107110
- name: Run tests with retry
108111
run: |
109112
set +e
110-
for i in 1 2; do
113+
for i in 1 2 3; do
111114
echo "🔁 Attempt $i: Running tests"
112115
uv run pytest ${{ matrix.test-file }} -s
113116
status=$?
@@ -116,8 +119,8 @@ jobs:
116119
break
117120
else
118121
echo "❌ Tests failed on attempt $i"
119-
if [ $i -eq 2 ]; then
120-
echo "Tests failed after 2 attempts"
122+
if [ $i -eq 3 ]; then
123+
echo "Tests failed after 3 attempts"
121124
exit 1
122125
fi
123126
echo "Retrying..."
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# This workflow measures the disk size of a virtual environment
2+
# after installing the Bittensor SDK across multiple Python versions.
3+
# It runs only when a new pull request targets the master branch,
4+
# and posts a comment with the results.
5+
name: Monitor SDK Requirements Size
6+
7+
on:
8+
pull_request:
9+
types: [opened]
10+
branches: [master]
11+
12+
permissions:
13+
pull-requests: write
14+
contents: read
15+
16+
jobs:
17+
measure-venv:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
22+
outputs:
23+
py39: ${{ steps.set-output.outputs.py39 }}
24+
py310: ${{ steps.set-output.outputs.py310 }}
25+
py311: ${{ steps.set-output.outputs.py311 }}
26+
py312: ${{ steps.set-output.outputs.py312 }}
27+
py313: ${{ steps.set-output.outputs.py313 }}
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Create virtualenv and install
36+
run: |
37+
python -m venv venv
38+
source venv/bin/activate
39+
pip install --upgrade pip
40+
pip install .
41+
42+
- name: Measure venv size
43+
id: set-output
44+
run: |
45+
SIZE=$(du -sm venv | cut -f1)
46+
VERSION=${{ matrix.python-version }}
47+
echo "Detected size: $SIZE MB for Python $VERSION"
48+
case "$VERSION" in
49+
3.9) echo "py39=$SIZE" >> $GITHUB_OUTPUT ;;
50+
3.10) echo "py310=$SIZE" >> $GITHUB_OUTPUT ;;
51+
3.11) echo "py311=$SIZE" >> $GITHUB_OUTPUT ;;
52+
3.12) echo "py312=$SIZE" >> $GITHUB_OUTPUT ;;
53+
3.13) echo "py313=$SIZE" >> $GITHUB_OUTPUT ;;
54+
esac
55+
56+
comment-on-pr:
57+
if: github.event_name == 'pull_request' && github.base_ref == 'master'
58+
needs: measure-venv
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Post venv size summary to PR
62+
uses: actions/github-script@v7
63+
with:
64+
github-token: ${{ secrets.GITHUB_TOKEN }}
65+
script: |
66+
const sizes = {
67+
"3.9": "${{ needs.measure-venv.outputs.py39 || 'N/A' }}",
68+
"3.10": "${{ needs.measure-venv.outputs.py310 || 'N/A' }}",
69+
"3.11": "${{ needs.measure-venv.outputs.py311 || 'N/A' }}",
70+
"3.12": "${{ needs.measure-venv.outputs.py312 || 'N/A' }}",
71+
"3.13": "${{ needs.measure-venv.outputs.py313 || 'N/A' }}",
72+
};
73+
74+
const body = [
75+
'**Bittensor SDK virtual environment sizes by Python version:**',
76+
'',
77+
'```'
78+
]
79+
.concat(Object.entries(sizes).map(([v, s]) => `Python ${v}: ${s} MB`))
80+
.concat(['```'])
81+
.join('\n');
82+
83+
github.rest.issues.createComment({
84+
issue_number: context.issue.number,
85+
owner: context.repo.owner,
86+
repo: context.repo.repo,
87+
body
88+
});

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Build Python distribution
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717

1818
- name: Set up Python
1919
uses: actions/setup-python@v4
@@ -69,4 +69,4 @@ jobs:
6969
uses: pypa/gh-action-pypi-publish@release/v1
7070
with:
7171
verbose: true
72-
print-hash: true
72+
print-hash: true

0 commit comments

Comments
 (0)