Skip to content

Instantly share code, notes, and snippets.

View airscholar's full-sized avatar
💭
Do hard things!

Yusuf Ganiyu airscholar

💭
Do hard things!
View GitHub Profile
#!/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 && \
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
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
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
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 = {
#!/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 && \
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),
}
@airscholar
airscholar / docker-compose.yml
Last active September 1, 2023 15:21
Data Engineering
version: '3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.4.0
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
environment:
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],
import { Module } from '@nestjs/common';
import { TodoService } from './todo.service';
import { TodoController } from './todo.controller';
@Module({
imports: [],
controllers: [TodoController],
providers: [TodoService],
})
export class TodoModule {}