Skip to content

Commit 8d543cd

Browse files
authored
Merge branch 'TechEmpower:master' into master
2 parents a516c0a + 4dfb9e0 commit 8d543cd

File tree

3,475 files changed

+108799
-60729
lines changed

Some content is hidden

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

3,475 files changed

+108799
-60729
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!--
22
Thank you for submitting to the TechEmpower Framework Benchmarks!
33
4-
If you are submitting a new framework, please make sure that you add the appropriate line in the `.github/workflows/build.yml` file for proper integration testing. Also please make sure that an appropriate `README.md` is added in your framework directory with information about the framework and a link to its homepage and documentation.
4+
If you are submitting a new framework, please make sure that an appropriate `README.md` is added in your framework directory with information about the framework and a link to its homepage and documentation.
55
66
For new frameworks, please do not include source code that isn't required for the benchmarks.
77

.github/workflows/build.yml

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: build
22
on: [ push, pull_request ]
33
jobs:
44
setup:
5-
runs-on: ubuntu-20.04
5+
runs-on: ubuntu-22.04
66
steps:
77
# Required for workflow triggers like the auto-label for failing PRs
88
- name: Save PR number
@@ -20,7 +20,7 @@ jobs:
2020
#
2121
# We need to fetch more than one commit to be able to access HEAD^2 in case
2222
# of a pull request
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2424
with:
2525
fetch-depth: 10
2626
# In case of a push event, the commit we care about is simply HEAD.
@@ -46,9 +46,9 @@ jobs:
4646
echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
4747
echo "EOF" >> $GITHUB_ENV
4848
echo "PREVIOUS_COMMIT=$(git log --format=%H -n 1 HEAD^2~1)" >> $GITHUB_ENV
49-
- uses: actions/setup-python@v2
49+
- uses: actions/setup-python@v4
5050
with:
51-
python-version: '2.7'
51+
python-version: '3.10'
5252
architecture: 'x64'
5353
- name: Get all changes vs master
5454
env:
@@ -65,14 +65,16 @@ jobs:
6565
- id: event_out
6666
name: Write event outputs
6767
run: |
68-
# Escape the multiline string for Github Actions, see https://github.community/t/set-output-truncates-multiline-strings/16852/3
69-
COMMIT_MESSAGE="${COMMIT_MESSAGE//'%'/'%25'}"
70-
COMMIT_MESSAGE="${COMMIT_MESSAGE//$'\n'/'%0A'}"
71-
COMMIT_MESSAGE="${COMMIT_MESSAGE//$'\r'/'%0D'}"
72-
echo "::set-output name=commit_message::$COMMIT_MESSAGE"
73-
echo "::set-output name=branch_name::$BRANCH_NAME"
74-
echo "::set-output name=target_branch_name::$TARGET_BRANCH_NAME"
75-
echo "::set-output name=previous_commit::$PREVIOUS_COMMIT"
68+
# Escape the multiline string for Github Actions, see https://lab.amalitsky.com/posts/2022/github-actions-set-output-migration/#migration-from-set-output-to-github-output
69+
delimiter="$(openssl rand -hex 8)"
70+
{
71+
echo "commit_message<<${delimiter}"
72+
echo $COMMIT_MESSAGE
73+
echo "${delimiter}"
74+
} >> $GITHUB_OUTPUT
75+
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
76+
echo "target_branch_name=$TARGET_BRANCH_NAME" >> $GITHUB_OUTPUT
77+
echo "previous_commit=$PREVIOUS_COMMIT" >> $GITHUB_OUTPUT
7678
- id: verify_out
7779
name: Write verify job matrix
7880
run: |
@@ -82,7 +84,7 @@ jobs:
8284
# - TESTLANG: {lang}
8385
# with a TESTLANG object in the include array for each language under frameworks
8486
VERIFY_MATRIX=$(ls -1 frameworks | jq -Rc '.+"/" | select(inside(env.RUN_TESTS)) | rtrimstr("/")' | jq -sc '{include: map({TESTLANG: .})}')
85-
echo "::set-output name=verify_matrix::$VERIFY_MATRIX"
87+
echo "verify_matrix=$VERIFY_MATRIX" >> $GITHUB_OUTPUT
8688
outputs:
8789
commit_message: ${{ steps.event_out.outputs.commit_message }}
8890
branch_name: ${{ steps.event_out.outputs.branch_name }}
@@ -93,7 +95,7 @@ jobs:
9395
needs: setup
9496
# The matrix check is necessary because an empty job matrix is otherwise considered a workflow failure
9597
if: ${{ !contains(needs.setup.outputs.commit_message, '[ci skip]') && contains(needs.setup.outputs.verify_matrix, 'TESTLANG') }}
96-
runs-on: ubuntu-18.04
98+
runs-on: ubuntu-22.04
9799
strategy:
98100
matrix: ${{ fromJSON(needs.setup.outputs.verify_matrix) }}
99101
# Disable fail-fast to allow all failing frameworks/etc to fail in a
@@ -108,12 +110,12 @@ jobs:
108110
PREVIOUS_COMMIT: ${{ needs.setup.outputs.previous_commit }}
109111
PR_NUMBER: ${{ github.event.pull_request.number }}
110112
steps:
111-
- uses: actions/checkout@v2
113+
- uses: actions/checkout@v3
112114
with:
113115
fetch-depth: 10
114-
- uses: actions/setup-python@v2
116+
- uses: actions/setup-python@v4
115117
with:
116-
python-version: '2.7'
118+
python-version: '3.10'
117119
architecture: 'x64'
118120
- name: Get all changes vs master
119121
# Runs github_actions_diff, with the the output accessible in later steps
@@ -138,7 +140,10 @@ jobs:
138140
if [ "$RUN_TESTS" ]; then echo "Proceeding to run tests."; else echo 'Skipping test verification.'; fi
139141
- name: Build tfb dockerfile
140142
if: ${{ env.RUN_TESTS }}
141-
run: docker build -t techempower/tfb - < ./Dockerfile;
143+
uses: mattes/cached-docker-build-action@v1
144+
with:
145+
args: " --file ./Dockerfile --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --tag techempower/tfb ."
146+
cache_key: "${{ hashFiles('./Dockerfile') }}"
142147
- name: Stop services
143148
# Stop services that would claim ports we may need
144149
run: |
@@ -150,4 +155,22 @@ jobs:
150155
# run-ci.py runs the diffing to see if github actions needs to test this framework. Ideally/eventually,
151156
# we'd like to try and do the diffing before github_actions_clean & setup.
152157
# This will run the tests exactly as you would in your own vm:
153-
docker network create tfb > /dev/null 2>&1 && docker run --network=tfb -v /var/run/docker.sock:/var/run/docker.sock --mount type=bind,source=`pwd`,target=/FrameworkBenchmarks techempower/tfb --mode verify --test-dir $RUN_TESTS --results-environment Github-Actions;
158+
docker network create tfb > /dev/null 2>&1 && docker run --network=tfb -e USER_ID=$(id -u) -v /var/run/docker.sock:/var/run/docker.sock --mount type=bind,source=`pwd`,target=/FrameworkBenchmarks techempower/tfb --mode verify --test-dir $RUN_TESTS --results-environment Github-Actions;
159+
dependabot:
160+
needs: verify
161+
runs-on: ubuntu-latest
162+
permissions:
163+
pull-requests: write
164+
contents: write
165+
if: ${{ github.actor == 'dependabot[bot]' }}
166+
steps:
167+
- name: Dependabot metadata
168+
id: metadata
169+
uses: dependabot/[email protected]
170+
with:
171+
github-token: "${{ secrets.GITHUB_TOKEN }}"
172+
- name: Enable auto-merge for Dependabot PRs
173+
run: gh pr merge --auto --merge "$PR_URL"
174+
env:
175+
PR_URL: ${{github.event.pull_request.html_url}}
176+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/get-maintainers.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: get-maintainers
2+
on:
3+
pull_request:
4+
types: [opened, reopened]
5+
permissions:
6+
pull-requests: write
7+
jobs:
8+
get_maintainers:
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 10
14+
- name: Get commit branch and commit message from PR
15+
run: |
16+
echo "BRANCH_NAME=$GITHUB_HEAD_REF" >> $GITHUB_ENV
17+
echo "TARGET_BRANCH_NAME=$(echo ${GITHUB_BASE_REF##*/})" >> $GITHUB_ENV
18+
echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
19+
echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
20+
echo "EOF" >> $GITHUB_ENV
21+
echo "PREVIOUS_COMMIT=$(git log --format=%H -n 1 HEAD^2~1)" >> $GITHUB_ENV
22+
- uses: actions/setup-python@v4
23+
with:
24+
python-version: '3.10'
25+
architecture: 'x64'
26+
- name: Save PR number
27+
run: |
28+
mkdir -p ./maintainers
29+
echo ${{ github.event.number }} > ./maintainers/NR
30+
- name: Get Maintainers
31+
run: |
32+
python ./toolset/github_actions/get_maintainers.py > ./maintainers/maintainers.md
33+
- name: Save Maintainers
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: maintainers
37+
path: maintainers/

.github/workflows/label-failing-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
apply_label:
99
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure' }}
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
1212
- name: 'Download artifact'
1313
uses: actions/[email protected]
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Ping Maintainers
2+
on:
3+
workflow_run:
4+
workflows: [ "get-maintainers"]
5+
types:
6+
- completed
7+
permissions:
8+
pull-requests: write
9+
jobs:
10+
ping_maintainers:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: 'Download maintainers artifact'
14+
uses: actions/github-script@v6
15+
with:
16+
script: |
17+
let artifacts = await github.rest.actions.listWorkflowRunArtifacts({
18+
owner: context.repo.owner,
19+
repo: context.repo.repo,
20+
run_id: ${{github.event.workflow_run.id }},
21+
});
22+
let matchArtifact = artifacts.data.artifacts.filter((artifact) => {
23+
return artifact.name == "maintainers"
24+
})[0];
25+
let download = await github.rest.actions.downloadArtifact({
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
artifact_id: matchArtifact.id,
29+
archive_format: 'zip',
30+
});
31+
let fs = require('fs');
32+
fs.writeFileSync('${{github.workspace}}/maintainers.zip', Buffer.from(download.data));
33+
- run: unzip maintainers.zip
34+
- name: Ping maintainers
35+
uses: actions/github-script@v6
36+
with:
37+
github-token: ${{ secrets.GITHUB_TOKEN }}
38+
script: |
39+
let fs = require('fs');
40+
let issue_number = Number(fs.readFileSync('./NR'));
41+
let maintainers_comment = fs.readFileSync('./maintainers.md', 'utf8');
42+
if (maintainers_comment) {
43+
await github.rest.issues.createComment({
44+
issue_number: issue_number,
45+
owner: context.repo.owner,
46+
repo: context.repo.repo,
47+
body: maintainers_comment
48+
});
49+
}

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
.DS_Store
21
installs
3-
*.log
42
node_modules/
53
.travis.bak
64

@@ -35,6 +33,7 @@ build/
3533
*.patch
3634
*/bin/
3735

36+
3837
# intellij
3938
*.iml
4039
*.ipr
@@ -59,9 +58,14 @@ benchmark.cfg
5958

6059
# Visual Studio Code
6160
.vscode
61+
.history/
62+
.devcontainer
6263

6364
# vim
6465
.*.sw[a-p]
6566

6667
# merge tooling
67-
*.orig
68+
*.orig
69+
70+
# python
71+
.venv/

Dockerfile

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,60 @@
1-
FROM buildpack-deps:bionic
1+
FROM ubuntu:22.04
22

3+
ARG DEBIAN_FRONTEND=noninteractive
4+
# WARNING: DON'T PUT A SPACE AFTER ANY BACKSLASH OR APT WILL BREAK
35
# One -q produces output suitable for logging (mostly hides
46
# progress indicators)
5-
RUN apt-get -yqq update
7+
RUN apt-get -yqq update && \
8+
apt-get -yqq install \
9+
-o Dpkg::Options::="--force-confdef" \
10+
-o Dpkg::Options::="--force-confold" \
11+
cloc \
12+
curl \
13+
gcc \
14+
git-core \
15+
gosu \
16+
# Needed for mysqlclient
17+
libmysqlclient-dev \
18+
libpq-dev \
19+
pkg-config \
20+
python3 \
21+
python3-dev \
22+
python3-pip \
23+
siege \
24+
software-properties-common
625

7-
# WARNING: DONT PUT A SPACE AFTER ANY BACKSLASH OR APT WILL BREAK
8-
RUN apt-get -yqq install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
9-
git-core \
10-
cloc dstat `# Collect resource usage statistics` \
11-
python-dev \
12-
python-pip \
13-
software-properties-common \
14-
libmysqlclient-dev `# Needed for MySQL-python`
26+
RUN pip3 install \
27+
colorama==0.3.1 \
28+
docker==4.0.2 \
29+
mysqlclient \
30+
psutil \
31+
psycopg2-binary \
32+
pymongo==3.13.0 \
33+
# urllib3 incompatibility:
34+
# https://github.com/docker/docker-py/issues/3113#issuecomment-1525500104
35+
requests==2.28.1
1536

16-
RUN pip install colorama==0.3.1 requests MySQL-python psycopg2-binary pymongo docker==4.0.2 psutil
37+
# Collect resource usage statistics
38+
ARG DOOL_VERSION=v1.2.0
1739

18-
RUN apt-get install -yqq siege
40+
WORKDIR /tmp
41+
RUN curl -LSs "https://github.com/scottchiefbaker/dool/archive/${DOOL_VERSION}.tar.gz" | \
42+
tar --strip-components=1 -xz && \
43+
./install.py
1944

20-
# Fix for docker-py trying to import one package from the wrong location
21-
RUN cp -r /usr/local/lib/python2.7/dist-packages/backports/ssl_match_hostname/ /usr/lib/python2.7/dist-packages/backports
45+
# Check if the group ID is already created
46+
ARG GROUP_ID
47+
RUN if ! getent group "$GROUP_ID"; then \
48+
addgroup --gid "$GROUP_ID" user; \
49+
fi
2250

23-
ENV PYTHONPATH /FrameworkBenchmarks
24-
ENV FWROOT /FrameworkBenchmarks
51+
# Check if the user ID is already created
52+
ARG USER_ID
53+
RUN if ! getent passwd "$USER_ID"; then \
54+
adduser --disabled-password --gecos '' --gid "$GROUP_ID" --uid "$USER_ID" user; \
55+
fi
2556

26-
ENTRYPOINT ["python", "/FrameworkBenchmarks/toolset/run-tests.py"]
57+
ENV FWROOT=/FrameworkBenchmarks USER_ID="$USER_ID"
58+
ENV PYTHONPATH="$FWROOT"
59+
60+
ENTRYPOINT ["/FrameworkBenchmarks/entrypoint.sh"]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ Results of continuous benchmarking runs are available in real time [here](https:
8989

9090
### Data Visualization
9191

92-
If you have a `results.json` file that you would like to visualize, you can [do that here](https://tfb-status.techempower.com/share). You can also attach a `runid` parameter to that url where `runid` is a run listed on [tfb-status](https://tfb-status.techempower.com) like so: https://www.techempower.com/benchmarks/#section=test&runid=fd07b64e-47ce-411e-8b9b-b13368e988c6
92+
If you have a `results.json` file that you would like to visualize, you can [do that here](https://tfb-status.techempower.com/share). You can also attach a `runid` parameter to that url where `runid` is a run listed on [tfb-status](https://tfb-status.techempower.com) like so: https://www.techempower.com/benchmarks/#section=test&runid=fd07b64e-47ce-411e-8b9b-b13368e988c6.
93+
If you want to visualize them or compare different results files on bash, here is an unofficial [plaintext results parser](https://github.com/joeyleeeeeee97/PlainTextResultsParser)
9394

9495
## Contributing
9596

entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -eo pipefail -u
4+
5+
chown -LR "$USER_ID" /var/run
6+
# Drop permissions of user to match those of the host system
7+
gosu "$USER_ID" python3 "${FWROOT}/toolset/run-tests.py" "$@"

frameworks/C++/cpoll_cppsp/benchmark_config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"database_os": "Linux",
3939
"display_name": "cpoll-cppsp-raw",
4040
"notes": "",
41-
"versus": "cpoll_cppsp"
41+
"versus": "cpoll_cppsp",
42+
"tags": ["broken"]
4243
},
4344
"postgres-raw": {
4445
"db_url": "/db_pg_async",

0 commit comments

Comments
 (0)