-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add events stream and refactor stream organization #44
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7d5050d
feat: add events stream and refactor stream organization
KevinJoiner 9b3ab63
update model-garage version
KevinJoiner bafeea8
handle slice of events instead of single events
KevinJoiner 6cfb1a5
update model-garage version
KevinJoiner 692bdf7
update model-garage version
KevinJoiner 3d94c3d
feat: update CI pipleine
KevinJoiner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| name: Build | ||
| on: | ||
| pull_request: | ||
| branches: ["**"] | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| install-tools: | ||
| if: "!contains(github.event.head_commit.message, 'Merge pull request')" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
| - name: Install all tools | ||
| run: make tools | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: tools | ||
| path: bin/ | ||
|
|
||
| go-tests: | ||
| needs: install-tools | ||
| if: "!contains(github.event.head_commit.message, 'Merge pull request')" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: tools | ||
| path: bin/ | ||
| - name: Set executable | ||
| run: chmod +x bin/* | ||
| - name: Run Go tests | ||
| run: make test-go | ||
|
|
||
| prometheus-alerts: | ||
| needs: install-tools | ||
| if: "!contains(github.event.head_commit.message, 'Merge pull request')" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: tools | ||
| path: bin/ | ||
| - name: Set executable | ||
| run: chmod +x bin/* | ||
| - name: Run Prometheus alert tests | ||
| run: make test-prometheus-alerts | ||
|
|
||
| prometheus-rules: | ||
| needs: install-tools | ||
| if: "!contains(github.event.head_commit.message, 'Merge pull request')" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: tools | ||
| path: bin/ | ||
| - name: Set executable | ||
| run: chmod +x bin/* | ||
| - name: Run Prometheus rules tests | ||
| run: make test-prometheus-rules | ||
| lint: | ||
| needs: install-tools | ||
| if: "!contains(github.event.head_commit.message, 'Merge pull request')" | ||
| runs-on: "ubuntu-latest" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: tools | ||
| path: bin/ | ||
| - name: Set executable | ||
| run: chmod +x bin/* | ||
|
|
||
| - name: Run lint | ||
| run: make lint |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| input: | ||
| label: kafka_input | ||
| kafka_franz: | ||
| seed_brokers: | ||
| - ${KAFKA_BOOTSTRAP_SERVERS:localhost}:${KAFKA_BOOTSTRAP_PORT:9092} | ||
| topics: | ||
| - '${DEVICE_EVENTS_TOPIC:topic.device.events}' | ||
| consumer_group: "zone.dimo.dps.events" | ||
| client_id: ${CONTAINER_NAME:localhost}-dps-events | ||
| rack_id: ${NODE_NAME:localhost} | ||
| fetch_max_bytes: 100MiB | ||
| fetch_max_wait: 50ms | ||
| fetch_min_bytes: 1B | ||
| fetch_max_partition_bytes: 10MiB | ||
| commit_period: 2s | ||
| checkpoint_limit: 1000000 # double the batch size for insertion | ||
| start_offset: "latest" | ||
|
|
||
| pipeline: | ||
| processors: | ||
| - label: "convert_events_to_slice" | ||
| dimo_event_to_slice: {} | ||
|
|
||
| output: | ||
| label: "insert_event" | ||
| fallback: | ||
| - label: "insert_event_clickhouse" | ||
| sql_insert: | ||
| driver: clickhouse | ||
| dsn: clickhouse://${CLICKHOUSE_HOST}:${CLICKHOUSE_PORT}/${CLICKHOUSE_DIMO_DATABASE}?username=${CLICKHOUSE_USER}&password=${CLICKHOUSE_PASSWORD}&secure=true&max_execution_time=600 | ||
| table: event | ||
| columns: [] | ||
| args_mapping: root = this | ||
| batching: | ||
| count: 500000 | ||
| byte_size: 0 | ||
| period: "2s" | ||
| check: "" | ||
|
|
||
| - label: "insert_event_clickhouse_failure" | ||
| switch: | ||
| cases: | ||
| # If the error contains "bad connection", reject the message so it will be retried | ||
| - check: 'metadata("fallback_error").or("").contains("bad connection")' | ||
| output: | ||
| reject: metadata("fallback_error") | ||
| processors: | ||
| - resource: "handle_db_connection_error" | ||
| - check: '' | ||
| output: | ||
| drop: {} | ||
| processors: | ||
| - mutation: | | ||
| meta dimo_component = "insert_event_clickhouse" | ||
| - resource: "handle_db_error" |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes this consistent with our other services.