Skip to content

Commit 35e5a97

Browse files
authored
IEBH-452: Sync with the latest changes (#7)
1 parent e20f984 commit 35e5a97

File tree

9 files changed

+100
-152
lines changed

9 files changed

+100
-152
lines changed

.env.example

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
# is sensitive/secret
2-
VAULT_TOKEN=
3-
41
# contains defaults but can be overriden
5-
CONFIG_CENTER_ENABLED=false
6-
VAULT_URL=
7-
VAULT_CRT=
8-
92
METADATA_SERVICE=http://metadata.utility:5066
103
DATAOPS_SERVICE=http://dataops.utility:5063
114

.github/workflows/hdc-pipeline.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: HDC ci/cd pipeline
2+
3+
permissions:
4+
contents: write
5+
issues: write
6+
pull-requests: write
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
pull_request:
13+
branches:
14+
- main
15+
16+
jobs:
17+
run_tests_hdc:
18+
uses: PilotDataPlatform/pilot-hdc-ci-tools/.github/workflows/run_tests.yml@main
19+
with:
20+
min_coverage_percent: 76
21+
coverage_target: pipelinewatch
22+
secrets: inherit
23+
24+
build_and_publish_hdc:
25+
needs: [run_tests_hdc]
26+
uses: PilotDataPlatform/pilot-hdc-ci-tools/.github/workflows/build_and_publish.yml@main
27+
with:
28+
matrix_config: '["pipelinewatch"]'
29+
service_name: 'pipelinewatch'
30+
secrets: inherit
31+
32+
deploy_hdc:
33+
needs: [build_and_publish_hdc]
34+
uses: PilotDataPlatform/pilot-hdc-ci-tools/.github/workflows/trigger_deployment.yml@main
35+
with:
36+
hdc_service_name: 'pipelinewatch'
37+
secrets: inherit

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ipython_config.py
8585
# pyenv
8686
# For a library or package, you might want to ignore these files since the code is
8787
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
88+
.python-version
8989

9090
# pipenv
9191
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ repos:
6767
'--max-line-length=120',
6868
]
6969

70-
# - repo: https://github.com/PyCQA/docformatter
71-
# rev: v1.7.5
72-
# hooks:
73-
# - id: docformatter
74-
# args: [
75-
# '--wrap-summaries=120',
76-
# '--wrap-descriptions=120',
77-
# '--in-place',
78-
# ]
70+
- repo: https://github.com/PyCQA/docformatter
71+
rev: 06907d0
72+
hooks:
73+
- id: docformatter
74+
args: [
75+
'--wrap-summaries=120',
76+
'--wrap-descriptions=120',
77+
'--in-place',
78+
]
7979

8080
- repo: https://github.com/Lucas-C/pre-commit-hooks
8181
rev: v1.5.5

Jenkinsfile

Lines changed: 0 additions & 70 deletions
This file was deleted.

config.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,11 @@
66

77
import logging
88
from functools import lru_cache
9-
from typing import Any
10-
from typing import Dict
11-
from typing import Optional
129

13-
from common import VaultClient
1410
from pydantic import BaseSettings
1511
from pydantic import Extra
1612

1713

18-
class VaultConfig(BaseSettings):
19-
"""Store vault related configuration."""
20-
21-
APP_NAME: str = 'pipelinewatch'
22-
CONFIG_CENTER_ENABLED: bool = False
23-
24-
VAULT_URL: Optional[str]
25-
VAULT_CRT: Optional[str]
26-
VAULT_TOKEN: Optional[str]
27-
28-
class Config:
29-
env_file = '.env'
30-
env_file_encoding = 'utf-8'
31-
32-
33-
def load_vault_settings(settings: BaseSettings) -> Dict[str, Any]:
34-
config = VaultConfig()
35-
36-
if not config.CONFIG_CENTER_ENABLED:
37-
return {}
38-
39-
client = VaultClient(config.VAULT_URL, config.VAULT_CRT, config.VAULT_TOKEN)
40-
return client.get_from_vault(config.APP_NAME)
41-
42-
4314
class Settings(BaseSettings):
4415
"""Store service configuration settings."""
4516

@@ -59,10 +30,6 @@ class Config:
5930
env_file_encoding = 'utf-8'
6031
extra = Extra.allow
6132

62-
@classmethod
63-
def customise_sources(cls, init_settings, env_settings, file_secret_settings):
64-
return env_settings, init_settings, load_vault_settings, file_secret_settings
65-
6633

6734
@lru_cache(1)
6835
def get_settings():

pipelinewatch/stream_watcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# Version 3.0 (the "License") available at https://www.gnu.org/licenses/agpl-3.0.en.html.
55
# You may not use this file except in compliance with the License.
66

7+
from collections.abc import Generator
78
from enum import Enum
89
from enum import unique
9-
from typing import Generator
1010

1111
from kubernetes import watch
1212
from kubernetes.client import BatchV1Api

poetry.lock

Lines changed: 50 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pipelinewatch"
3-
version = "2.2.4"
3+
version = "2.2.7"
44
description = ""
55
authors = ["Indoc Research"]
66

@@ -9,7 +9,7 @@ python = "^3.7"
99
pilot-platform-common = "0.3.0"
1010
kubernetes = "11.0.0"
1111
requests = "2.24.0"
12-
pydantic = "1.8.2"
12+
pydantic = "1.10.19"
1313

1414
[tool.poetry.dev-dependencies]
1515
pytest = "7.1.1"

0 commit comments

Comments
 (0)