[Feature Request]: add parent project support to basic image
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
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-parentis the parent ofproject-main -
project-mainis the parent ofproject-supertheproject-superalso can access metadata fromproject-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.
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.