- Active the virtual env with
python3 -m venv venv && source ./venv/bin/activate
(Recommended!) - Install depedencies with
pip install -r requirements.txt
- Create Google Service Account then name it
service-account.json
. Follow the guide here to create one
To run the ELT script, use:
python ingestion.py --type elt --to demo_pipeline_project.vix_stocks --service-account service-account.json
To run the ETL script, use:
python ingestion.py --type etl --to demo_pipeline_project.employees --service-account service-account.json
- Copy the
cron.sh
contents. - Type
crontab -e
on your terminal, then paste the content from no.1 there.
See Crontab Guru to help you on write the proper cron syntax - Save the file.
- Build the image by
docker build -t <IMAGE_NAME>:<TAG> .
- Run the container with
docker run --rm <IMAGE_NAME>:<TAG> --type {elt|etl} --to <DATASET_NAME>.<TABLE_NAME> --service-account service-account.json
- Wait until the program run successfully