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
#!/usr/bin/env bash | |
set -xe | |
export HELM_TILLER_SILENT=true | |
export HELM_TILLER_HISTORY_MAX=5 | |
NAMESPACE="${MY_KUBERNETES_NAMESPACE:-default}" | |
helm init --client-only |
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
ifeq ($(ENV), local) | |
# if local, then user docker registry of minikube | |
export DOCKER_TLS_VERIFY := $(shell minikube docker-env | grep DOCKER_TLS_VERIFY | cut -d\= -f2 | tr -d \") | |
export DOCKER_HOST := $(shell minikube docker-env | grep DOCKER_HOST | cut -d\= -f2 | tr -d \") | |
export DOCKER_CERT_PATH := $(shell minikube docker-env | grep DOCKER_CERT_PATH | cut -d\= -f2 | tr -d \") | |
export DOCKER_API_VERSION := $(shell minikube docker-env | grep DOCKER_API_VERSION | cut -d\= -f2 | tr -d \") | |
# if local, then user kubernetes context of minikube | |
export MY_CONTEXT := $(shell kubectl config use-context minikube; echo "using minikube context") | |
else | |
# use kubernetes context specified in configuration file |
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
# run deploy phases in sequence | |
deploy: | |
$(MAKE) deploy.infrastructure | |
$(MAKE) deploy.kafka-topics | |
$(MAKE) deploy.pipeline | |
# deploy infrastructure in parallel | |
deploy.infrastructure: \ | |
deploy.kafka-cluster \ | |
deploy.kafka-client |
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
alias parquet-tools="docker run --rm --workdir /data -it -v $(pwd):/data nathanhowell/parquet-tools" | |
### OR | |
grep -qxF "### PARQUETTOOLS BEGIN | |
### PARQUETTOOLS END" ~/.zshrc || echo "\n### PARQUETTOOLS BEGIN\n### PARQUETTOOLS END" >> ~/.zshrc | |
command=''' | |
parquet_tools(){ | |
docker run --rm --workdir /data -it -v $(pwd):/data nathanhowell/parquet-tools "$@" |
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
#!/usr/bin/env python3 | |
import os | |
from kafka import KafkaConsumer | |
from kafka import KafkaProducer | |
# Access all environment variables | |
print('*----------------------------------*') | |
print(os.environ) | |
print('*----------------------------------*') |
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
# ./conf/log4j.properties | |
[...] | |
# Set everything to be logged to the console | |
log4j.rootCategory=INFO, console | |
log4j.appender.console=org.apache.log4j.ConsoleAppender | |
log4j.appender.console.target=System.err | |
log4j.appender.console.layout=org.apache.log4j.PatternLayout | |
log4j.appender.console.layout.ConversionPattern=%d{ISO8601} - %c{1} - %p - %m%n | |
[...] |
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
######################### | |
# logging.conf | |
######################### | |
[loggers] | |
keys=root,sampleLogger | |
[handlers] | |
keys=consoleHandler |
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
pyenv install 3.8.1 | |
pyenv virtualenv 3.8.1 spark3 | |
pyenv shell spark3 | |
pip install pyspark | |
MY_PYSPARK_LOCATION=$(pip show pyspark | grep -e "Location" | cut -d ' ' -f 2) | |
# /home/marleu/.pyenv/versions/3.8.1/envs/spark3/lib/python3.8/site-packages | |
MY_PYSPARK_NAME=$(pip show pyspark | grep -e "Name" | cut -d ' ' -f 2) | |
# pyspark |
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
alias jupyter-lab='docker run -it --rm -p 8888:8888 -v "$HOME":/home/jovyan/ --user $(id -u):$(id -g) --group-add users --group-add root -e JUPYTER_ENABLE_LAB=yes jupyter/all-spark-notebook' |
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
conda create -n py36-test python=3.6 | |
source activate py36-test | |
python -m ipykernel install --name py36-test | |
source deactivate |