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
readinessProbe: | |
exec: | |
command: | |
- python | |
- check_integrity.py | |
initialDelaySeconds: 60 | |
periodSeconds: 900 | |
timeoutSeconds: 10 | |
successThreshold: 1 | |
failureThreshold: 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 hashlib | |
import sys | |
from module import download_model_locally | |
def check_model_md5(model_name, api_production_artifact_md5): | |
"""Ref: https://stackoverflow.com/a/21565932/""" | |
"""This function will download the model """ | |
download_model_locally_to(model_name) | |
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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
labels: | |
test: liveness-ml-application | |
name: liveness-ml-application | |
spec: | |
containers: | |
- name: ml_application | |
image: internal_registry/ml_application |
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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
labels: | |
test: liveness-ml-application | |
name: liveness-ml-application | |
spec: | |
containers: | |
- name: ml_application | |
image: internal_registry/ml_application |
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
docker build -f dags/docker_job/Dockerfile -t docker_image_task . && \ | |
docker-compose up -d |
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
docker-compose up airflow-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, timedelta | |
from airflow import DAG | |
from airflow.operators.bash_operator import BashOperator | |
from airflow.operators.docker_operator import DockerOperator | |
from airflow.operators.python_operator import BranchPythonOperator | |
from airflow.operators.dummy_operator import DummyOperator | |
default_args = { | |
'owner' : 'airflow', | |
'description' : 'Use of the DockerOperator', |
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, timedelta | |
from airflow import DAG | |
from airflow.operators.bash_operator import BashOperator | |
from airflow.operators.docker_operator import DockerOperator | |
from airflow.operators.python_operator import BranchPythonOperator | |
from airflow.operators.dummy_operator import DummyOperator | |
default_args = { | |
'owner' : 'airflow', | |
'description' : 'Use of the DockerOperator', |
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 pandas as pd | |
import fasttext | |
df = pd.read_csv('B2W-Reviews01.csv', sep=';') | |
df['label'] = '__label__' + df['site_category_lv1'] | |
df = df.sample(n=10000) | |
df[['label', 'review_text']].to_csv('gfjakhsdgkfjhgsd.txt', index=None, header=None) |
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
[core] | |
# The folder where your airflow pipelines live, most likely a | |
# subfolder in a code repository | |
# This path must be absolute | |
dags_folder = /usr/local/airflow/dags | |
# The folder where airflow should store its log files | |
# This path must be absolute | |
base_log_folder = /usr/local/airflow/logs |