Hop Conf - The Hop command line configuration tool
Hop Conf changes the Hop configuration from the command line, so you can script what you otherwise do in Hop Gui: create projects and environments, set variables and change settings.
It writes to hop-config.json, in the folder of the HOP_CONFIG_FOLDER variable or by default in the config folder of your Hop installation, and to the configuration files of projects and environments.
Run it as hop-conf.sh, as hop-conf.bat on Windows, or as hop conf with the hop command.
hop-conf.sh -h lists all the options of your installation.
Plugins add their own, for example for search, the File Explorer, linting, the AI Assistant or cloud storage.
The options described on this page are listed in Options.
Projects and environments
The examples use hop-conf.sh on Linux and macOS.
On Windows, run hop-conf.bat with the same options, and put a command on a single line or end its lines with ^ instead of \.
Projects
A project is registered in hop-config.json with its name and its home folder.
Its settings and variables are stored in project-config.json, in the home folder.
Create a project
The home folder has to exist: when it doesn’t, hop-conf stops with an error that the home folder does not exist.
mkdir -p /data/projects/sales
./hop-conf.sh --project-create --project=sales --project-home=/data/projects/sales
Output:
Creating project 'sales'
Project 'sales' was created for home folder : /data/projects/sales
Configuration file for project 'sales' was saved to : file:/data/projects/sales/project-config.json
You can set more at the same time, for example a parent project to inherit metadata and variables from (--project-parent), a description (--project-description) or variables (--project-variables, see Project variables).
When the home folder already has a project-config.json, --project-create updates it with the options you pass and keeps its variables.
Add --project-keep-config-file to leave the file as it is.
Modify, list and delete projects
-
--project-modifychanges the options you pass, for example./hop-conf.sh --project-modify --project=sales --project-description="Sales data warehouse". -
--projects-listlists the projects with their home folder and configuration file. -
--project-deleteremoves a project fromhop-config.json, for example./hop-conf.sh --project-delete --project=sales. The home folder and its files are not deleted.
Project variables
--project-variables adds variables to the project, or changes the value of a variable that already exists.
Variables with other names are kept.
./hop-conf.sh --project-modify --project=sales --project-variables=INPUT_FOLDER=/data/in,OUTPUT_FOLDER=/data/out
Separate variables with commas. To use spaces or commas in a value, wrap the value in double quotes and keep them from the shell:
| Option, as typed in a shell | Variables |
|---|---|
|
|
|
|
|
|
|
|
|
|
Environments
An environment belongs to one project. It adds configuration files with variables to that project, usually one environment for every stage of its lifecycle: development, testing, production. The project holds the code, and the environment the configuration, such as server names and folders. See Projects and Environments for how they work together.
Create an environment
./hop-conf.sh --environment-create \
--environment=sales-dev \
--environment-project=sales \
--environment-purpose=Development \
--environment-config-files=/data/environments/sales-dev/variables.json
Output, shortened:
Creating environment 'sales-dev'
Environment 'sales-dev' was created in Hop configuration file /opt/hop/config/hop-config.json
Created empty environment configuration file : /data/environments/sales-dev/variables.json
sales-dev
Purpose: Development
Project name: sales
Config file: /data/environments/sales-dev/variables.json
A configuration file that doesn’t exist yet is created, empty. Before creating it, hop-conf logs an error that the file doesn’t exist to read variables from.
{ }
Add variables to it as described in Configuration files.
Add configuration files from a directory
--environment-config-files lists files one by one.
To add every matching file in a folder, pass the folder and a regular expression.
The expression is matched against the file name, the same way as in the JSON Input and Get File Names transforms.
.json is not a valid expression; use .\.json.
An exclusion expression and --environment-config-include-subfolders are optional.
Files found in the folder are stored as individual paths.
They can be combined with --environment-config-files.
When either option is set, that selection replaces the environment’s configuration file list.
./hop-conf.sh --environment-create \
--environment=sales-test \
--environment-project=sales \
--environment-purpose=Testing \
--environment-config-file-directory="/data/environments/sales-test" \
--environment-config-file-wildcard=".*\.json" \
--environment-config-file-exclude-wildcard=".*secret.*" \
--environment-config-include-subfolders
Modify, list and delete environments
-
--environment-modifychanges the options you pass, for example./hop-conf.sh --environment-modify --environment=sales-dev --environment-purpose=Testing. -
--environments-listlists the environments with their purpose, project and configuration files. -
--environment-deleteremoves an environment fromhop-config.json, for example./hop-conf.sh --environment-delete --environment=sales-dev. Its configuration files are not deleted.
Configuration files
The configuration files of an environment hold its variables.
--config-file selects the file, --config-file-set-variables sets the value of variables, and --config-file-describe-variables their description:
./hop-conf.sh --config-file=/data/environments/sales-dev/variables.json \
--config-file-set-variables=DB_HOSTNAME=localhost,DB_PASSWORD=abcd
./hop-conf.sh --config-file=/data/environments/sales-dev/variables.json \
--config-file-describe-variables="DB_HOSTNAME=The database server"
The file then contains:
{
"variables" : [
{
"name" : "DB_HOSTNAME",
"value" : "localhost",
"description" : "The database server"
},
{
"name" : "DB_PASSWORD",
"value" : "abcd",
"description" : ""
}
]
}
The variables of hop-config.json itself, listed as System variables in the configuration perspective of Hop Gui, are set with --set-variable and described with --describe-variable:
./hop-conf.sh --set-variable=COMPANY_NAME=Acme
./hop-conf.sh --describe-variable="COMPANY_NAME=The company name used in reports"
--set-variable=MY_VARIABLE= sets a variable to an empty value. The variable stays in the list.
Projects plugin configuration
There are various options to configure the behavior of the plugin itself.
In Hop configuration file Projects we can find the following options:hop-config.json
{
"projectMandatory" : true,
"environmentMandatory" : false,
"defaultProject" : "default",
"defaultEnvironment" : null,
"standardParentProject" : "default",
"standardProjectsFolder" : "/home/matt/test-stuff/"
}
| Option | Description | hop-conf option |
|---|---|---|
projectMandatory |
This will prevent anyone from using hop-run without specifying a project |
|
environmentMandatory |
This will prevent anyone from using hop-run without specifying an environment |
|
defaultProject |
The default project to use when none is specified |
|
defaultEnvironment |
The default environment to use when none is specified |
|
standardParentProject |
The standard parent project to propose when creating new project |
|
standardProjectsFolder |
The folder to which you’ll browse by default in the GUI when creating new projects |
|
Graph database connections
Hop Conf tests graph database connections and Neo4j connections by name, and tells what the graph database types support.
The connections come from the metadata of a project: enable it with the -j (project) or -e (environment) option of the hop command, before conf.
Without a project, and with hop-conf.sh, the metadata in the folder of the HOP_METADATA_FOLDER variable is used.
Variables in the connection settings are resolved with the variables of the project and environment.
| Option | Description |
|---|---|
|
Connect to the database and print what was tested, for example the URL. The exit code is 0 when the connection works, 1 with the error when it doesn’t or when there is no connection with that name. |
|
Print the name, the metadata type ( |
|
Print all installed graph database types with their capabilities as a JSON array. This doesn’t need a project or a connection. |
The same is available in Hop GUI: the Test button and the Supports line of the graph database connection editor.
./hop -j my-project conf --graph-connection-test=memgraph
Graph database connection 'memgraph' is OK: bolt://localhost:7687
./hop -e my-environment conf --graph-connection-info=memgraph
./hop-conf.sh --graph-database-types
The JSON of a graph database type, also used for the type of --graph-connection-info:
{
"pluginId" : "MEMGRAPH",
"name" : "Memgraph",
"description" : "Memgraph over the Bolt protocol",
"documentationUrl" : "https://hop.apache.org/manual/next/metadata-types/graphs/graph-database-connection.html",
"dialectId" : "MEMGRAPH",
"queryLanguage" : "Cypher",
"capabilities" : {
"cypher" : true,
"supportingConstraints" : true,
"supportingIndexes" : true,
"supportingNodeIndexes" : true,
"supportingRelationshipIndexes" : true,
"supportingRelationshipVectorSearch" : true,
"supportingSchemaChangesInTransactions" : false,
"supportingSchemaIntrospection" : true,
"supportingShortestPath" : false,
"supportingVectorIndexes" : true,
"supportingVectorSearch" : true
}
}
queryLanguage is Cypher or Gremlin.
The capabilities are listed in Graph Database Connection.
Running Workflows and Pipelines
You can specify an environment or a project when executing a pipeline or a workflow. By doing so you are automatically configuring metadata, variables without too much fuss.
The easiest example is shown by executing the "complex" pipeline from the Apache Beam examples:
-
Windows
-
Linux, macOS
hop-run.bat --project samples --file 'beam/pipelines/complex.hpl' --runconfig Direct
Expected output:
C:\<YOUR_PATH>\hop>echo off
===[Environment Settings - hop-run.bat]===================================
Java identified as "C:\Program Files\Microsoft\jdk-11.0.17.8-hotspot\\bin\java"
HOP_OPTIONS="-Xmx2048m" -DHOP_AUDIT_FOLDER=.\audit -DHOP_PLATFORM_OS=Windows
-DHOP_PLATFORM_RUNTIME=Run -DHOP_AUTO_CREATE_CONFIG=Y
Consolidated parameters to pass to HopRun are
--project samples --file beam/pipelines/complex.hpl --runconfig Direct
Command to start HopRun will be:
"C:\Program Files\Microsoft\jdk-11.0.17.8-hotspot\\bin\java" -classpath lib\core\*;lib\beam\*;lib\swt\win64\*
-Djava.library.path=lib\core;lib\beam "-Xmx2048m" -DHOP_AUDIT_FOLDER=.\audit -DHOP_PLATFORM_OS=Windows
-DHOP_PLATFORM_RUNTIME=Run -DHOP_AUTO_CREATE_CONFIG=Y org.apache.hop.run.HopRun --project samples
--file beam/pipelines/complex.hpl --runconfig Direct
===[Starting HopRun]=========================================================
2022/12/16 14:23:10 - HopRun - Enabling project 'samples'
2022/12/16 14:23:10 - HopRun - Relative path filename specified: config/projects/samples/beam/pipelines/complex.hpl
2022/12/16 14:23:10 - HopRun - Starting pipeline: config/projects/samples/beam/pipelines/complex.hpl
2022/12/16 14:23:21 - General - Created Apache Beam pipeline with name 'complex'
2022/12/16 14:23:21 - General - Handled transform (INPUT) : Customer data
2022/12/16 14:23:21 - General - Handled transform (INPUT) : State data
2022/12/16 14:23:21 - General - Handled Group By (TRANSFORM) : countPerState, gets data from 1 previous transform(s)
2022/12/16 14:23:21 - General - Handled generic transform (TRANSFORM) : uppercase state, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:23:21 - General - Handled Merge Join (TRANSFORM) : Merge join
2022/12/16 14:23:21 - General - Handled generic transform (TRANSFORM) : Lookup count per state, gets data from 1 previous transform(s), targets=0, infos=1
2022/12/16 14:23:21 - General - Handled generic transform (TRANSFORM) : name<n, gets data from 1 previous transform(s), targets=2, infos=0
2022/12/16 14:23:21 - General - Transform Label: N-Z reading from previous transform targeting this one using : name<n - TARGET - Label: N-Z
2022/12/16 14:23:21 - General - Handled generic transform (TRANSFORM) : Label: N-Z, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:23:21 - General - Transform Label: A-M reading from previous transform targeting this one using : name<n - TARGET - Label: A-M
2022/12/16 14:23:21 - General - Handled generic transform (TRANSFORM) : Label: A-M, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:23:21 - General - Handled generic transform (TRANSFORM) : Switch / case, gets data from 2 previous transform(s), targets=4, infos=0
2022/12/16 14:23:21 - General - Transform CA reading from previous transform targeting this one using : Switch / case - TARGET - CA
2022/12/16 14:23:21 - General - Handled generic transform (TRANSFORM) : CA, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:23:21 - General - Transform NY reading from previous transform targeting this one using : Switch / case - TARGET - NY
2022/12/16 14:23:21 - General - Handled generic transform (TRANSFORM) : NY, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:23:21 - General - Transform FL reading from previous transform targeting this one using : Switch / case - TARGET - FL
2022/12/16 14:23:21 - General - Handled generic transform (TRANSFORM) : FL, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:23:21 - General - Transform Default reading from previous transform targeting this one using : Switch / case - TARGET - Default
2022/12/16 14:23:21 - General - Handled generic transform (TRANSFORM) : Default, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:23:21 - General - Handled generic transform (TRANSFORM) : Collect, gets data from 4 previous transform(s), targets=0, infos=0
2022/12/16 14:23:21 - General - Handled transform (OUTPUT) : complex, gets data from Collect
2022/12/16 14:23:21 - General - Executing this pipeline using the Beam Pipeline Engine with run configuration 'Direct' ----
./sh hop-run.sh --project samples --file 'beam/pipelines/complex.hpl' --runconfig Direct
Expected output:
2022/12/16 14:27:37 - HopRun - Enabling project 'samples'
2022/12/16 14:27:37 - HopRun - Relative path filename specified: config/projects/samples/beam/pipelines/complex.hpl
2022/12/16 14:27:37 - HopRun - Starting pipeline: config/projects/samples/beam/pipelines/complex.hpl
2022/12/16 14:27:41 - General - Created Apache Beam pipeline with name 'complex'
2022/12/16 14:27:41 - General - Handled transform (INPUT) : Customer data
2022/12/16 14:27:41 - General - Handled transform (INPUT) : State data
2022/12/16 14:27:41 - General - Handled Group By (TRANSFORM) : countPerState, gets data from 1 previous transform(s)
2022/12/16 14:27:41 - General - Handled generic transform (TRANSFORM) : uppercase state, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:27:41 - General - Handled Merge Join (TRANSFORM) : Merge join
2022/12/16 14:27:41 - General - Handled generic transform (TRANSFORM) : Lookup count per state, gets data from 1 previous transform(s), targets=0, infos=1
2022/12/16 14:27:41 - General - Handled generic transform (TRANSFORM) : name<n, gets data from 1 previous transform(s), targets=2, infos=0
2022/12/16 14:27:41 - General - Transform Label: N-Z reading from previous transform targeting this one using : name<n - TARGET - Label: N-Z
2022/12/16 14:27:41 - General - Handled generic transform (TRANSFORM) : Label: N-Z, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:27:41 - General - Transform Label: A-M reading from previous transform targeting this one using : name<n - TARGET - Label: A-M
2022/12/16 14:27:41 - General - Handled generic transform (TRANSFORM) : Label: A-M, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:27:41 - General - Handled generic transform (TRANSFORM) : Switch / case, gets data from 2 previous transform(s), targets=4, infos=0
2022/12/16 14:27:41 - General - Transform CA reading from previous transform targeting this one using : Switch / case - TARGET - CA
2022/12/16 14:27:42 - General - Handled generic transform (TRANSFORM) : CA, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:27:42 - General - Transform NY reading from previous transform targeting this one using : Switch / case - TARGET - NY
2022/12/16 14:27:42 - General - Handled generic transform (TRANSFORM) : NY, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:27:42 - General - Transform FL reading from previous transform targeting this one using : Switch / case - TARGET - FL
2022/12/16 14:27:42 - General - Handled generic transform (TRANSFORM) : FL, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:27:42 - General - Transform Default reading from previous transform targeting this one using : Switch / case - TARGET - Default
2022/12/16 14:27:42 - General - Handled generic transform (TRANSFORM) : Default, gets data from 1 previous transform(s), targets=0, infos=0
2022/12/16 14:27:42 - General - Handled generic transform (TRANSFORM) : Collect, gets data from 4 previous transform(s), targets=0, infos=0
2022/12/16 14:27:42 - General - Handled transform (OUTPUT) : complex, gets data from Collect
2022/12/16 14:27:42 - General - Executing this pipeline using the Beam Pipeline Engine with run configuration 'Direct'
To execute an Apache Beam pipeline a lot of information and metadata is needed. Let’s dive into a few fun information tidbits:
-
By referencing the
project Hop knows where the project is located (samples)config/projects/samples -
Since we know the location of the project, we can specify pipelines and workflows with a relative path
-
The project knows where its metadata is stored (
) so it knows where to find theconfig/projects/samples/metadatapipeline run configuration (Direct)config/projects/samples/metadata/pipeline-run-configuration/Direct.json -
This run configuration defines its own pipeline engine specific variables, in this case the output folder :
DATA_OUTPUT=${PROJECT_HOME}/beam/output/ -
The output of the samples is as such written to
config/projects/samples/beam/output
To reference an environment you can execute using or -e.
The only difference is that you’ll have a number of extra environment variables set while executing.--environment
Cloud Storage Configuration
Hop Conf can be used to configure your AWS, Azure and Google Cloud (Cloud Storage and Drive) accounts with Hop through VFS
Azure
Set the account and key of your Azure storage account, or the URL of an Azure emulator (Azurite)
-aza, --azure-account=<account>
The account to use for the Azure VFS
-aze, --azure-emulator=<emulatorUrl>
The URL of an Azure emulator (Azurite) to be used
for test and development goals instead of
official Azure services
-azk, --azure-key=<key>
The key to use for the Azure VFS
Google Cloud Storage
Set the path to your Google Cloud service account JSON key file, and the block size to read files with
-gck, --google-cloud-service-account-key-file=<serviceAccountKeyFile>
Configure the path to a Google Cloud service account JSON key file
-gcrbs, --google-cloud-read-block-size=<readBlockSize>
Configure the bytes per request when reading a file
in blocks, like 8MB
Google Drive
Set the path to your Google Drive credentials JSON file or Google Drive tokens folder.
-gdc, --google-drive-credentials-file=<credentialsFile>
Configure the path to a Google Drive credentials JSON
file
-gdt, --google-drive-tokens-folder=<tokensFolder>
Configure the path to a Google Drive tokens folder
Options
The options described on this page.
Run hop-conf.sh -h for the complete list of your installation.
| Short option | Long option | Description |
|---|---|---|
General |
||
|
|
Displays the help message and quits. |
|
|
Prints version information and exits. |
|
|
The log level: NOTHING, ERROR, MINIMAL, BASIC, DETAILED, DEBUG or ROWLEVEL. |
Projects |
||
|
|
The name of the project to manage. |
|
|
Create a project. Also specify its name and home folder. |
|
|
Modify a project. |
|
|
Remove a project from |
|
|
List the projects. |
|
|
The home folder of the project. |
|
|
The configuration file, relative to the home folder. The default is |
|
|
Keep the configuration file of the project if it already exists. |
|
|
The parent project to inherit metadata and variables from. |
|
|
The description of the project. |
|
|
The company. |
|
|
The department. |
|
|
Variables of the project, as |
|
|
The metadata folder, relative to the home folder. |
|
|
The data sets CSV folder, relative to the home folder. |
|
|
The unit tests folder, relative to the home folder. |
|
|
|
|
|
List the action types used in the project. |
|
|
List the metadata types used in the project. |
|
|
List the transform types used in the project. |
|
|
List the files of the project that use a given metadata item. |
|
|
Export the metadata of the project given with |
Environments |
||
|
|
The name of the environment to manage. |
|
|
Create an environment. Also specify its name, purpose, project and configuration files. |
|
|
Modify an environment. |
|
|
Remove an environment from |
|
|
List the environments. |
|
|
The project of the environment. |
|
|
The purpose of the environment: Development, Testing, Production, CI, … |
|
|
The configuration files of the environment, separated by commas. |
|
A folder of configuration files. Matching files replace the configuration file list, together with |
|
|
Regular expression matched against the file names in that folder, for example |
|
|
Regular expression for file names to ignore in that folder, for example |
|
|
Also include matching files from subfolders of that folder. |
|
Configuration files and variables |
||
|
|
The configuration file to manage. |
|
|
Set variables in that file, separated by commas. |
|
|
Describe variables in that file, separated by commas. |
|
|
Set a variable in |
|
|
Describe a variable in |
Projects plugin |
||
|
|
Enable or disable the projects plugin. |
|
|
Make it mandatory to reference a project. |
|
|
Make it mandatory to reference an environment. |
|
|
The default project to use when none is specified. |
|
|
The default environment to use when none is specified. |
|
|
The parent project proposed when creating a project. |
|
|
The folder proposed when creating a project. |
|
|
The configuration filename for new projects. |
Beam and Spark, when the Beam plugin is installed |
||
|
|
Generate a fat jar with the given filename from your current Hop installation, for the Beam and Spark engines. |
|
|
The Spark client pack to embed in the fat jar: a version (folder |
Graph database connections |
||
|
Test the graph database connection or Neo4j connection with the given name. See Graph database connections. |
|
|
Print the graph database type and capabilities of a connection as JSON. |
|
|
Print the installed graph database types and their capabilities as JSON. |
|