-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not bloat spark image with ENV variables #2081
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,18 +12,6 @@ def _get_program_version(container: Container, program: str) -> str: | |
return DockerRunner.run_simple_command(container, cmd=f"{program} --version") | ||
|
||
|
||
def _get_env_variable(container: Container, variable: str) -> str: | ||
env = DockerRunner.run_simple_command( | ||
container, | ||
cmd="env", | ||
print_result=False, | ||
).split() | ||
for env_entry in env: | ||
if env_entry.startswith(variable): | ||
return env_entry[len(variable) + 1 :] | ||
raise KeyError(variable) | ||
|
||
|
||
def _get_pip_package_version(container: Container, package: str) -> str: | ||
PIP_VERSION_PREFIX = "Version: " | ||
|
||
|
@@ -136,12 +124,6 @@ def tag_value(container: Container) -> str: | |
return "spark-" + version_line.split(" ")[-1] | ||
|
||
|
||
class HadoopVersionTagger(TaggerInterface): | ||
@staticmethod | ||
def tag_value(container: Container) -> str: | ||
return "hadoop-" + _get_env_variable(container, "HADOOP_VERSION") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is pretty useless, because it just says "3". And it custom builds people obviously know their Hadoop version, so they are not interested in tagging. I also think that getting versions from env is not the best solution, programs should be able to tell their versions themselves. |
||
|
||
|
||
class JavaVersionTagger(TaggerInterface): | ||
@staticmethod | ||
def tag_value(container: Container) -> str: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These env variable names are not something common, it's something we made up, so I don't think we should set them in the images.