Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Type Hint #102

Merged
merged 7 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ end_of_line = lf
[*.yaml]
indent_size = 2

[*.yml]
indent_size = 2

[*.bat]
indent_style = tab
end_of_line = crlf
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
* duetector version:
* Python version:
* Operating System:
- duetector version:
- Python version:
- Operating System:

### Description

Expand Down
50 changes: 23 additions & 27 deletions .github/workflows/build-latest-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,31 @@ on:
jobs:
deploy:
strategy:
fail-fast: true
fail-fast: true

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

# Build docker images
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build_latest
uses: docker/build-push-action@v4
with:
context: .
build-args: |
BCC_VERSION=v0.28.0
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/duetector:latest
# Build docker images
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build_latest
uses: docker/build-push-action@v4
with:
context: .
build-args: |
BCC_VERSION=v0.28.0
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/duetector:latest
41 changes: 19 additions & 22 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,31 @@ name: Testing docker image build

on:
pull_request:
branches: [ "master", "main" ]
branches: ["master", "main"]

jobs:
deploy:
strategy:
fail-fast: true
fail-fast: true

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

# Build docker images
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build image
id: docker_build_test
uses: docker/build-push-action@v4
with:
context: .
build-args: |
BCC_VERSION=v0.28.0
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile
push: false
tags: build
# Build docker images
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build image
id: docker_build_test
uses: docker/build-push-action@v4
with:
context: .
build-args: |
BCC_VERSION=v0.28.0
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile
push: false
tags: build
47 changes: 21 additions & 26 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,27 @@ permissions:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build_release
uses: docker/build-push-action@v4
with:
context: .
build-args: |
BCC_VERSION=v0.28.0
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/duetector:${{ github.ref_name }}
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build_release
uses: docker/build-push-action@v4
with:
context: .
build-args: |
BCC_VERSION=v0.28.0
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/duetector:${{ github.ref_name }}
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
45 changes: 22 additions & 23 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,36 @@ name: Testing python package

on:
push:
branches: [ "master", "main" ]
branches: ["master", "main"]
pull_request:
branches: [ "master", "main" ]
branches: ["master", "main"]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
- name: Test with pytest
run: |
pytest -vv --cov-append --cov=duetector --cov-report=term-missing tests/standalone
- name: Intergration Test for jaeger
run: |
pytest -vv --cov-append --cov=duetector --cov-report=term-missing tests/integration/jaeger/
- name: Install dependencies for building
run: |
pip install build twine hatch
- name: Test building
run: python -m build
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
- name: Test with pytest
run: |
pytest -vv --cov-append --cov=duetector --cov-report=term-missing tests/standalone
- name: Intergration Test for jaeger
run: |
pytest -vv --cov-append --cov=duetector --cov-report=term-missing tests/integration/jaeger/
- name: Install dependencies for building
run: |
pip install build twine hatch
- name: Test building
run: python -m build
49 changes: 24 additions & 25 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,30 @@ permissions:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine hatch
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Upload dists to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
file_glob: true
tag: ${{ github.ref }}
overwrite: true
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine hatch
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Upload dists to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
file_glob: true
tag: ${{ github.ref }}
overwrite: true
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,30 @@ repos:
- id: isort
files: \.py$
args: [--profile=black]

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies:
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
types_or: [yaml, html, json]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.7.0"
hooks:
- id: mypy
files: duetector
stages: [manual]
3 changes: 1 addition & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ build:
python: "3.10"

sphinx:
configuration: docs/source/conf.py

configuration: docs/source/conf.py

python:
install:
Expand Down
5 changes: 1 addition & 4 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/lib/modules/**"
],
"includePath": ["${workspaceFolder}/**", "/lib/modules/**"],
"defines": [],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ Access `http://localhost:8080` for docs.
## Contributing a new tracer/filter/collector/analyzer

1. Create a new file in `duetector/tracer`, `duetector/filter`, `duetector/collector` or `duetector/analyzer` directory, with the name `{name}.py`
2. Implement the new tracer/filter/collector/analyzer
3. Add the new tracer/filter/collector to `registers` list in `duetector/tracer/register.py`, `duetector/filter/register.py`, `duetector/collector/register.py` or `duetector/analyzer/register.py`
4. Test the new tracer/filter/collector/analyzer
5. Generate new static config file with `python duetector/tools/config_generator.py`
1. Implement the new tracer/filter/collector/analyzer
1. Add the new tracer/filter/collector to `registers` list in `duetector/tracer/register.py`, `duetector/filter/register.py`, `duetector/collector/register.py` or `duetector/analyzer/register.py`
1. Test the new tracer/filter/collector/analyzer
1. Generate new static config file with `python duetector/tools/config_generator.py`

Another way to add a new tracer/filter/collector/analyzer is to use our extension mechanism, see [Extension](./examples/extension). This is not required a change to the duetector codebase and you will mantain the extension by yourself.
Loading