Skip to content

Commit 0343f64

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pyronova-v2.3.1
2 parents 4bedd0c + 674a08a commit 0343f64

400 files changed

Lines changed: 359410 additions & 49184 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.

.DS_Store

-6 KB
Binary file not shown.

.claude/scheduled_tasks.lock

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/benchmark-pr.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,28 @@ jobs:
6060
exit 1
6161
fi
6262
63+
# When --save is requested, merge origin/main into the PR branch first.
64+
# The bot commits its results back to the PR head; on an old branch the
65+
# site/data/*.json files have drifted vs. main and the bot commit
66+
# immediately makes the PR CONFLICTING. Merging main here lands the
67+
# bench commit on a base that's already in sync, so the PR stays
68+
# MERGEABLE. Skipped for non-save runs since they don't push back.
69+
- name: Merge main into PR branch
70+
if: inputs.save == 'true'
71+
env:
72+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: |
74+
git config user.name "github-actions[bot]"
75+
git config user.email "github-actions[bot]@users.noreply.github.com"
76+
git fetch origin main --depth=1
77+
if ! git merge --no-edit origin/main; then
78+
git merge --abort 2>/dev/null || true
79+
gh pr comment "${{ inputs.pr }}" \
80+
--repo "${{ github.repository }}" \
81+
--body "⚠️ \`/benchmark --save\` aborted: \`main\` has diverged and cannot be auto-merged into this branch. Please merge or rebase \`main\` manually, push, and re-run \`/benchmark --save\`."
82+
exit 1
83+
fi
84+
6385
- name: Clean previous containers, results, and temp data
6486
run: |
6587
docker ps -aq --filter "name=httparena-" | xargs -r docker rm -f 2>/dev/null || true

.github/workflows/pr-commands.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,30 @@ jobs:
8282
PR_NUMBER: ${{ github.event.issue.number }}
8383
REPO: ${{ github.repository }}
8484

85+
# Pre-check that origin/main can auto-merge into the PR. The actual
86+
# merge happens inside benchmark-pr.yml after maintainer approval;
87+
# doing the dry-run here lets us reject conflicting PRs before
88+
# asking a maintainer to approve a run that's guaranteed to abort.
89+
# Skipped for non-save runs since they don't push back.
90+
- name: Check main merges into PR
91+
if: steps.parse.outputs.save == 'true' && steps.parse.outputs.framework != ''
92+
env:
93+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
run: |
95+
git config user.name "github-actions[bot]"
96+
git config user.email "github-actions[bot]@users.noreply.github.com"
97+
git fetch origin main --depth=1
98+
if ! git merge --no-commit --no-ff origin/main; then
99+
git merge --abort 2>/dev/null || true
100+
gh pr comment "${{ steps.parse.outputs.pr }}" \
101+
--repo "${{ github.repository }}" \
102+
--body "⚠️ \`/benchmark --save\` cannot start: \`main\` has diverged and cannot be auto-merged into this branch. Please merge or rebase \`main\` manually, push, and re-run \`/benchmark --save\`."
103+
exit 1
104+
fi
105+
# Discard the merged state — actual merge runs in benchmark-pr.yml
106+
# after maintainer approval. main may move between now and then.
107+
git merge --abort 2>/dev/null || true
108+
85109
- name: React to comment
86110
run: |
87111
gh api "/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions" -f content="rocket"
@@ -96,8 +120,6 @@ jobs:
96120
-f framework=${{ steps.parse.outputs.framework }} \
97121
-f profile="${{ steps.parse.outputs.profile }}" \
98122
-f save="${{ steps.parse.outputs.save }}"
99-
100-
gh pr comment "${{ steps.parse.outputs.pr }}" --body "🚀 Benchmark run triggered for \`${{ steps.parse.outputs.framework }}\`${{ steps.parse.outputs.profile && format(' (test: {0})', steps.parse.outputs.profile) || ' (all tests)' }}${{ steps.parse.outputs.save == 'true' && ' with --save' || '' }}. Results will be posted here when done."
101123
env:
102124
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103125

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ frameworks/fletch/.dart_tool/
2020
.vs/
2121

2222
# Ignore node modules anywhere in the repo
23-
node_modules/
23+
node_modules/
24+
25+
# macOS Finder metadata
26+
.DS_Store

frameworks/aleph/Dockerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,4 @@ COPY --from=builder /app/target/aleph-bench-0.1.0-standalone.jar /app/app.jar
1313

1414
EXPOSE 8080
1515

16-
ENTRYPOINT ["java", \
17-
"-server", \
18-
"-XX:+UseParallelGC", \
19-
"-XX:MaxRAMPercentage=50", \
20-
"-jar", "app.jar"]
16+
ENTRYPOINT ["java", "-jar", "app.jar"]

frameworks/aleph/src/aleph_bench/core.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
(io.vertx.core Vertx)
1919
(io.vertx.pgclient PgBuilder PgConnectOptions)
2020
(io.vertx.sqlclient PoolOptions)
21-
(java.io ByteArrayOutputStream)
21+
(java.io ByteArrayOutputStream )
2222
(java.net URI))
2323
(:gen-class))
2424

@@ -34,7 +34,6 @@
3434
(def ^:private ^:const dataset-path "/data/dataset.json")
3535
(def ^:private ^:const dataset-large-path "/data/dataset-large.json")
3636
(def ^:private ^:const db-path "/data/benchmark.db")
37-
(def ^:private ^:const static-dir "/data/static")
3837
(def ^:private ^:const param-min "min")
3938
(def ^:private ^:const param-max "max")
4039
(def ^:private ^:const param-limit "limit")
@@ -74,7 +73,9 @@
7473
end (if (neg? amp) (.length qs) amp)
7574
eq (.indexOf qs (int \=) i)]
7675
(if (and (>= eq 0) (< eq end))
77-
(recur (inc end) (+ sum (try (Long/parseLong (subs qs (inc eq) end)) (catch Exception _ 0))))
76+
(recur (inc end)
77+
(+ sum (long (try (Long/parseLong (subs qs (inc eq) end))
78+
(catch Exception _ 0)))))
7879
(recur (inc end) sum)))))))
7980

8081
(defn- json-response [data]
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
FROM python:3.13-slim
1+
FROM python:3.11-slim
2+
RUN apt-get update \
3+
&& apt-get install -y --no-install-recommends git build-essential \
4+
&& rm -rf /var/lib/apt/lists/*
5+
ENV PATH="/usr/local/bin:$PATH"
26
WORKDIR /app
37
COPY requirements.txt .
48
RUN pip install --no-cache-dir -r requirements.txt
59
COPY . .
6-
EXPOSE 8080
7-
CMD [ "python", "./app.py" ]
10+
EXPOSE 8080 8081
11+
CMD [ "python", "app.py" ]

frameworks/fastpysgi-asgi/app.py

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_header(scope: dict, name: str, def_value: str):
127127

128128
def check_accept_encoding(scope, substr):
129129
aenc = get_header(scope, 'Accept-Encoding', '')
130-
if aenc and substr == "*":
130+
if aenc and substr == "":
131131
return True
132132
if aenc and substr in aenc:
133133
return True
@@ -159,35 +159,11 @@ async def baseline11(scope, receive, send):
159159
req_method = scope.get('method', '')
160160
query_params = parse_qs(scope.get('query_string', b'').decode())
161161
total = 0
162-
for v in query_params.values():
163-
try:
164-
total += int(v[0])
165-
except ValueError:
166-
pass
162+
for val in query_params.values():
163+
total += int(val[0])
167164
if req_method == "POST":
168-
body = b''
169-
while True:
170-
message = await receive()
171-
body += message.get('body', b'')
172-
if not message.get('more_body', False):
173-
break
174-
if body:
175-
try:
176-
total += int(body.decode().strip())
177-
except UnicodeDecodeError:
178-
pass
179-
except ValueError:
180-
pass
181-
return text_resp(str(total))
182-
183-
async def baseline2(scope, receive, send):
184-
query_params = parse_qs(scope.get('query_string', b'').decode())
185-
total = 0
186-
for v in query_params.values():
187-
try:
188-
total += int(v[0])
189-
except ValueError:
190-
pass
165+
message = await receive()
166+
total += int(message.get('body', b''))
191167
return text_resp(str(total))
192168

193169
async def json_endpoint(scope, receive, send):
@@ -270,7 +246,6 @@ async def upload_endpoint(scope, receive, send):
270246
ROUTES = {
271247
'/pipeline': pipeline,
272248
'/baseline11': baseline11,
273-
'/baseline2': baseline2,
274249
'/json/': json_endpoint,
275250
'/json-comp/': json_endpoint,
276251
'/upload': upload_endpoint,
@@ -320,10 +295,15 @@ async def app(scope, receive, send):
320295
if __name__ == "__main__":
321296
import fastpysgi
322297

323-
host = '0.0.0.0'
324-
port = 8080
298+
certfile = os.environ.get("TLS_CERT", "/certs/server.crt")
299+
keyfile = os.environ.get("TLS_KEY" , "/certs/server.key")
300+
301+
fastpysgi.server.delete_all_binds()
302+
fastpysgi.server.add_bind('0.0.0.0', 8080)
303+
fastpysgi.server.add_bind('0.0.0.0', 8081, (certfile, keyfile, None))
325304

326305
fastpysgi.server.read_buffer_size = 256*1024
306+
fastpysgi.server.max_content_length = 31_000_000
327307
fastpysgi.server.backlog = 16*1024
328308
fastpysgi.server.loop_timeout = 1
329-
fastpysgi.run(app, host, port, workers = WRK_COUNT, loglevel = 0)
309+
fastpysgi.run(app, workers = WRK_COUNT, loglevel = 0)

frameworks/fastpysgi-asgi/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"enabled": true,
99
"tests": [
1010
"baseline",
11-
"pipelined",
1211
"limited-conn",
1312
"json",
1413
"json-comp",
14+
"json-tls",
1515
"upload",
1616
"api-4",
1717
"api-16",

0 commit comments

Comments
 (0)