Skip to content

Commit 8115ff6

Browse files
authored
Merge pull request #210 from OP-TED/feature/TED-562
Feature/ted 562
2 parents 0780a49 + b083001 commit 8115ff6

27 files changed

Lines changed: 916 additions & 104 deletions

dags/old_worker_single_notice_process_orchestrator.py

Lines changed: 480 additions & 0 deletions
Large diffs are not rendered by default.

dags/worker_single_notice_process_orchestrator.py

Lines changed: 57 additions & 80 deletions
Large diffs are not rendered by default.

infra/airflow/docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ x-airflow-common:
5757
AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
5858
AIRFLOW__CORE__FERNET_KEY: ''
5959
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
60+
AIRFLOW__CORE__ENABLE_XCOM_PICKLING: "true"
6061
AIRFLOW__CORE__LOAD_EXAMPLES: 'false'
6162
AIRFLOW__API__AUTH_BACKEND: 'airflow.api.auth.backend.basic_auth'
6263
_PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}

infra/sftp/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ services:
88
environment:
99
- SFTP_USER=${SFTP_USER}
1010
- SFTP_PASSWORD=${SFTP_PASSWORD}
11+
- SFTP_PORT=${SFTP_PORT}
1112
command: ${SFTP_USER}:${SFTP_PASSWORD}:::upload
1213
ports:
13-
- ${SFTP_PORT:-2235}:22
14+
- ${SFTP_PORT:-2235}:${SFTP_PORT}
1415
networks:
1516
- sftp-net
1617
- proxy-net

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ agraph-python==101.0.10
2121
decorator~=5.1.1
2222
urllib3[secure]
2323
semantic-version==2.10.0
24+
pysftp
25+

ted_sws/__init__.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,31 @@ def FUSEKI_ADMIN_PASSWORD(self) -> str:
168168
def FUSEKI_ADMIN_HOST(self) -> str:
169169
return EnvConfigResolver().config_resolve()
170170

171+
class SFTPConfig:
172+
@property
173+
def SFTP_HOST(self) -> str:
174+
return EnvConfigResolver().config_resolve()
175+
176+
@property
177+
def SFTP_PORT(self) -> int:
178+
v = EnvConfigResolver().config_resolve()
179+
return int(v) if v is not None else 22
180+
181+
@property
182+
def SFTP_USER(self) -> str:
183+
return EnvConfigResolver().config_resolve()
184+
185+
@property
186+
def SFTP_PASSWORD(self)->str:
187+
return EnvConfigResolver().config_resolve()
188+
189+
@property
190+
def SFTP_PATH(self)->str:
191+
return EnvConfigResolver().config_resolve()
192+
193+
171194
class TedConfigResolver(MongoDBConfig, RMLMapperConfig, XMLProcessorConfig, ELKConfig, LoggingConfig,
172-
GitHubArtefacts, API, AllegroConfig, TedAPIConfig, FusekiConfig):
195+
GitHubArtefacts, API, AllegroConfig, TedAPIConfig, SFTPConfig, FusekiConfig):
173196
"""
174197
This class resolve the secrets of the ted-sws project.
175198
"""

ted_sws/mapping_suite_processor/adapters/github_package_downloader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import subprocess
55
import tempfile
66

7-
GITHUB_TED_SWS_ARTEFACTS_REPOSITORY_NAME = "ted-sws-artefacts"
8-
GITHUB_TED_SWS_ARTEFACTS_MAPPINGS_PATH = "ted-sws-artefacts/mappings"
7+
GITHUB_TED_SWS_ARTEFACTS_REPOSITORY_NAME = "ted-rdf-mapping"
8+
GITHUB_TED_SWS_ARTEFACTS_MAPPINGS_PATH = f"{GITHUB_TED_SWS_ARTEFACTS_REPOSITORY_NAME}/mappings"
99

1010

1111
class MappingSuitePackageDownloaderABC(abc.ABC):
@@ -48,6 +48,7 @@ def get_git_head_hash(git_repository_path: pathlib.Path) -> str:
4848
This function return hash for last commit with git.
4949
:return:
5050
"""
51+
git_repository_path.mkdir(exist_ok=True, parents=True)
5152
result = subprocess.run(f'cd {git_repository_path} && git rev-parse origin/main', shell=True,
5253
stdout=subprocess.PIPE)
5354
git_head_hash = result.stdout.decode(encoding="utf-8")

ted_sws/mapping_suite_processor/services/conceptual_mapping_processor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ def mapping_suite_processor_from_github_expand_and_load_package_in_mongo_db(mapp
6767
:param load_test_data:
6868
:return:
6969
"""
70-
default_github_repository_url = "https://github.com/meaningfy-ws/ted-sws-artefacts.git"
7170
mapping_suite_package_downloader = GitHubMappingSuitePackageDownloader(
72-
github_repository_url=config.GITHUB_TED_SWS_ARTEFACTS_URL or default_github_repository_url)
71+
github_repository_url=config.GITHUB_TED_SWS_ARTEFACTS_URL)
7372
with tempfile.TemporaryDirectory() as tmp_dir:
7473
tmp_dir_path = pathlib.Path(tmp_dir)
7574
git_last_commit_hash = mapping_suite_package_downloader.download(

ted_sws/notice_publisher/__init__.py

Whitespace-only changes.

ted_sws/notice_publisher/adapters/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)