All Projects → qubole → Afctl

qubole / Afctl

Licence: apache-2.0
afctl helps to manage and deploy Apache Airflow projects faster and smoother.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Afctl

Supervizer
NodeJS Application Manager
Stars: ✭ 278 (+139.66%)
Mutual labels:  management, cli
Crowbar
Cloud Operations Platform
Stars: ✭ 760 (+555.17%)
Mutual labels:  cli, deployment
Docker Airflow
Docker Apache Airflow
Stars: ✭ 3,375 (+2809.48%)
Mutual labels:  management, airflow
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (+62.07%)
Mutual labels:  cli, deployment
Branchsite
CLI tool for publishing your static website to a separate branch
Stars: ✭ 65 (-43.97%)
Mutual labels:  cli, deployment
Cloud-PAW-Management
Simplify PAW and SPA for the masses, unify the MS Internal, and public PAW specs, and expedite deployment to ~5min or less.
Stars: ✭ 45 (-61.21%)
Mutual labels:  deployment, management
Carvel Kapp
kapp is a simple deployment tool focused on the concept of "Kubernetes application" — a set of resources with the same label
Stars: ✭ 489 (+321.55%)
Mutual labels:  cli, deployment
Nanobox
The ideal platform for developers
Stars: ✭ 1,530 (+1218.97%)
Mutual labels:  cli, deployment
Gita
Manage many git repos with sanity 从容管理多个git库
Stars: ✭ 865 (+645.69%)
Mutual labels:  management, cli
Auto Cpufreq
Automatic CPU speed & power optimizer for Linux
Stars: ✭ 843 (+626.72%)
Mutual labels:  management, cli
Mbt
The most flexible build tool for monorepo
Stars: ✭ 184 (+58.62%)
Mutual labels:  cli, deployment
Torchlambda
Lightweight tool to deploy PyTorch models to AWS Lambda
Stars: ✭ 83 (-28.45%)
Mutual labels:  cli, deployment
Procsd
Manage your application processes in production hassle-free like Heroku CLI with Procfile and Systemd
Stars: ✭ 181 (+56.03%)
Mutual labels:  cli, deployment
Tomo
A friendly CLI for deploying Rails apps ✨
Stars: ✭ 260 (+124.14%)
Mutual labels:  cli, deployment
Linuxdeploy Cli
Linux Deploy CLI
Stars: ✭ 127 (+9.48%)
Mutual labels:  cli, deployment
Meteor Now
Instantly deploy your Meteor apps with `meteor-now`
Stars: ✭ 339 (+192.24%)
Mutual labels:  cli, deployment
Fluddy
🤝 A dependency-free command line utility for managing, updating, creating and launching Flask Apps.
Stars: ✭ 23 (-80.17%)
Mutual labels:  management, cli
The forge
Our groundbreaking, lightning fast PWA CLI tool
Stars: ✭ 70 (-39.66%)
Mutual labels:  cli, deployment
Ezmomi
cli tool for common VMware vSphere tasks
Stars: ✭ 112 (-3.45%)
Mutual labels:  management, deployment
Gkeep
Google Keep Command Line Interface (CLI)
Stars: ✭ 114 (-1.72%)
Mutual labels:  cli

afctl

The proposed CLI tool is authored to make creating and deployment of Apache Airflow (https://airflow.apache.org/) projects faster and smoother. As of now, there is no tool out there that can empower the user to create a boilerplate code structure for airflow projects and make development + deployment of projects seamless.

Requirements

  • Python 3.5+
  • Docker

Getting Started

1. Installation

Create a new python virtualenv. You can use the following command.

python3 -m venv <name>

Activate your virtualenv

source /path_to_venv/bin/activate
pip3 install afctl

2. Initialize a new afctl project.

The project is created in your present working directory. Along with this a configuration file with the same name is generated in /home/.afctl_configs directory.

afctl init <name of the project>

Eg.

afctl init project_demo
  • The following directory structure will be generated
.
├── deployments
│   └── project_demo-docker-compose.yml
├── migrations
├── plugins
├── project_demo
│   ├── commons
│   └── dags
├── requirements.txt
└── tests

If you already have a git repository and want to turn it into an afctl project. Run the following command :-

afctl init .

3. Add a new module in the project.

afctl generate module -n <name of the module>

The following directory structure will be generated :

afctl generate module -n first_module
afctl generate module -n second_module

.
├── deployments
│   └── project_demo-docker-compose.yml
├── migrations
├── plugins
├── project_demo
│   ├── commons
│   └── dags
│       ├── first_module
│       └── second_module
├── requirements.txt
└── tests
    ├── first_module
    └── second_module

4. Generate dag

afctl generate dag -n <name of dag> -m <name of module>

The following directory structure will be generate :

afctl generate dag -n new -m first_module

.
├── deployments
│   └── project_demo-docker-compose.yml
├── migrations
├── plugins
├── project_demo
│   ├── commons
│   └── dags
│       ├── first_module
│       │   └── new_dag.py
│       └── second_module
├── requirements.txt
└── tests
    ├── first_module
    └── second_module

The dag file will look like this :

from airflow import DAG
from datetime import datetime, timedelta

default_args = {
'owner': 'project_demo',
# 'depends_on_past': ,
# 'start_date': ,
# 'email': ,
# 'email_on_failure': ,
# 'email_on_retry': ,
# 'retries': 0

}

dag = DAG(dag_id='new', default_args=default_args, schedule_interval='@once')

5. Deploy project locally

You can add python packages that will be required by your dags in requirements.txt. They will automatically get installed.

  • To deploy your project, run the following command (make sure docker is running) :
afctl deploy local

If you do not want to see the logs, you can run

afctl deploy local -d

This will run it in detached mode and won't print the logs on the console.

  • You can access your airflow webserver on browser at localhost:8080

6. Deploy project on production

  • Here we will be deploying our project to Qubole. Sign up at us.qubole.com.
  • add git-origin and access-token (if want to keep the project as private repo on Github) to the configs. See how
  • Push the project once completed to Github.
  • Deploying to Qubole will require adding deployment configurations.
afctl config add -d qubole -n <name of deployment> -e <env> -c <cluster-label> -t <auth-token>

This command will modify your config file. You can see your config file with the following command :

afctl config show

For example -

afctl config add -d qubole -n demo -e https://api.qubole.com -c airflow_1102 -t khd34djs3
  • To deploy run the following command
afctl deploy qubole -n <name>

The following video also contains all the steps of deploying project using afctl -

https://www.youtube.com/watch?v=A4rcZDGtJME&feature=youtu.be

Manage configurations

The configuration file is used for deployment contains the following information.

global:
-airflow_version:
-git:
--origin:
--access-token:
deployment:
-qubole:
--local:
---compose:

  • airflow_version can be added to the project when you initialize the project.
afctl init <name> -v <version>
  • global configs (airflow_version, origin, access-token) can all be added/ updated with the following command :
afctl config global -o <git-origin> -t <access-token> -v <airflow_version>

Usage

Commands right now supported are

  • init
  • config
  • deploy
  • list
  • generate

To learn more, run

afctl <command> -h

Caution

Not yet ported for Windows.

Credits

Docker-compose file : https://github.com/puckel/docker-airflow

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].