astro-cli

command module
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

README

Astronomer CLI

The Astronomer CLI is the recommended way to get started developing and deploying on Astronomer Enterprise Edition.

Install

  • via curl

    curl -sL https://install.astronomer.io | sudo bash
    
  • or via go get

    $ brew install go
    

    More info: https://golang.org/doc/install

    Set GOPATH (recommended: ~/go) in .bash_profile or .bashrc:

    export GOPATH=$HOME/go
    export GOBIN=$HOME/go/bin
    export PATH=$PATH:$GOBIN
    

    More info: https://github.com/golang/go/wiki/SettingGOPATH

    Install astro-cli binary:

    $ go get github.com/astronomerio/astro-cli
    

Getting Started

  1. Confirm the install worked:

    $ astro
    
  2. Create a project:

    $ mkdir hello-astro && cd hello-astro
    $ astro airflow init
    

This will generate a skeleton project directory:

.
├── dags
│   ├── example-dag.py
├── Dockerfile
├── include
├── packages.txt
├── plugins
└── requirements.txt

Dags can go in the dags folder, custom airflow plugins in plugins, python packages needed can go in requirements.txt, and OS level packages can go in packages.txt.

  1. Start airflow

Run astro airflow start to start a local version of airflow on your machine. This will spin up a few locally running docker containers - one for the airflow scheduler, one for the webserver, and one for postgres. (Run docker ps to verify)

Help

The CLI includes a help command, descriptions, as well as usage info for subcommands.

To see the help overview:

$ astro help

Or for subcommands:

$ astro airflow --help
$ astro airflow create --help

Development

How to get started as a developer.

  1. Build:

    $ git clone git@github.com:astronomerio/astro-cli.git
    $ cd astro-cli
    $ make build
    
  2. (Optional) Install to $GOBIN:

    $ make install
    
  3. Run:

    $ astro
    
Testing w/ houston-api

astro-cli communicates with houston-api in order to manage Astronomer EE resources (users, workspaces, deployments). Follow the Development section on the houston-api README in order develop and test the integration between these two systems.

Docs

Docs (/docs) are generated using the github.com/spf13/cobra/doc pkg. Currently this pkg is broken with go vendoring, the following instructions include a workaround

  1. Remove the /vendor/github.com/spf13/cobra pkg, forcing Go to search your go path for the package instead
  2. go run gendocs/gendocs.go
  3. restore /vendor/github.com/spf13/cobra

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL