-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(demos): create csv for some usecase
- Loading branch information
Showing
8 changed files
with
84 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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,5 @@ | ||
timestamp,id,env,artifact_id | ||
2024-01-01T11:00:00.926Z,app-a,group1-dev/eu-1/ns-a,pkg:oci/[email protected] | ||
2024-01-01T11:30:00.926Z,app-a,group1-uat/eu-1/ns-a,pkg:oci/[email protected] | ||
2024-01-02T13:10:00.926Z,app-a,group1-prod/eu-2/ns-a,pkg:oci/[email protected] | ||
2024-01-02T13:10:10.926Z,app-a,group1-prod/us-2/ns-a,pkg:oci/[email protected] |
This file contains 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,5 @@ | ||
timestamp,id,env,artifact_id | ||
2024-02-01T11:00:00.926Z,app-a,group1-dev/eu-1/ns-a,pkg:oci/[email protected] | ||
2024-02-01T11:30:00.926Z,app-a,group1-uat/eu-1/ns-a,pkg:oci/[email protected] | ||
2024-02-02T13:10:00.926Z,app-a,group1-prod/eu-2/ns-a,pkg:oci/[email protected] | ||
2024-02-03T13:10:10.926Z,app-a,group1-prod/us-2/ns-a,pkg:oci/[email protected] |
This file contains 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,2 @@ | ||
timestamp,id,env,artifact_id | ||
2024-03-01T11:00:00.926Z,app-a,group1-dev/eu-1/ns-a,pkg:oci/[email protected] |
This file contains 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,3 @@ | ||
timestamp,id,env,artifact_id | ||
2024-04-01T11:00:00.926Z,app-b,group1-dev/eu-1/ns-b,pkg:oci/app-b@f2b4da | ||
2024-04-01T11:30:00.926Z,app-b,group1-uat/eu-1/ns-b,pkg:oci/app-b@f2b4da |
This file contains 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,3 @@ | ||
timestamp,id,env,artifact_id | ||
2024-05-01T11:00:00.926Z,app-b,group1-dev/eu-1/ns-b,pkg:oci/[email protected] | ||
2024-05-01T11:30:00.926Z,app-b,group1-prod/eu-2/ns-b,pkg:oci/[email protected] |
This file contains 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,25 @@ | ||
# Examples of use cases | ||
|
||
## Context | ||
|
||
- artifacts: | ||
- format: [purl](https://github.com/package-url/purl-spec/blob/master/PURL-SPECIFICATION.rst) short:`scheme:type/namespace/name@version?qualifiers#subpath` | ||
- type: `oci` | ||
- namespace: `` (none) | ||
- name x several versions (and convention): | ||
- `app-a` (semver only): `0.0.1`, `0.1.0`, `1.0.0` | ||
- `app-b` (git describe + semver): `f2b4da`, `a32d55` `0.1.0-2-ge453fae` | ||
- environments: | ||
- format `{cluster}/{namespace}` => `{family}-{stage}/{region}/{namespace}` | ||
- family: `group1` | ||
- stages: `dev`, `uat`, `prod` | ||
- regions: `eu-1`, `eu-2`, `us-2` (dev and uat on `eu-1`, prod on `us-2` and `eu-2`) | ||
- namespace: `ns-a`, `ns-b` | ||
|
||
## Scenarii | ||
|
||
- sequence stages: [202401-dev-uat-prods](`202401-dev-uat-prods.csv`): dev -> uat -> all prod | ||
- sequence clusters: [202402-dev-uat-prod1](`202402-dev-uat-prod1.csv`): dev -> uat -> prod 1 -> prod 2 | ||
- wip: [202403-dev](`202403-dev.csv`): dev | ||
- rejected on uat: [202404-dev-uat](`202404-dev-uat.csv`): dev -> uat | ||
- hotfix: [202405-dev-prod](`202405-dev-prod.csv`): dev -> prod 1 |
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,47 +1,59 @@ | ||
[sinks.debug] | ||
type = "debug" | ||
|
||
[sinks.cdviz_db] | ||
enabled = true | ||
type = "db" | ||
url = "postgresql://cdviz:[email protected]:5432/cdviz" | ||
pool_connections_min = 1 | ||
pool_connections_max = 10 | ||
|
||
[sources.cdevents_json] | ||
[sources.cdevents_local_json] | ||
enabled = true | ||
|
||
[sources.cdevents_local_json.extractor] | ||
type = "opendal" | ||
kind = "fs" | ||
polling_interval = "10s" | ||
polling_interval = "60s" | ||
parameters = { root = "./cdevents" } | ||
recursive = false | ||
recursive = true | ||
path_patterns = ["*.json"] | ||
transformer = { extractor = "json" } | ||
parser = "json" | ||
|
||
[sources.cdevents_csv] | ||
[sources.cdevents_local_csv] | ||
enabled = true | ||
|
||
[sources.cdevents_local_csv.extractor] | ||
type = "opendal" | ||
kind = "fs" | ||
polling_interval = "10s" | ||
polling_interval = "20s" | ||
parameters = { root = "./cdevents" } | ||
recursive = false | ||
path_patterns = ["cdevents.csv"] | ||
transformer = { extractor = "csv_row", transform = { format = "hbs", content = """ | ||
path_patterns = ["*.csv"] | ||
parser = "csv_row" | ||
|
||
[[sources.cdevents_local_csv.transformers]] | ||
type = "hbs" | ||
template = """ | ||
{ | ||
"context": { | ||
"version": "0.4.0-draft", | ||
"id": "{{ content.uuid }}", | ||
"source": "/event/source/123", | ||
"type": "dev.cdevents.service.deployed.0.1.1", | ||
"timestamp": "{{ content.timestamp }}" | ||
}, | ||
"subject": { | ||
"id": "{{ content.id }}", | ||
"source": "/event/source/123", | ||
"type": "service", | ||
"content": { | ||
"environment": { | ||
"id": "{{ content.env }}" | ||
}, | ||
"artifactId": "{{ content.artifact_id }}" | ||
"metadata": {{ json_to_str metadata }}, | ||
"header": {{ json_to_str header }}, | ||
"body": { | ||
"context": { | ||
"version": "0.4.0-draft", | ||
"id": "0", | ||
"source": "/event/source/123", | ||
"type": "dev.cdevents.service.deployed.0.1.1", | ||
"timestamp": "{{ body.timestamp }}" | ||
}, | ||
"subject": { | ||
"id": "{{ body.id }}", | ||
"source": "/event/source/123", | ||
"type": "service", | ||
"content": { | ||
"environment": { | ||
"id": "{{ body.env }}" | ||
}, | ||
"artifactId": "{{ body.artifact_id }}" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
""" } } | ||
""" |