-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (25 loc) · 935 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import functions_framework
import settings
from extractions import docked_ships_extract, operations_extract
from transformations import docked_ships_transform, operations_transform
DATALAKE_PATH = 'gcs://harbor-datalake'
def dockedShipsPipeline():
rawPath = DATALAKE_PATH + '/raw/docked_ships'
trustedPath = DATALAKE_PATH + '/trusted/docked_ships'
savedRawFile = docked_ships_extract.run(rawPath)
docked_ships_transform.run(savedRawFile,trustedPath)
def operationsPipeline():
rawPath = DATALAKE_PATH + '/raw/operations'
trustedPath = DATALAKE_PATH + '/trusted/operations'
savedRawFile = operations_extract.run(rawPath)
operations_transform.run(savedRawFile,trustedPath)
def runPipeline():
settings.init()
dockedShipsPipeline()
operationsPipeline()
@functions_framework.http
def cloudEntrypoint(request):
runPipeline()
return 'OK'
if __name__ == '__main__':
runPipeline()