• Stars
    star
    335
  • Rank 125,904 (Top 3 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A plugin for Apache Airflow that allows you to edit DAGs in browser

Airflow Code Editor Plugin

A plugin for Apache Airflow that allows you to edit DAGs in browser. It provides a file managing interface within specified directories and it can be used to edit, upload, and download your files. If git support is enabled, the DAGs are stored in a Git repository. You may use it to view Git history, review local changes and commit.

Build Status PyPI version PyPI Downloads Code style: black

System Requirements

  • Airflow Versions
    • 1.10.3 or newer
  • git Versions (git is not required if git support is disabled)
    • 2.0 or newer

Screenshots

File Manager

File Manager

Editor

Editor

Git History

Git History - Tags

Git Workspace

Git Workspace

Install Instructions

Docker Images

For the ease of deployment, use the production-ready reference container image. The image is based on the reference images for Apache Airflow.

You can find the following images there:

  • andreax79/airflow-code-editor:latest - the latest released Airflow Code Editor image with the latest Apache Airflow version
  • andreax79/airflow-code-editor:2.5.1 - the latest released Airflow Code Editor with specific Airflow version
  • andreax79/airflow-code-editor:2.5.1-2.7.1 - specific version of Airflow and Airflow Code Editor

Installing from PyPI

  1. Install the plugin
  pip install airflow-code-editor
  1. Install optional dependencies
  1. Restart the Airflow Web Server

  2. Open Admin - DAGs Code Editor

Config Options

You can set options editing the Airflow's configuration file or setting environment variables. You can edit your airflow.cfg adding any of the following settings in the [code_editor] section. All the settings are optional.

  • enabled enable this plugin (default: True).
  • git_enabled enable git support (default: True). If git is not installed, disable this option.
  • git_cmd git command (path)
  • git_default_args git arguments added to each call (default: -c color.ui=true)
  • git_author_name human-readable name in the author/committer (default logged user first and last names)
  • git_author_email email for the author/committer (default: logged user email)
  • git_init_repo initialize a git repo in DAGs folder (default: True)
  • root_directory root folder (default: Airflow DAGs folder)
  • line_length Python code formatter - max line length (default: 88)
  • string_normalization Python code formatter - if true normalize string quotes and prefixes (default: False)
  • mount, mount1, ... configure additional folder (mount point) - format: name=xxx,path=yyy
  • ignored_entries comma-separated list of entries to be excluded from file/directory list (default: .*,__pycache__)
   [code_editor]
   enabled = True
   git_enabled = True
   git_cmd = /usr/bin/git
   git_default_args = -c color.ui=true
   git_init_repo = False
   root_directory = /home/airflow/dags
   line_length = 88
   string_normalization = False
   mount = name=data,path=/home/airflow/data
   mount1 = name=logs,path=/home/airflow/logs
   mount2 = name=data,path=s3://example

Mount Options:

Example:

  • name=ftp_server,path=ftp://user:[email protected]/private
  • name=data,path=s3://example
  • name=tmp,path=/tmp

You can also set options with the following environment variables:

  • AIRFLOW__CODE_EDITOR__ENABLED
  • AIRFLOW__CODE_EDITOR__GIT_ENABLED
  • AIRFLOW__CODE_EDITOR__GIT_CMD
  • AIRFLOW__CODE_EDITOR__GIT_DEFAULT_ARGS
  • AIRFLOW__CODE_EDITOR__GIT_AUTHOR_NAME
  • AIRFLOW__CODE_EDITOR__GIT_AUTHOR_EMAIL
  • AIRFLOW__CODE_EDITOR__GIT_INIT_REPO
  • AIRFLOW__CODE_EDITOR__ROOT_DIRECTORY
  • AIRFLOW__CODE_EDITOR__LINE_LENGTH
  • AIRFLOW__CODE_EDITOR__STRING_NORMALIZATION
  • AIRFLOW__CODE_EDITOR__MOUNT, AIRFLOW__CODE_EDITOR__MOUNT1, AIRFLOW__CODE_EDITOR__MOUNT2, ...
  • AIRFLOW__CODE_EDITOR__IGNORED_ENTRIES

Example:

   export AIRFLOW__CODE_EDITOR__STRING_NORMALIZATION=True
   export AIRFLOW__CODE_EDITOR__MOUNT='name=data,path=/home/airflow/data'
   export AIRFLOW__CODE_EDITOR__MOUNT1='name=logs,path=/home/airflow/logs'
   export AIRFLOW__CODE_EDITOR__MOUNT2='name=tmp,path=/tmp'

Development Instructions

  1. Fork the repo

  2. Clone it on the local machine

  git clone https://github.com/andreax79/airflow-code-editor.git
  cd airflow-code-editor
  1. Create and activate virtualenv
  source ./scripts/activate.sh
  1. Switch node version
  nvm use
  1. Make changes you need. Build npm package with:
  make npm-build
  1. You can start Airflow webserver or scheduler with these commands:
  make standalone
  1. Run tests
  make test
  1. Commit and push changes
  git add .
  git commit
  git push
  1. Create pull request to the original repo

Links

More Repositories

1

tabboz

Tabboz Simulator
HTML
86
star
2

ServerlessNabaztag

A firmware allowing controling the Nabaztag/tag directly via web, without an external server
C
67
star
3

python-cstruct

C-style structs for Python
Python
52
star
4

python-securid

python-securid is a Python library for generating RSA SecurID 128-bit compatible token codes.
Python
22
star
5

pizza-mandolino-shell

Practice your Italian with shell ๐Ÿ•๐ŸŽป๐ŸŒ
Shell
19
star
6

viscosity.sh

Control Viscosity.app (OS X) from command line
Shell
17
star
7

json2html-bookmarks

Convert Firefox bookmarks from JSON to HTML format (can be imported in other browsers)
Python
15
star
8

airflow-gitlab-webhook

Commit on Gitlab and run an Apache Airflow DAG
Shell
14
star
9

iplib.js

IPlib.js is a JavaScript library very inspired by the IPlib python module useful to convert amongst many different notations and to manage couples of address/netmask in the CIDR notation.
JavaScript
8
star
10

pzp

Pure-python fzf-inspired element picker
Python
6
star
11

vim-config

My Neovim/Vim config
Vim Script
5
star
12

FreakOTP

FreakOTPโœจ๐Ÿ”‘๐ŸŽƒ is a command line two-factor authentication application.
Python
4
star
13

airflow-provider-xlsx

Airflow operators for converting XLSX files from/to Parquet/CSV/JSON
Python
4
star
14

GLUEttalax

๐Ÿ’ฉ Glue ETL without constipation๐Ÿ’ฉ
Python
4
star
15

airflow-aws-cost-explorer

Apache Airflow Operator exporting AWS Cost Explorer data to local file or S3
Python
3
star
16

python-rt11

Utility for reading/writing RT11 filesystems
Python
3
star
17

remember-command-output

Remember the output of a command and execute commands on the lines
Shell
3
star
18

var-expansion

Shell Parameter Expansion for node.js and browser.
JavaScript
2
star
19

viscosity.py

Control Viscosity.app (macOS) from command line
Python
2
star
20

vim-on-write

Easily register commands executed when the current buffer or a given files matching a glob are saved
Vim Script
2
star
21

one-neighbor-binary-cellular-automata

One Neighbor Binary Cellular Automata (1nCA) is a one-dimensional Cellular Automata, with two possible states per cell. Each cell has two neighbors, left and right, defined to be the adjacent cells on either side, but the update rule consider only one neighbor per step. The neighborhood includes the cell itself and the left or the right adjacent cell and alternates between these two situations at even and odd time steps. The size of the neighborhood is always 2, so there are 4 possible patterns for the neighborhood and only 16 possible rules. The number of possible rules is small com- pared to the 256 possible rules of the Elementary Cellular Automata, so it is easier to exhaustively study the dynamic behavior of the all rules.
2
star
22

ajaxplorer

1
star
23

dbt-ing

dbt Ingestion Framework
Python
1
star
24

partsfs

Linux partitions filesystem (partsfs) kernel module. PartsFS allows mounting a disk image as a filesystem.
C
1
star
25

virsh-ip

Get the ip address of a running Virsh domain
Shell
1
star
26

jsfs

JavaScript
1
star
27

CowFormation

Mustache templates for AWS CloudFormation, in pure bash
Shell
1
star
28

python-sharepoint-cli

Command line interface for SharePoint
Python
1
star
29

vagrant-ftp-server

Vagrant file for FTP Server
1
star