Git Product home page Git Product logo

hop-docker's Introduction

project-hop-in-the-cloud

A Hop Docker image supporting both short-lived and long-lived setups.

Hop Config

Set HOP_HOME to the project-a directory (absolute path) when using Hop locally (on your laptop).

Example:

export HOP_HOME=/Users/diethardsteiner/git/project-hop-in-the-cloud/project-a
export HOP_METASTORE_FOLDER=/Users/diethardsteiner/git/project-hop-in-the-cloud/project-a

Running the Container

The container image is available on Docker Hub.

Container Folder Structure

Directory Description
/opt/project-hop location of the hop package
/files here you should mount a directory that contains the hop and project config as well as the workflows and pipelines.

Environment Variables

You can provide values for the following environment variables:

Environment Variable Required Description
HOP_LOG_LEVEL No Specify the log level. Default: Basic. Optional.
HOP_FILE_PATH Yes Path to hop workflow or pipeline
HOP_LOG_PATH No File path to hop log file
HOP_CONFIG_DIRECTORY Yes Path to the Hop config folder
HOP_RUN_ENVIRONMENT Yes Name of the Hop run environment to use
HOP_RUN_CONFIG Yes Name of the Hop run configuration to use
HOP_RUN_PARAMETERS No Parameters that should be passed on to the hop-run command. Specify as comma separated list, e.g. PARAM_1=aaa,PARAM_2=bbb. Optional.
HOP_OPTIONS No Any JRE options you want to set

The Required column relates to running a short-lived container.

How to run the Container

The most common use case will be that you run a short-lived container to just complete one Hop workflow or pipeline.

Example for running a workflow:

WORKING_DIR="$( cd "$( /usr/bin/dirname "$0" )" && pwd )"
VOLUME_DIR=${WORKING_DIR}/../tests/project-a

docker run -it --rm \
  --env HOP_LOG_LEVEL=Basic \
  --env HOP_FILE_PATH=/files/pipelines-and-workflows/main.hwf \
  --env HOP_CONFIG_DIRECTORY=/files/config/hop/config \
  --env HOP_RUN_ENVIRONMENT=project-a-dev \
  --env HOP_RUN_CONFIG=classic \
  --env HOP_RUN_PARAMETERS=PARAM_LOG_MESSAGE=Hello,PARAM_WAIT_FOR_X_MINUTES=1 \
  -v ${VOLUME_DIR}:/files \
  --name my-simple-hop-container \
  diethardsteiner/project-hop:0.20-20200505.141953-75

If you need a long-lived container, this option is also available. Run this command e.g.:

docker run -it --rm \
  --env HOP_LOG_LEVEL=Basic \
  --env HOP_CONFIG_DIRECTORY=/files/config/hop/config \
  -v ${VOLUME_DIR}:/files \
  --name my-simple-hop-container \
  diethardsteiner/project-hop:0.20-20200505.141953-75

Local Development

How to run the workflow locally

To just test the workflow locally without Docker:

export HOP_CONFIG_DIRECTORY=/Users/diethardsteiner/git/project-hop-in-the-cloud/project-a/config/hop/config
~/apps/hop/hop-run.sh \
  --file=/Users/diethardsteiner/git/project-hop-in-the-cloud/project-a/pipelines-and-workflows/main.hwf \
  --environment=project-a-local \
  --runconfig=classic \
  --parameters=PARAM_LOG_MESSAGE=Hello,PARAM_WAIT_FOR_X_MINUTES=1

To test the workflow within the Docker container:

./hop-run.sh \
  --file=/files/pipelines-and-workflows/main.hwf \
  --environment=project-a-dev \
  --runconfig=classic \
  --parameters=PARAM_LOG_MESSAGE=Hello,PARAM_WAIT_FOR_X_MINUTES=1

Shortcomings

Currently the hop-server support is minimal.

How to run the workflow within the Docker container

If you spin up a docker container with the hop server running:

./hop-run.sh --file=/home/hop/project-hop-in-the-cloud/project-a/pipelines-and-workflows/main.hwf --runconfig=classic --parameters=PARAM_LOG_MESSAGE=Hello,PARAM_WAIT_FOR_X_MINUTES=1

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.