From 82f3e9358dbecbd7ca46de5a94f686a2b12bf4a3 Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Mon, 9 Jun 2025 16:31:04 -0300 Subject: [PATCH 1/3] SIENTIAPDE-988 Refactor variable naming for clarity and update image tag and service settings in values.yaml --- ingestor/managers/ingestor_manager.py | 4 ++-- ingestor/managers/opc_manager.py | 2 +- values.yaml | 23 ++++++++++++++++------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ingestor/managers/ingestor_manager.py b/ingestor/managers/ingestor_manager.py index 8c05c44..6769229 100644 --- a/ingestor/managers/ingestor_manager.py +++ b/ingestor/managers/ingestor_manager.py @@ -321,8 +321,8 @@ class IngestorManager(): None """ - for id in ids: - self.resource_manager.drop_tag_lease(id) + for _id in ids: + self.resource_manager.drop_tag_lease(_id) def manage_server(self, slot: str, server: str, server_config: dict, tags: dict) -> int: """ diff --git a/ingestor/managers/opc_manager.py b/ingestor/managers/opc_manager.py index b8065f3..0d656a6 100644 --- a/ingestor/managers/opc_manager.py +++ b/ingestor/managers/opc_manager.py @@ -141,7 +141,7 @@ class OpcManager(): for node, config in self.nodes.items(): self.nodes[node]['cycle_rule'] = { - 'cycle_increment': collect_period*1000/config['frequency'], + 'cycle_increment': collect_period*1000/float(config['frequency']), 'cycle_count': 0 } diff --git a/values.yaml b/values.yaml index 08d9a14..d5293bd 100644 --- a/values.yaml +++ b/values.yaml @@ -11,7 +11,7 @@ image: # This sets the pull policy for images. pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. - tag: "0.0.1" + tag: "0.1.0" # This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ imagePullSecrets: @@ -19,7 +19,7 @@ imagePullSecrets: # This is to override the chart name. nameOverride: "sientia-opc-ingestor" fullnameOverride: "sientia-opc-ingestor" -namespace: sientia-opc +namespace: sientia # This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ serviceAccount: @@ -112,7 +112,7 @@ tolerations: [] affinity: {} service: - enabled: false + enabled: true type: ClusterIP port: 4840 targetPort: 4840 @@ -123,7 +123,7 @@ env: - name: GITHUB_REPO_URL value: "git@github.com:Aignosi/sientia-dataops-opc-ingestor.git" - name: GITHUB_BRANCH - value: "SIENTIAPDE-988-criar-ingestor-opc" + value: "main" - name: PYTHON_APP value: "ingestor.app" @@ -150,13 +150,22 @@ env: value: "30" - name: POLL_INTERVAL value: "10" + - name: LOG_LEVEL + value: "DEBUG" + - name: HTTP_SERVER_PORT + value: "4840" ssh: enabled: true - secretName: git-ssh-key-temp + secretName: git-ssh-key-sientia-opc-ingestor sshPath: /mnt/.ssh knownHostsPath: /mnt/known_hosts -# kubectl create secret docker-registry docker-hub-secret --namespace sientia-opc --docker-server=http://aignosi.azurecr.io --docker-username=aignosi --docker-password=5I5zpQ6sRaHqX1hD3dr+2mo647yO3FRc359/wu6gsP+ACRDRz5mp -# helm upgrade --install sientia-dataops-opc-ingestor sientia/sientia-module -n sientia-opc --create-namespace -f ./values.yaml \ No newline at end of file +# kubectl create secret docker-registry docker-hub-secret --namespace sientia --docker-server=http://aignosi.azurecr.io --docker-username=aignosi --docker-password=5I5zpQ6sRaHqX1hD3dr+2mo647yO3FRc359/wu6gsP+ACRDRz5mp +# helm upgrade --install sientia-opc-ingestor sientia/sientia-module -n sientia --create-namespace -f ./values.yaml --version 0.1.0-uat + +# kubectl create secret generic git-ssh-key-sientia-opc-ingestor \ +# --namespace sientia \ +# --from-file=ssh-privatekey=git_key \ +# --type=kubernetes.io/ssh-auth \ No newline at end of file From 975c640ea88e1f3bea7ce1cd941e1f8b87399d65 Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Mon, 9 Jun 2025 16:36:29 -0300 Subject: [PATCH 2/3] SIENTIAPDE-988 Update NotificationHandler initialization and change GITHUB_BRANCH in values.yaml --- ingestor/ingestor.py | 6 +----- values.yaml | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ingestor/ingestor.py b/ingestor/ingestor.py index 3d39b35..a662714 100644 --- a/ingestor/ingestor.py +++ b/ingestor/ingestor.py @@ -43,11 +43,7 @@ class Ingestor: self.notification_handler = NotificationHandler( servers=self.kafka_servers, logger=self.logger, - project_name="OPC_INGESTOR", - pipeline_name="-", - trigger_name="-", - model_name="-", - model="-" + project_name="OPC_INGESTOR" ) # build args for build notificarions components diff --git a/values.yaml b/values.yaml index d5293bd..63468b4 100644 --- a/values.yaml +++ b/values.yaml @@ -123,7 +123,7 @@ env: - name: GITHUB_REPO_URL value: "git@github.com:Aignosi/sientia-dataops-opc-ingestor.git" - name: GITHUB_BRANCH - value: "main" + value: "SIENTIAPDE-988-criar-ingestor-opc" - name: PYTHON_APP value: "ingestor.app" From 38273dab1379a9f406921ca96f20edd167f44f34 Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Mon, 9 Jun 2025 16:48:19 -0300 Subject: [PATCH 3/3] Update ingestor_manager.py --- ingestor/managers/ingestor_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ingestor/managers/ingestor_manager.py b/ingestor/managers/ingestor_manager.py index 69aaaaf..2f62710 100644 --- a/ingestor/managers/ingestor_manager.py +++ b/ingestor/managers/ingestor_manager.py @@ -339,7 +339,7 @@ class IngestorManager(): Returns: None """ - + for lease_id in ids: self.resource_manager.drop_tag_lease(lease_id) metrics.SLOTS_RELEASED.labels(pod_id=self.pod_id).inc()