hop icon indicating copy to clipboard operation
hop copied to clipboard

[Feature Request]: add parent project support to basic image

Open hansva opened this issue 2 years ago • 1 comments

What would you like to happen?

Migration: https://issues.apache.org/jira/browse/HOP-3470

if you have a project structure like

projects

project A project B where project B inherits from project A (so not by the default project, see project-config.json > parentProjectName) the configured metadata path "metadataBaseFolder" from project A is not resolved and not available (e.g. merged into project B's metatdata folder) for project B executions

docker call for example by (/files/projects/ in that case will include both projects "project A" and "project B")

docker run --rm
--env HOP_LOG_LEVEL=Basic
--env HOP_FILE_PATH="jobs/load_projectB_data.hwf"
--env HOP_PROJECT_DIRECTORY=/files/projects/projectB
--env HOP_PROJECT_NAME=projectB
--env HOP_ENVIRONMENT_NAME=prod_docker_exec
--env HOP_ENVIRONMENT_CONFIG_FILE_NAME_PATHS="/files/projects/projectB/prod_docker_exec-config.json"
--env HOP_RUN_CONFIG=docker_run_config
--name "docker-exec-projectB"
apache/incubator-hop:latest

Issue Priority

Priority: 3

Issue Component

Component: Containers, Component: Hop Config

hansva avatar Mar 16 '23 13:03 hansva

Hi @hansva,

i have a question regarding the feature request.

What behavior exactly did you have in mind?

If we introduce the variables

ENV HOP_PARENT_PROJECT_NAME=
ENV HOP_PARENT_PROJECT_CONFIG_FILE_NAME=parent-project-config.json
ENV HOP_PARENT_PROJECT_FOLDER=

in the Dockerfile, we could add a check in load-and-execute.sh right after the HOP_PROJECT_FOLDER (since it doesn't make sense to add a parent without the main project).


The downside is that only one hierarchy level can be passed.

Compared to the GUI if you have for example three projects like project-super, project-main and project-parent where

  • project-parent is the parent of project-main
  • project-main is the parent of project-super the project-super also can access metadata from project-parent

This would not be possible with implementation using additional Docker variables.

Other approaches, like creating a project for each folder mounted under /files, are difficult because we don’t know which of the contained projects belongs to which parent.


Would it be sufficient for you if only one level of inheritance could be specified for the Container?

I tested this with a short-lived container, and there the metadata passing works (e.g., a database connection defined in the parent and then used in the main project).

When testing with a long-lived container, for example with a service defined in the parent, services coming from the parent cannot be accessed, unless you adjust the path in the main project but then it also gets changed in the parent. The same behavior occurs in the GUI.

Image

For this to work, there would need to be a PARENT_PROJECT_HOMEas requested here #2331 which also supports the idea that this could be solved using the additional variables.

dsanderbi avatar Nov 22 '25 11:11 dsanderbi