Skip to content

Commit 5b1e2ab

Browse files
committed
Initial framework
0 parents  commit 5b1e2ab

File tree

371 files changed

+11064
-0
lines changed

Some content is hidden

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

371 files changed

+11064
-0
lines changed

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# .gitignore
2+
results/
3+
results-*/
4+
oss-fuzz/
5+
oss-fuzz-data/
6+
benchmark-sets/split_benchmarks/
7+
venv/
8+
.venv/
9+
10+
11+
# docker-specific
12+
Dockerfile

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
results/
2+
results-*/
3+
oss-fuzz/
4+
oss-fuzz-data/
5+
benchmark-sets/split_benchmarks/
6+
venv/
7+
.venv/
8+
__pycache__/

.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
src_paths=.

.pylintrc

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
[MESSAGES CONTROL]
2+
3+
# List of checkers and warnings to enable.
4+
enable=
5+
indexing-exception,
6+
old-raise-syntax,
7+
8+
# List of checkers and warnings to disable.
9+
# TODO: Shrink this list to as small as possible.
10+
disable=
11+
attribute-defined-outside-init,
12+
bad-option-value,
13+
bare-except,
14+
broad-except,
15+
c-extension-no-member,
16+
design,
17+
file-ignored,
18+
fixme,
19+
global-statement,
20+
import-error,
21+
import-outside-toplevel,
22+
locally-disabled,
23+
misplaced-comparison-constant,
24+
multiple-imports,
25+
no-self-use,
26+
relative-import,
27+
similarities,
28+
suppressed-message,
29+
ungrouped-imports,
30+
unsubscriptable-object,
31+
useless-object-inheritance, # Remove once all bots are on Python 3.
32+
useless-suppression,
33+
wrong-import-order,
34+
wrong-import-position,
35+
# FIXME: To be removed. Leftovers from Python 3 migration.
36+
consider-using-with,
37+
raise-missing-from,
38+
super-with-arguments,
39+
use-a-generator,
40+
consider-using-generator,
41+
consider-using-f-string, # Too much legacy usages.
42+
unspecified-encoding, # Too much legacy usage.
43+
broad-exception-raised,
44+
45+
[BASIC]
46+
47+
# Regular expression which should only match the name
48+
# of functions or classes which do not require a docstring.
49+
no-docstring-rgx=(__.*__|main)
50+
51+
# Min length in lines of a function that requires a docstring.
52+
docstring-min-length=10
53+
54+
# Regular expression which should only match correct module names. The
55+
# leading underscore is sanctioned for private modules by Google's style
56+
# guide.
57+
#
58+
# There are exceptions to the basic rule (_?[a-z][a-z0-9_]*) to cover
59+
# requirements of Python's module system and of the presubmit framework.
60+
module-rgx=^(_?[a-z][a-z0-9_]*)|__init__|__main__|PRESUBMIT|PRESUBMIT_unittest$
61+
62+
# Regular expression which should only match correct module level names.
63+
const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
64+
65+
# Regular expression which should only match correct class attribute.
66+
class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
67+
68+
# Regular expression which should only match correct class names.
69+
class-rgx=^_?[A-Z][a-zA-Z0-9]*$
70+
71+
# Regular expression which should only match correct function names.
72+
# 'camel_case' and 'snake_case' group names are used for consistency of naming
73+
# styles across functions and methods.
74+
function-rgx=^(?:(?P<exempt>setUp|tearDown|setUpModule|tearDownModule)|(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$
75+
76+
# Regular expression which should only match correct method names.
77+
# 'camel_case' and 'snake_case' group names are used for consistency of naming
78+
# styles across functions and methods. 'exempt' indicates a name which is
79+
# consistent with all naming styles.
80+
method-rgx=(?x)
81+
^(?:(?P<exempt>_[a-z0-9_]+__|runTest|setUp|tearDown|setUpTestCase
82+
|tearDownTestCase|setupSelf|tearDownClass|setUpClass
83+
|(test|assert)_*[A-Z0-9][a-zA-Z0-9_]*|next)
84+
|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9_]*)
85+
|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$
86+
87+
# Regular expression which should only match correct instance attribute names.
88+
attr-rgx=^_{0,2}[a-z][a-z0-9_]*$
89+
90+
# Regular expression which should only match correct argument names.
91+
argument-rgx=^[a-z][a-z0-9_]*$
92+
93+
# Regular expression which should only match correct variable names.
94+
variable-rgx=^[a-z][a-z0-9_]*$
95+
96+
# Regular expression which should only match correct list comprehension /
97+
# generator expression variable names.
98+
inlinevar-rgx=^[a-z][a-z0-9_]*$
99+
100+
# Good variable names which should always be accepted, separated by a comma.
101+
good-names=main,_,maxDiff
102+
103+
# Bad variable names which should always be refused, separated by a comma.
104+
bad-names=
105+
106+
# FIXME: Renable this.
107+
# List of builtins function names that should not be used, separated by a comma.
108+
#bad-builtin=input
109+
110+
[FORMAT]
111+
112+
# Maximum number of characters on a single line.
113+
max-line-length=80
114+
115+
# Maximum number of lines in a module
116+
max-module-lines=99999
117+
118+
# String used as indentation unit. We differ from PEP8's normal 4 spaces.
119+
indent-string=' '
120+
121+
[TYPECHECK]
122+

.pyrightconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"exclude": [
3+
"results/",
4+
"results-*/",
5+
"oss-fuzz/",
6+
"oss-fuzz-data/",
7+
"benchmark-sets/split_benchmarks/",
8+
"venv/",
9+
".venv/",
10+
"requirements.txt",
11+
".venv",
12+
]
13+
}

.style.yapf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[style]
2+
based_on_style = google
3+
column_limit = 80
4+
indent_width = 2
5+
split_before_named_assigns = true

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# How to contribute
2+
3+
We'd love to accept your patches and contributions to this project.
4+
5+
## Before you begin
6+
7+
### Sign our Contributor License Agreement
8+
9+
Contributions to this project must be accompanied by a
10+
[Contributor License Agreement](https://cla.developers.google.com/about) (CLA).
11+
You (or your employer) retain the copyright to your contribution; this simply
12+
gives us permission to use and redistribute your contributions as part of the
13+
project.
14+
15+
If you or your current employer have already signed the Google CLA (even if it
16+
was for a different project), you probably don't need to do it again.
17+
18+
Visit <https://cla.developers.google.com/> to see your current agreements or to
19+
sign a new one.
20+
21+
### Review our community guidelines
22+
23+
This project follows
24+
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).
25+
26+
## Contribution process
27+
28+
### Code reviews
29+
30+
All submissions, including submissions by project members, require review. We
31+
use GitHub pull requests for this purpose. Consult
32+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
33+
information on using pull requests.

Dockerfile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Build a virtualenv using the appropriate Debian release:
16+
# * Install python3-venv for the built-in Python3 venv module (not installed by default).
17+
# * Install gcloud CLI from Google Cloud's apt repository.
18+
19+
FROM debian:12
20+
# Install packages used by the Experiment. Python and Git are required for the experiment.
21+
# Curl, certs, and gnupg are required to install gcloud.
22+
RUN apt-get update && \
23+
apt-get install --no-install-suggests --no-install-recommends --yes \
24+
python3-venv \
25+
gcc \
26+
libpython3-dev \
27+
git \
28+
apt-transport-https \
29+
ca-certificates \
30+
gnupg \
31+
curl \
32+
wget2 \
33+
clang-format && \
34+
python3 -m venv /venv
35+
# Install gcloud cli.
36+
RUN echo "deb https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
37+
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
38+
apt-get update -y && \
39+
apt-get install google-cloud-cli -y
40+
# Set timezone to Australia/Sydney.
41+
ENV TZ='Australia/Sydney'
42+
43+
44+
# Install Docker for OSS-Fuzz.
45+
# Add Docker's official GPG key:
46+
RUN apt-get install ca-certificates curl gnupg && \
47+
install -m 0755 -d /etc/apt/keyrings && \
48+
curl -fsSL https://download.docker.com/linux/debian/gpg \
49+
| gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
50+
chmod a+r /etc/apt/keyrings/docker.gpg
51+
# Add the repository to Apt sources:
52+
RUN echo \
53+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
54+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
55+
tee /etc/apt/sources.list.d/docker.list > /dev/null
56+
RUN apt-get update && \
57+
apt-get install -y \
58+
docker-ce \
59+
docker-ce-cli \
60+
containerd.io \
61+
docker-buildx-plugin \
62+
docker-compose-plugin
63+
64+
65+
COPY . /experiment
66+
WORKDIR /experiment
67+
RUN /venv/bin/pip install --disable-pip-version-check -r requirements.txt
68+
ENTRYPOINT ["./report/docker_run.sh"]

0 commit comments

Comments
 (0)