Skip to content

Commit 99dd0b2

Browse files
Merge branch 'main' into feature/TED-545
2 parents ea06e82 + b6ff729 commit 99dd0b2

148 files changed

Lines changed: 930 additions & 511 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
run: |
2424
python -m pip install --upgrade setuptools pip wheel
2525
make install
26+
make install-dev
2627
- name: Make envfile
2728
uses: SpicyPizza/create-envfile@v1
2829
with:

Makefile

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ test-unit:
3737

3838
test-features:
3939
@ echo -e "$(BUILD_PRINT)Gherkin Features Testing ...$(END_BUILD_PRINT)"
40-
@ tox -e features
40+
# @ tox -e features
4141

4242
test-e2e:
4343
@ echo -e "$(BUILD_PRINT)End to End Testing ...$(END_BUILD_PRINT)"
@@ -113,6 +113,24 @@ stop-allegro-graph:
113113
@ echo -e "$(BUILD_PRINT)Stopping Allegro-Graph services $(END_BUILD_PRINT)"
114114
@ docker-compose -p ${ENVIRONMENT} --file ./infra/allegro-graph/docker-compose.yml --env-file ${ENV_FILE} down
115115

116+
# ------------------------
117+
start-fuseki: build-externals
118+
@ echo -e "$(BUILD_PRINT)Starting Fuseki services $(END_BUILD_PRINT)"
119+
@ docker-compose -p ${ENVIRONMENT} --file ./infra/fuseki/docker-compose.yml --env-file ${ENV_FILE} up -d
120+
121+
stop-fuseki:
122+
@ echo -e "$(BUILD_PRINT)Stopping Fuseki services $(END_BUILD_PRINT)"
123+
@ docker-compose -p ${ENVIRONMENT} --file ./infra/fuseki/docker-compose.yml --env-file ${ENV_FILE} down
124+
125+
# ------------------------
126+
start-sftp: build-externals
127+
@ echo -e "$(BUILD_PRINT)Starting SFTP services $(END_BUILD_PRINT)"
128+
@ docker-compose -p ${ENVIRONMENT} --file ./infra/sftp/docker-compose.yml --env-file ${ENV_FILE} up -d
129+
130+
stop-sftp:
131+
@ echo -e "$(BUILD_PRINT)Stopping SFTP services $(END_BUILD_PRINT)"
132+
@ docker-compose -p ${ENVIRONMENT} --file ./infra/sftp/docker-compose.yml --env-file ${ENV_FILE} down
133+
116134
# ------------------------
117135
build-elasticsearch: build-externals
118136
@ echo -e "$(BUILD_PRINT) Build Elasticsearch services $(END_BUILD_PRINT)"
@@ -283,23 +301,23 @@ refresh-mapping-files:
283301
#-----------------------------------------------------------------------------
284302
# API Service commands
285303
#-----------------------------------------------------------------------------
286-
build-all-apis: build-id_manager-api
304+
build-all-apis: build-digest_service-api
287305

288-
start-all-apis: start-id_manager-api
306+
start-all-apis: start-digest_service-api
289307

290-
stop-all-apis: stop-id_manager-api
308+
stop-all-apis: stop-digest_service-api
291309

292-
build-id_manager-api:
293-
@ echo -e "$(BUILD_PRINT) Build id_manager API service $(END_BUILD_PRINT)"
310+
build-digest_service-api:
311+
@ echo -e "$(BUILD_PRINT) Build digest_service API service $(END_BUILD_PRINT)"
294312
@ docker-compose -p common --file infra/api/docker-compose.yml --env-file ${ENV_FILE} build --no-cache --force-rm
295313
@ docker-compose -p common --file infra/api/docker-compose.yml --env-file ${ENV_FILE} up -d --force-recreate
296314

297-
start-id_manager-api:
298-
@ echo -e "$(BUILD_PRINT)Starting id_manager API service $(END_BUILD_PRINT)"
315+
start-digest_service-api:
316+
@ echo -e "$(BUILD_PRINT)Starting digest_service API service $(END_BUILD_PRINT)"
299317
@ docker-compose -p common --file infra/api/docker-compose.yml --env-file ${ENV_FILE} up -d
300318

301-
stop-id_manager-api:
302-
@ echo -e "$(BUILD_PRINT)Stopping id_manager API service $(END_BUILD_PRINT)"
319+
stop-digest_service-api:
320+
@ echo -e "$(BUILD_PRINT)Stopping digest_service API service $(END_BUILD_PRINT)"
303321
@ docker-compose -p common --file infra/api/docker-compose.yml --env-file ${ENV_FILE} down
304322

305323

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,21 +412,21 @@ Options:
412412
##### Start local API server
413413
To start the API server:
414414
```bash
415-
api-id_manager-start-server
415+
api-digest_service-start-server
416416
```
417417
Output:
418418
```bash
419-
uvicorn --host localhost --port 8000 ted_sws.id_manager.entrypoints.api.main:app --reload
419+
uvicorn --host localhost --port 8000 ted_sws.notice_transformer.entrypoints.api.digest_service.main:app --reload
420420
###
421421
See http://localhost:8000/api/v1/docs for API usage.
422422
```
423423
Use:
424424
```bash
425-
api-id_manager-start-server --help
425+
api-digest_service-start-server --help
426426
```
427427
to get the cli command Usage Help:
428428
```bash
429-
Usage: api-id_manager-start-server [OPTIONS]
429+
Usage: api-digest_service-start-server [OPTIONS]
430430

431431
Options:
432432
-h, --host TEXT

dags/index_and_normalise_notice_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from ted_sws.event_manager.model.event_message import NoticeEventMessage
1313
from ted_sws.event_manager.services.logger_from_context import get_logger_from_dag_context, \
1414
handle_event_message_metadata_dag_context
15-
from ted_sws.metadata_normaliser.services.metadata_normalizer import normalise_notice_by_id
15+
from ted_sws.notice_metadata_processor.services.metadata_normalizer import normalise_notice_by_id
1616

1717
NOTICE_ID = "notice_id"
1818

dags/selector_daily_fetch_orchestrator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616
EventMessageProcessType
1717
from ted_sws.notice_fetcher.adapters.ted_api import TedAPIAdapter, TedRequestAPI
1818
from ted_sws.notice_fetcher.services.notice_fetcher import NoticeFetcher
19+
from ted_sws.supra_notice_manager.services.daily_supra_notice_manager import \
20+
create_and_store_in_mongo_db_daily_supra_notice
1921

2022
DAG_NAME = "selector_daily_fetch_orchestrator"
2123
WILD_CARD_PARAM = "wild_card"
2224

25+
2326
@dag(default_args=DEFAULT_DAG_ARGUMENTS,
2427
catchup=False,
2528
schedule_interval="0 3 * * *",
@@ -41,8 +44,10 @@ def fetch_notice_from_ted():
4144
current_datetime_wildcard = (datetime.datetime.now() - datetime.timedelta(days=1)).strftime("%Y%m%d*")
4245
mongodb_client = MongoClient(config.MONGO_DB_AUTH_URL)
4346
notice_ids = NoticeFetcher(notice_repository=NoticeRepository(mongodb_client=mongodb_client),
44-
ted_api_adapter=TedAPIAdapter(request_api=TedRequestAPI())).fetch_notices_by_date_wild_card(
47+
ted_api_adapter=TedAPIAdapter(
48+
request_api=TedRequestAPI())).fetch_notices_by_date_wild_card(
4549
wildcard_date=current_datetime_wildcard)
50+
create_and_store_in_mongo_db_daily_supra_notice(notice_ids=notice_ids, mongodb_client=mongodb_client)
4651
return notice_ids
4752

4853
@task

dags/worker_single_notice_process_orchestrator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
from ted_sws.core.model.notice import NoticeStatus
88
from ted_sws.data_manager.adapters.mapping_suite_repository import MappingSuiteRepositoryMongoDB
99
from ted_sws.data_manager.adapters.notice_repository import NoticeRepository
10-
from ted_sws.data_sampler.services.notice_xml_indexer import index_notice, index_notice_by_id
11-
from ted_sws.metadata_normaliser.services.metadata_normalizer import normalise_notice_by_id
10+
from ted_sws.data_sampler.services.notice_xml_indexer import index_notice_by_id
11+
from ted_sws.notice_metadata_processor.services.metadata_normalizer import normalise_notice_by_id
1212

1313
from airflow.decorators import dag
1414
from airflow.operators.python import get_current_context, BranchPythonOperator, PythonOperator
1515

1616
from dags import DEFAULT_DAG_ARGUMENTS
17-
from ted_sws.notice_eligibility.services.notice_eligibility import notice_eligibility_checker_by_id
17+
from ted_sws.notice_metadata_processor.services.notice_eligibility import notice_eligibility_checker_by_id
1818
from ted_sws.notice_packager.services.notice_packager import create_notice_package
1919
from ted_sws.notice_transformer.adapters.rml_mapper import RMLMapper
2020
from ted_sws.notice_transformer.services.notice_transformer import transform_notice_by_id
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ RUN pip install --upgrade pip
88
RUN pip install -r requirements.txt
99
RUN pip install -r infra/api/requirements.txt
1010

11-
ENTRYPOINT uvicorn --host 0.0.0.0 --port ${ID_MANAGER_API_PORT} ted_sws.id_manager.entrypoints.api.main:app
11+
ENTRYPOINT uvicorn --host 0.0.0.0 --port ${ID_MANAGER_API_PORT} ted_sws.notice_transformer.entrypoints.api.digest_service.main:app

infra/api/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ version: '3.8'
22

33
services:
44
api-id_manager:
5-
container_name: api-id_manager
5+
container_name: api-digest_service
66
build:
77
context: ../..
8-
dockerfile: ./infra/api/id_manager/Dockerfile
8+
dockerfile: ./infra/api/digest_service/Dockerfile
99
env_file: ../../.env
1010
networks:
1111
- proxy-net

infra/fuseki/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM secoresearch/fuseki:4.5.0
2+
3+
USER root
4+
RUN apt-get update; \
5+
apt-get install -y --no-install-recommends procps

infra/fuseki/docker-compose.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: '3'
2+
services:
3+
fuseki:
4+
container_name: fuseki
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
environment:
9+
- ADMIN_PASSWORD=${FUSEKI_ADMIN_PASSWORD}
10+
- FUSEKI_DATASET_1=mydataset
11+
volumes:
12+
- fuseki-data:/fuseki-data/databases
13+
networks:
14+
- fuseki-net
15+
- proxy-net
16+
labels:
17+
#### Labels define the behavior and rules of the traefik proxy for this container ####
18+
- "traefik.enable=true" # <== Enable traefik to proxy this container
19+
- "traefik.http.routers.${ENVIRONMENT}-fuseki.rule=Host(`fuseki.${SUBDOMAIN}${DOMAIN}`)" # <== Your Domain Name goes here for the http rule
20+
- "traefik.http.routers.${ENVIRONMENT}-fuseki.entrypoints=web" # <== Defining the entrypoint for http, **ref: line 30
21+
- "traefik.http.routers.${ENVIRONMENT}-fuseki.middlewares=redirect@file" # <== This is a middleware to redirect to https
22+
- "traefik.http.routers.${ENVIRONMENT}-fuseki-secured.rule=Host(`fuseki.${SUBDOMAIN}${DOMAIN}`)" # <== Your Domain Name for the https rule
23+
- "traefik.http.routers.${ENVIRONMENT}-fuseki-secured.entrypoints=web-secured" # <== Defining entrypoint for https, **ref: line 31
24+
- "traefik.http.routers.${ENVIRONMENT}-fuseki-secured.tls.certresolver=mytlschallenge" # <== Defining certsresolvers for https
25+
volumes:
26+
fuseki-data:
27+
28+
networks:
29+
fuseki-net:
30+
internal: true
31+
name: fuseki-net-${ENVIRONMENT}
32+
proxy-net:
33+
external:
34+
name: proxy-net
35+
common-ext:
36+
external:
37+
name: common-ext-${ENVIRONMENT}

0 commit comments

Comments
 (0)