GithubHelp home page GithubHelp logo

amancevice / caravel Goto Github PK

View Code? Open in Web Editor NEW
35.0 6.0 22.0 39 KB

Docker image for AirBnB's Caravel

Home Page: https://hub.docker.com/r/amancevice/caravel/

License: MIT License

Python 85.94% Shell 14.06%

caravel's Introduction

NOTE

AirBnB renamed this project superset. As such this project is effectively dead.

Find the new project at amancevice/superset

Caravel

Docker image for AirBnB's Caravel.

As of version 0.10.0 this image is based on Alpine Linux and installed with Python 3

Demo

Run the caravel demo by entering this command into your console:

docker run --name caravel -d -p 8088:8088 amancevice/caravel
docker exec -it caravel demo

You will be prompted to set up an admin user.

When finished navigate to http://localhost:8088/ to see the demo.

Log in with the credentials you just created.

Versions

This repo is tagged in parallel with caravel. Pulling amancevice/caravel:0.10.0 will fetch the image of this repository running caravel version 0.10.0. As it is an automated build, commits to the master branch of this repository trigger a re-build of the latest tag, while tagging master triggers a versioned build. It is possible that the latest tag includes new deployment-specific features but will usually be in sync with the latest semantic version.

Database Setup

Determine where you will store Caravel's database; choose SQLite, MySQL, PostgreSQL, or Redshift. Use the ENV variable SQLALCHEMY_DATABASE_URI to point caravel to the correct database. Be sure to set a SECRET_KEY when creating the container.

SQLite

If Caravel's database is created using SQLite the db file should be mounted from the host machine. In this example we will store a SQLite DB on our host machine in ~/caravel/caravel.db and mount the directory to /home/caravel/db in the container.

docker run --detach --name caravel \
    --env SECRET_KEY="mySUPERsecretKEY" \
    --env SQLALCHEMY_DATABASE_URI="sqlite:////home/caravel/db/caravel.db" \
    --publish 8088:8088 \
    --volume ~/caravel:/home/caravel/db \
    amancevice/caravel

MySQL

docker run --detach --name caravel \
    --env SECRET_KEY="mySUPERsecretKEY" \
    --env SQLALCHEMY_DATABASE_URI="mysql://user:pass@host:port/db" \
    --publish 8088:8088 \
    amancevice/caravel

PostgreSQL

docker run --detach --name caravel \
    --env SECRET_KEY="mySUPERsecretKEY" \
    --env SQLALCHEMY_DATABASE_URI="postgresql://user:pass@host:port/db" \
    --publish 8088:8088 \
    amancevice/caravel

Redshift

docker run --detach --name caravel \
    --env SECRET_KEY="mySUPERsecretKEY" \
    --env SQLALCHEMY_DATABASE_URI="redshift+psycopg2://[email protected]:5439/db" \
    --publish 8088:8088 \
    amancevice/caravel

Database Initialization

After starting the Caravel server, initialize the database with an admin user and Caravel tables using the caravel-init helper script:

docker run --detach --name caravel ... amancevice/caravel
docker exec -it caravel caravel-init

Upgrading

Upgrading to a newer version of caravel can be accomplished by re-pulling amancevice/caravelat a specified caravel version or latest (see above for more on this). Remove the old container and re-deploy, making sure to use the correct environmental configuration. Finally, ensure the caravel database is migrated up to the head:

# Pull desired version
docker pull amancevice/caravel

# Remove the current container
docker rm -f caravel-old

# Deploy a new container ...
docker run --detach --name caravel-new ...

# Upgrade the DB
docker exec caravel-new db upgrade

Additional Configuration

A custom configuration can be accomplished through mounting a Caravel config to ~caravel/caravel_config.py in the container or by setting ENV variables:

  • ROW_LIMIT
  • WEBSERVER_THREADS
  • SECRET_KEY
  • SQLALCHEMY_DATABASE_URI
  • CSRF_ENABLED
  • DEBUG

Additional environmental variables prefixed with CARAVEL_ will also be passed to the caravel configuration (without the CARAVEL_ prefix). See the caravel configuration file for a list of available configuration keys.

For example, the following command will deploy caravel with the LOG_LEVEL variable set in the caravel configuration:

docker run --detach --name caravel \
    --env CARAVEL_LOG_LEVEL="INFO" \
    --publish 8088:8088 \
    amancevice/caravel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.