This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [ -e "/opt/airflow/requirements.txt" ]; then | |
$(command -v pip) install --user -r requirements.txt | |
fi | |
# Initialize the database if it hasn't been initialized yet | |
if [ ! -f "/opt/airflow/airflow.db" ]; then | |
airflow db init && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
webserver: | |
image: apache/airflow:2.6.0-python3.9 | |
command: webserver | |
entrypoint: [ "/opt/airflow/script/entrypoint.sh" ] | |
# restart: always | |
depends_on: | |
- postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
from datetime import datetime | |
from airflow import DAG | |
from airflow.operators.python import PythonOperator | |
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
from pipelines.wikipedia_pipeline import extract_wikipedia_data, transform_wikipedia_data, write_wikipedia_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aiohttp==3.8.5 | |
aiosignal==1.3.1 | |
alembic==1.11.3 | |
anyio==3.7.1 | |
apache-airflow==2.7.0 | |
apache-airflow-providers-common-sql==1.7.1 | |
apache-airflow-providers-ftp==3.5.1 | |
apache-airflow-providers-http==4.5.1 | |
apache-airflow-providers-imap==3.3.1 | |
apache-airflow-providers-sqlite==3.4.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from datetime import datetime | |
from cassandra.auth import PlainTextAuthProvider | |
from cassandra.cluster import Cluster | |
from pyspark.sql import SparkSession | |
from pyspark.sql.functions import from_json, col | |
from pyspark.sql.types import StructField, StringType, IntegerType, StructType | |
default_args = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [ -e "/opt/airflow/requirements.txt" ]; then | |
$(command -v pip) install --user -r requirements.txt | |
fi | |
# Initialize the database if it hasn't been initialized yet | |
if [ ! -f "/opt/airflow/airflow.db" ]; then | |
airflow db init && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from airflow import DAG | |
from airflow.operators.python import PythonOperator | |
default_args = { | |
'owner': 'airflow', | |
'start_date': datetime(2023, 8, 30, 10, 00), | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:7.4.0 | |
hostname: zookeeper | |
container_name: zookeeper | |
ports: | |
- "2181:2181" | |
environment: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RedisCacheModule } from './redis-cache/redis-cache.module'; | |
import { Module } from '@nestjs/common'; | |
import { AppController } from './app.controller'; | |
import { AppService } from './app.service'; | |
import { TodoModule } from './todo/todo.module'; | |
@Module({ | |
imports: [TodoModule, RedisCacheModule], | |
controllers: [AppController], | |
providers: [AppService], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Module } from '@nestjs/common'; | |
import { TodoService } from './todo.service'; | |
import { TodoController } from './todo.controller'; | |
@Module({ | |
imports: [], | |
controllers: [TodoController], | |
providers: [TodoService], | |
}) | |
export class TodoModule {} |
NewerOlder