Skip to content

Commit

Permalink
Merge pull request #39 from glaciation-heu/nitpicking
Browse files Browse the repository at this point in the history
[minor fixes] warnings and documentation fixes
  • Loading branch information
ktatarnikovhiro authored Oct 29, 2024
2 parents 0d781c6 + 5bbd9f1 commit 4f290dd
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ default_language_version:
default_stages: [commit, push]

repos:
- repo: https://github.com/norwoodj/helm-docs
rev: ""
hooks:
- id: helm-docs
args:
# Make the tool search for charts only under the `charts` directory
- --chart-search-root=./charts

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions app/core/test_graph_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from app.transform.upper_ontology_base import UpperOntologyBase


class TestTransformer(UpperOntologyBase):
class ExampleTransformer(UpperOntologyBase):
def __init__(self, graph: Graph):
super().__init__(graph)

Expand All @@ -23,7 +23,7 @@ def simple_node(self) -> Tuple[Graph, str]:
cpu = IRI("glc", "cpu")
measurement_id = IRI("glc", "measurement1")

transformer = TestTransformer(graph)
transformer = ExampleTransformer(graph)
transformer.add_work_producing_resource(node1, "Node")
transformer.add_work_producing_resource(cpu, "CPU")
transformer.add_subresource(node1, cpu)
Expand Down
4 changes: 2 additions & 2 deletions app/test_kgexporter_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def setUp(self) -> None:
self.metadata_client = MockMetadataServiceClient()
self.k8s_client = MockK8SClient()
self.metric_client = MockPrometheusClient()
self.settings = self.test_kg_exporter_settings()
self.settings = self.kg_exporter_settings()
self.context = KGExporterContext(
self.clock,
self.metadata_client,
Expand Down Expand Up @@ -93,7 +93,7 @@ def assert_graphs(
slice_id = KGSliceId.from_host_port(host_and_port)
self.assert_serialized_graph(snapshot_identity, slice_id, serialized_graph)

def test_kg_exporter_settings(self) -> KGExporterSettings:
def kg_exporter_settings(self) -> KGExporterSettings:
settings = KGExporterSettings(
builder=KGBuilderSettings(
builder_tick_seconds=60,
Expand Down
2 changes: 1 addition & 1 deletion charts/app/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: kg-exporter
description: Kubernetes watcher service.
description: Kubernetes knowledge graph exporter service.
type: application
version: "0.0.0"
appVersion: "0.0.0"
56 changes: 56 additions & 0 deletions charts/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# kg-exporter

![Version: 0.0.0](https://img.shields.io/badge/Version-0.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square)

Kubernetes knowledge graph exporter service.

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `""` | |
| image.tag | string | `""` | |
| imagePullSecrets | list | `[]` | |
| ingressHostName | string | `"kg-exporter"` | |
| livenessProbe.failureThreshold | int | `3` | |
| livenessProbe.httpGet.path | string | `"/"` | |
| livenessProbe.httpGet.port | int | `8080` | |
| livenessProbe.httpGet.scheme | string | `"HTTP"` | |
| livenessProbe.initialDelaySeconds | int | `15` | |
| livenessProbe.periodSeconds | int | `10` | |
| livenessProbe.timeoutSeconds | int | `5` | |
| nameOverride | string | `""` | |
| podAnnotations | object | `{}` | |
| podLabels | object | `{}` | |
| podSecurityContext | object | `{}` | |
| readinessProbe.httpGet.path | string | `"/"` | |
| readinessProbe.httpGet.port | int | `8080` | |
| readinessProbe.httpGet.scheme | string | `"HTTP"` | |
| readinessProbe.initialDelaySeconds | int | `15` | |
| readinessProbe.periodSeconds | int | `10` | |
| readinessProbe.timeoutSeconds | int | `5` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| securityContext | object | `{}` | |
| service.port | int | `8080` | |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.automount | bool | `true` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `""` | |
| settings.builder.builder_tick_seconds | int | `60` | Periodicity of knolwedge graph building |
| settings.builder.is_single_slice | bool | `false` | Enables/Disables single slice per cluster or daemon set |
| settings.builder.node_port | int | `80` | DKG Slice service node port |
| settings.builder.queries.node_queries | list | [] | Prometheus node specific metrics queries |
| settings.builder.queries.pod_queries | list | [] | Prometheus pod specific metrics queries |
| settings.builder.single_slice_url | string | `"http://metadata-service:80"` | In case single DKG slice is enabled, this is the url of the single DKG slice |
| settings.k8s.in_cluster | bool | `true` | in cluster or out service cluster execution |
| settings.metadata.metadata_service_url | string | `"metadata-service"` | Metadata Service endpoint service name |
| settings.metadata.timeout_seconds | int | `20` | Metadata Service API timeout |
| settings.prometheus.endpoint_port | int | `8080` | KG exporter '/metrics' API port |
| settings.prometheus_client.url | string | `"prometheus.integration"` | Prometheus endpoint url |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
18 changes: 18 additions & 0 deletions charts/app/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}

{{ template "helm-docs.versionFooter" . }}
32 changes: 31 additions & 1 deletion charts/app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,26 @@ readinessProbe:
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 5

# Knowledge graph exporter service settings
settings:
# Knowledge graph builder
builder:
# -- Periodicity of knolwedge graph building
builder_tick_seconds: 60

# -- DKG Slice service node port
node_port: 80

# -- In case single DKG slice is enabled, this is the url of the single DKG slice
single_slice_url: http://metadata-service:80

# -- Enables/Disables single slice per cluster or daemon set
is_single_slice: False

# Prometheus queries to collect metrics
queries:
# -- Prometheus node specific metrics queries
# @default -- []
node_queries:

- measurement_id: Energy.Usage
Expand Down Expand Up @@ -124,6 +136,8 @@ settings:
)
result_parser: PROMETHEUS_PARSER

# -- Prometheus pod specific metrics queries
# @default -- []
pod_queries:

- measurement_id: Usage
Expand Down Expand Up @@ -230,12 +244,28 @@ settings:
)
result_parser: PROMETHEUS_PARSER

# Kubernetes configuration
k8s:

# -- in cluster or out service cluster execution
in_cluster: true

# Metadata service endpoing confguration
metadata:
# -- Metadata Service endpoint service name
metadata_service_url: metadata-service

# -- Metadata Service API timeout
timeout_seconds: 20

# Prometheus metric exposure configuration
prometheus:

# -- KG exporter '/metrics' API port
endpoint_port: 8080

# Prometheus client configuration
prometheus_client:

# -- Prometheus endpoint url
url: prometheus.integration

0 comments on commit 4f290dd

Please sign in to comment.