Skip to content

Commit 051f6f0

Browse files
committed
chore: Initial commit
0 parents  commit 051f6f0

18 files changed

+1030
-0
lines changed

.dockerignore

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
# Python
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
*.so
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# Virtual environments
30+
.env
31+
.venv
32+
env/
33+
venv/
34+
ENV/
35+
env.bak/
36+
venv.bak/
37+
38+
# IDE
39+
.vscode/
40+
.idea/
41+
*.swp
42+
*.swo
43+
*~
44+
45+
# OS
46+
.DS_Store
47+
.DS_Store?
48+
._*
49+
.Spotlight-V100
50+
.Trashes
51+
ehthumbs.db
52+
Thumbs.db
53+
54+
# Test outputs
55+
sqlite_test_output/
56+
ultra_performance_results/
57+
performance_comparison/
58+
test_data/
59+
*.db
60+
*.db-journal
61+
*.db-wal
62+
*.db-shm
63+
*.log
64+
*.csv
65+
*.json
66+
67+
# Documentation
68+
*.md
69+
!README.md
70+
71+
# Docker
72+
Dockerfile
73+
docker-compose.yml
74+
.dockerignore
75+
76+
# Development tools
77+
.pre-commit-config.yaml
78+
pyproject.toml
79+
setup.py
80+
Makefile
81+
82+
# Coverage and testing
83+
.coverage
84+
.pytest_cache/
85+
htmlcov/
86+
.tox/
87+
.nox/

.github/.kodiak.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version = 1
2+
3+
[approve]
4+
auto_approve_usernames = ["cq-bot"]
5+
6+
[merge.message]
7+
body = "pull_request_body"
8+
cut_body_after = "Use the following steps to ensure your PR is ready to be reviewed"
9+
cut_body_and_text = true
10+
cut_body_before = "<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 -->"
11+
title = "pull_request_title"
12+
13+
[merge]
14+
blocking_labels = ["wip", "no automerge"]
15+
notify_on_conflict = false

.github/renovate.json5

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
extends: ["github>cloudquery/.github//.github/renovate-python-default.json5"],
3+
}

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.11"]
15+
16+
steps:
17+
- uses: actions/checkout@v5
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v6
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
cache: "pip"
24+
cache-dependency-path: "requirements.txt"
25+
26+
- name: Install dependencies
27+
run: pip install -r requirements.txt
28+
- name: fmt
29+
run: make fmt-check

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.cq/
2+
benchmark_results/
3+
cloudquery.log
4+
5+
*.pem
6+
7+
.DS_Store

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
<https://www.contributor-covenant.org/faq>. Translations are available at
128+
<https://www.contributor-covenant.org/translations>.

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Contributing to CloudQuery Benchmark
2+
3+
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
4+
5+
We're happy to accept contributions to the CloudQuery Benchmark.
6+
7+
## How Can I Contribute?
8+
9+
1. First visit our [README](./README.md) to get started.
10+
2. Then read our [Code of Conduct](./CODE_OF_CONDUCT.md) guidelines.
11+
3. Then follow the [GitHub documentation about forking a repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo).
12+
4. Before [submitting a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request), ensure your code is formatted using `make fmt`.
13+
14+
If you have any questions, please open an issue in our [GitHub repository](https://github.com/cloudquery/benchmark/issues).

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 CloudQuery Performance Testing Project
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fmt:
2+
black .
3+
4+
fmt-check:
5+
black --check .

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# CloudQuery Benchmark
2+
3+
This is a benchmark for CloudQuery. It is used to measure the performance of CloudQuery.
4+
5+
## Prerequisites
6+
7+
- Python version equal or higher than 3.11
8+
- CloudQuery CLI installed (see [CloudQuery CLI](https://docs.cloudquery.io/docs))
9+
10+
## Setup
11+
12+
The benchmark will use only the configured sources, and optionally the S3 destination.
13+
14+
### AWS Source
15+
16+
Set an `AWS_LOCAL_PROFILE` environment variable to the AWS local profile you want to use for the benchmark.
17+
18+
For example, if your AWS credentials files looks like this:
19+
20+
```toml
21+
[default]
22+
aws_access_key_id = YOUR_ACCESS_KEY_ID
23+
aws_secret_access_key = YOUR_SECRET_ACCESS_KEY
24+
25+
[benchmark]
26+
aws_access_key_id = YOUR_ACCESS_KEY_ID
27+
aws_secret_access_key = YOUR_SECRET_ACCESS_KEY
28+
```
29+
30+
Then you can set the `AWS_LOCAL_PROFILE` environment variable to `benchmark` to use the `benchmark` profile, via:
31+
32+
```bash
33+
export AWS_LOCAL_PROFILE=benchmark
34+
```
35+
36+
Alternatively, you can set the `AWS_LOCAL_PROFILE` environment variable in the `bench_configs/source_aws.yml` file.
37+
38+
### Azure Source
39+
40+
1. Follow the instructions in [Azure Source](https://hub.cloudquery.io/plugins/source/cloudquery/azure/latest/docs#overview-authentication-with-environment-variables) to authenticate with Azure using environment variables.
41+
2. Set an `AZURE_SUBSCRIPTION_ID` environment variable to the Azure subscription ID you want to use for the benchmark, for example:
42+
43+
```bash
44+
export AZURE_SUBSCRIPTION_ID=YOUR_AZURE_SUBSCRIPTION_ID
45+
```
46+
47+
### GCP Source
48+
49+
1. Ensure you have the Google Cloud CLI installed and run `gcloud auth application-default login` to set up Application Default Credentials.
50+
2. Set an `GCP_PROJECT_ID` environment variable to the GCP project ID you want to use for the benchmark, for example:
51+
52+
```bash
53+
export GCP_PROJECT_ID=YOUR_GCP_PROJECT_ID
54+
```
55+
56+
### S3 Destination
57+
58+
To enable sending data to S3, set the following environment variables:
59+
60+
```bash
61+
export S3_BUCKET_NAME=YOUR_S3_BUCKET_NAME
62+
export S3_REGION=YOUR_S3_REGION
63+
export S3_LOCAL_PROFILE=YOUR_S3_LOCAL_PROFILE
64+
```
65+
66+
## Running the benchmark
67+
68+
```bash
69+
pip install -r requirements.txt
70+
python benchmark.py
71+
```
72+
73+
### Advanced configuration
74+
75+
To generate enough resources to sync, we use the `CQ_DEBUG_SYNC_MULTIPLIER` to simulate more API calls to AWS, GCP and Azure.
76+
You can update the code to generate more or less resources if you'd like.

0 commit comments

Comments
 (0)