We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
When I built a H2O-based image, the following error occurred
**Describe the bug**
When I built a H2O-based image, the following error occurred. From the Dockerfile generated by BentoML, the base image is bentoml/model-server:0.8.1, and JRE is indeed not installed


I used service.py to build a bentoML bundle
```python
import bentoml
from bentoml.adapters import DataframeInput
from bentoml.artifact import H2oModelArtifact
from customize import preprocessing, postprocessing


@bentoml.env(auto_pip_dependencies=True)
@bentoml.artifacts([H2oModelArtifact('model')])
class LoanDefaultPrediction(bentoml.BentoService):
    @bentoml.api(input=DataframeInput())
    def predict(self, df):
        model_input = preprocessing(df)
        model_output = self.artifacts.model.predict(model_input)
        return postprocessing(model_output)


if __name__ == "__main__":
    import h2o
    h2o.init(strict_version_check=False)
    model = h2o.load_model('H2O_AutoML_20200720_153457')

    model_service = LoanDefaultPrediction()
    model_service.pack("model", model)

    saved_path = model_service.save()
```
And another customize.py to pre process
```python
import h2o

def preprocessing(model_input):
    return h2o.H2OFrame(model_input, na_strings=['NaN'])


def postprocessing(model_output):
    return model_output.as_data_frame()
```

Finally, After I build service image with this bundle, I run this docker image with below log:
```
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/opt/conda/lib/python3.7/site-packages/gunicorn/workers/base.py", line 119, in init_process
    self.load_wsgi()
  File "/opt/conda/lib/python3.7/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/opt/conda/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/opt/conda/lib/python3.7/site-packages/bentoml/server/gunicorn_server.py", line 92, in load
    bento_service = load(self.bento_service_bundle_path)
  File "/opt/conda/lib/python3.7/site-packages/bentoml/saved_bundle/loader.py", line 179, in load
    svc = svc_cls()
  File "/opt/conda/lib/python3.7/site-packages/bentoml/service.py", line 526, in __init__
    self._load_artifacts(self._bento_service_bundle_path)
  File "/opt/conda/lib/python3.7/site-packages/bentoml/service.py", line 734, in _load_artifacts
    packed_artifact = artifact.load(artifacts_path)
  File "/opt/conda/lib/python3.7/site-packages/bentoml/artifact/h2o_model_artifact.py", line 79, in load
    h2o.init()
  File "/opt/conda/lib/python3.7/site-packages/h2o/h2o.py", line 307, in init
    bind_to_localhost=bind_to_localhost)
  File "/opt/conda/lib/python3.7/site-packages/h2o/backend/server.py", line 143, in start
    bind_to_localhost=bind_to_localhost, log_dir=log_dir, log_level=log_level, max_log_file_size=max_log_file_size)
  File "/opt/conda/lib/python3.7/site-packages/h2o/backend/server.py", line 276, in _launch_server
    java = self._find_java()
  File "/opt/conda/lib/python3.7/site-packages/h2o/backend/server.py", line 441, in _find_java
    raise H2OStartupError("Cannot find Java. Please install the latest JRE from\n"
h2o.exceptions.H2OStartupError: Cannot find Java. Please install the latest JRE from
http://www.oracle.com/technetwork/java/javase/downloads/index.html
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bentoml/artifact/h2o_model_artifact.py`
Content:
```
1 # Copyright 2019 Atalaya Tech, Inc.
2 
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 
7 # http://www.apache.org/licenses/LICENSE-2.0
8 
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 import os
16 import shutil
17 
18 from bentoml.artifact import BentoServiceArtifact
19 from bentoml.exceptions import MissingDependencyException
20 from bentoml.service_env import BentoServiceEnv
21 
22 
23 class H2oModelArtifact(BentoServiceArtifact):
24     """Abstraction for saving/loading objects with h2o.save_model and h2o.load_model
25 
26     Args:
27         name (str): Name for this h2o artifact..
28 
29     Raises:
30         MissingDependencyException: h2o package is required to use H2o model artifact
31 
32     Example usage:
33 
34     >>> import h2o
35     >>> h2o.init()
36     >>>
37     >>> from h2o.estimators.deeplearning import H2ODeepLearningEstimator
38     >>> model_to_save = H2ODeepLearningEstimator(...)
39     >>> # train model with data
40     >>> data = h2o.import_file(...)
41     >>> model_to_save.train(...)
42     >>>
43     >>> import bentoml
44     >>> from bentoml.artifact import H2oModelArtifact
45     >>> from bentoml.adapters import DataframeInput
46     >>>
47     >>> @bentoml.artifacts([H2oModelArtifact('model')])
48     >>> @bentoml.env(auto_pip_dependencies=True)
49     >>> class H2oModelService(bentoml.BentoService):
50     >>>
51     >>>     @bentoml.api(input=DataframeInput())
52     >>>     def predict(self, df):
53     >>>         hf = h2o.H2OFrame(df)
54     >>>         predictions = self.artifacts.model.predict(hf)
55     >>>         return predictions.as_data_frame()
56     >>>
57     >>> svc = H2oModelService()
58     >>>
59     >>> svc.pack('model', model_to_save)
60     """
61 
62     def __init__(self, name):
63         super(H2oModelArtifact, self).__init__(name)
64 
65         self._model = None
66 
67     def set_dependencies(self, env: BentoServiceEnv):
68         env.add_pip_dependencies_if_missing(['h2o'])
69 
70     def _model_file_path(self, base_path):
71         return os.path.join(base_path, self.name)
72 
73     def pack(self, model):  # pylint:disable=arguments-differ
74         self._model = model
75         return self
76 
77     def load(self, path):
78         try:
79             import h2o
80         except ImportError:
81             raise MissingDependencyException(
82                 "h2o package is required to use H2oModelArtifact"
83             )
84 
85         h2o.init()
86         model = h2o.load_model(self._model_file_path(path))
87         self._model = model
88         return self
89 
90     def save(self, dst):
91         try:
92             import h2o
93         except ImportError:
94             raise MissingDependencyException(
95                 "h2o package is required to use H2oModelArtifact"
96             )
97 
98         h2o_saved_path = h2o.save_model(model=self._model, path=dst, force=True)
99         shutil.move(h2o_saved_path, self._model_file_path(dst))
100         return
101 
102     def get(self):
103         return self._model
104
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/bentoml/artifact/h2o_model_artifact.py b/bentoml/artifact/h2o_model_artifact.py
--- a/bentoml/artifact/h2o_model_artifact.py
+++ b/bentoml/artifact/h2o_model_artifact.py
@@ -66,6 +66,7 @@
 
     def set_dependencies(self, env: BentoServiceEnv):
         env.add_pip_dependencies_if_missing(['h2o'])
+        env.add_conda_dependencies(['openjdk'])
 
     def _model_file_path(self, base_path):
         return os.path.join(base_path, self.name)

{"golden_diff": "diff --git a/bentoml/artifact/h2o_model_artifact.py b/bentoml/artifact/h2o_model_artifact.py\n--- a/bentoml/artifact/h2o_model_artifact.py\n+++ b/bentoml/artifact/h2o_model_artifact.py\n@@ -66,6 +66,7 @@\n \n     def set_dependencies(self, env: BentoServiceEnv):\n         env.add_pip_dependencies_if_missing(['h2o'])\n+        env.add_conda_dependencies(['openjdk'])\n \n     def _model_file_path(self, base_path):\n         return os.path.join(base_path, self.name)\n", "issue": "When I built a H2O-based image, the following error occurred\n**Describe the bug**\r\nWhen I built a H2O-based image, the following error occurred. From the Dockerfile generated by BentoML, the base image is bentoml/model-server:0.8.1, and JRE is indeed not installed\r\n\r\n\r\nI used service.py to build a bentoML bundle\r\n```python\r\nimport bentoml\r\nfrom bentoml.adapters import DataframeInput\r\nfrom bentoml.artifact import H2oModelArtifact\r\nfrom customize import preprocessing, postprocessing\r\n\r\n\r\n@bentoml.env(auto_pip_dependencies=True)\r\n@bentoml.artifacts([H2oModelArtifact('model')])\r\nclass LoanDefaultPrediction(bentoml.BentoService):\r\n    @bentoml.api(input=DataframeInput())\r\n    def predict(self, df):\r\n        model_input = preprocessing(df)\r\n        model_output = self.artifacts.model.predict(model_input)\r\n        return postprocessing(model_output)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    import h2o\r\n    h2o.init(strict_version_check=False)\r\n    model = h2o.load_model('H2O_AutoML_20200720_153457')\r\n\r\n    model_service = LoanDefaultPrediction()\r\n    model_service.pack(\"model\", model)\r\n\r\n    saved_path = model_service.save()\r\n```\r\nAnd another customize.py to pre process\r\n```python\r\nimport h2o\r\n\r\ndef preprocessing(model_input):\r\n    return h2o.H2OFrame(model_input, na_strings=['NaN'])\r\n\r\n\r\ndef postprocessing(model_output):\r\n    return model_output.as_data_frame()\r\n```\r\n\r\nFinally, After I build service image with this bundle, I run this docker image with below log:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/opt/conda/lib/python3.7/site-packages/gunicorn/arbiter.py\", line 583, in spawn_worker\r\n    worker.init_process()\r\n  File \"/opt/conda/lib/python3.7/site-packages/gunicorn/workers/base.py\", line 119, in init_process\r\n    self.load_wsgi()\r\n  File \"/opt/conda/lib/python3.7/site-packages/gunicorn/workers/base.py\", line 144, in load_wsgi\r\n    self.wsgi = self.app.wsgi()\r\n  File \"/opt/conda/lib/python3.7/site-packages/gunicorn/app/base.py\", line 67, in wsgi\r\n    self.callable = self.load()\r\n  File \"/opt/conda/lib/python3.7/site-packages/bentoml/server/gunicorn_server.py\", line 92, in load\r\n    bento_service = load(self.bento_service_bundle_path)\r\n  File \"/opt/conda/lib/python3.7/site-packages/bentoml/saved_bundle/loader.py\", line 179, in load\r\n    svc = svc_cls()\r\n  File \"/opt/conda/lib/python3.7/site-packages/bentoml/service.py\", line 526, in __init__\r\n    self._load_artifacts(self._bento_service_bundle_path)\r\n  File \"/opt/conda/lib/python3.7/site-packages/bentoml/service.py\", line 734, in _load_artifacts\r\n    packed_artifact = artifact.load(artifacts_path)\r\n  File \"/opt/conda/lib/python3.7/site-packages/bentoml/artifact/h2o_model_artifact.py\", line 79, in load\r\n    h2o.init()\r\n  File \"/opt/conda/lib/python3.7/site-packages/h2o/h2o.py\", line 307, in init\r\n    bind_to_localhost=bind_to_localhost)\r\n  File \"/opt/conda/lib/python3.7/site-packages/h2o/backend/server.py\", line 143, in start\r\n    bind_to_localhost=bind_to_localhost, log_dir=log_dir, log_level=log_level, max_log_file_size=max_log_file_size)\r\n  File \"/opt/conda/lib/python3.7/site-packages/h2o/backend/server.py\", line 276, in _launch_server\r\n    java = self._find_java()\r\n  File \"/opt/conda/lib/python3.7/site-packages/h2o/backend/server.py\", line 441, in _find_java\r\n    raise H2OStartupError(\"Cannot find Java. Please install the latest JRE from\\n\"\r\nh2o.exceptions.H2OStartupError: Cannot find Java. Please install the latest JRE from\r\nhttp://www.oracle.com/technetwork/java/javase/downloads/index.html\r\n```\n", "before_files": [{"content": "# Copyright 2019 Atalaya Tech, Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport shutil\n\nfrom bentoml.artifact import BentoServiceArtifact\nfrom bentoml.exceptions import MissingDependencyException\nfrom bentoml.service_env import BentoServiceEnv\n\n\nclass H2oModelArtifact(BentoServiceArtifact):\n    \"\"\"Abstraction for saving/loading objects with h2o.save_model and h2o.load_model\n\n    Args:\n        name (str): Name for this h2o artifact..\n\n    Raises:\n        MissingDependencyException: h2o package is required to use H2o model artifact\n\n    Example usage:\n\n    >>> import h2o\n    >>> h2o.init()\n    >>>\n    >>> from h2o.estimators.deeplearning import H2ODeepLearningEstimator\n    >>> model_to_save = H2ODeepLearningEstimator(...)\n    >>> # train model with data\n    >>> data = h2o.import_file(...)\n    >>> model_to_save.train(...)\n    >>>\n    >>> import bentoml\n    >>> from bentoml.artifact import H2oModelArtifact\n    >>> from bentoml.adapters import DataframeInput\n    >>>\n    >>> @bentoml.artifacts([H2oModelArtifact('model')])\n    >>> @bentoml.env(auto_pip_dependencies=True)\n    >>> class H2oModelService(bentoml.BentoService):\n    >>>\n    >>>     @bentoml.api(input=DataframeInput())\n    >>>     def predict(self, df):\n    >>>         hf = h2o.H2OFrame(df)\n    >>>         predictions = self.artifacts.model.predict(hf)\n    >>>         return predictions.as_data_frame()\n    >>>\n    >>> svc = H2oModelService()\n    >>>\n    >>> svc.pack('model', model_to_save)\n    \"\"\"\n\n    def __init__(self, name):\n        super(H2oModelArtifact, self).__init__(name)\n\n        self._model = None\n\n    def set_dependencies(self, env: BentoServiceEnv):\n        env.add_pip_dependencies_if_missing(['h2o'])\n\n    def _model_file_path(self, base_path):\n        return os.path.join(base_path, self.name)\n\n    def pack(self, model):  # pylint:disable=arguments-differ\n        self._model = model\n        return self\n\n    def load(self, path):\n        try:\n            import h2o\n        except ImportError:\n            raise MissingDependencyException(\n                \"h2o package is required to use H2oModelArtifact\"\n            )\n\n        h2o.init()\n        model = h2o.load_model(self._model_file_path(path))\n        self._model = model\n        return self\n\n    def save(self, dst):\n        try:\n            import h2o\n        except ImportError:\n            raise MissingDependencyException(\n                \"h2o package is required to use H2oModelArtifact\"\n            )\n\n        h2o_saved_path = h2o.save_model(model=self._model, path=dst, force=True)\n        shutil.move(h2o_saved_path, self._model_file_path(dst))\n        return\n\n    def get(self):\n        return self._model\n", "path": "bentoml/artifact/h2o_model_artifact.py"}], "after_files": [{"content": "# Copyright 2019 Atalaya Tech, Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport shutil\n\nfrom bentoml.artifact import BentoServiceArtifact\nfrom bentoml.exceptions import MissingDependencyException\nfrom bentoml.service_env import BentoServiceEnv\n\n\nclass H2oModelArtifact(BentoServiceArtifact):\n    \"\"\"Abstraction for saving/loading objects with h2o.save_model and h2o.load_model\n\n    Args:\n        name (str): Name for this h2o artifact..\n\n    Raises:\n        MissingDependencyException: h2o package is required to use H2o model artifact\n\n    Example usage:\n\n    >>> import h2o\n    >>> h2o.init()\n    >>>\n    >>> from h2o.estimators.deeplearning import H2ODeepLearningEstimator\n    >>> model_to_save = H2ODeepLearningEstimator(...)\n    >>> # train model with data\n    >>> data = h2o.import_file(...)\n    >>> model_to_save.train(...)\n    >>>\n    >>> import bentoml\n    >>> from bentoml.artifact import H2oModelArtifact\n    >>> from bentoml.adapters import DataframeInput\n    >>>\n    >>> @bentoml.artifacts([H2oModelArtifact('model')])\n    >>> @bentoml.env(auto_pip_dependencies=True)\n    >>> class H2oModelService(bentoml.BentoService):\n    >>>\n    >>>     @bentoml.api(input=DataframeInput())\n    >>>     def predict(self, df):\n    >>>         hf = h2o.H2OFrame(df)\n    >>>         predictions = self.artifacts.model.predict(hf)\n    >>>         return predictions.as_data_frame()\n    >>>\n    >>> svc = H2oModelService()\n    >>>\n    >>> svc.pack('model', model_to_save)\n    \"\"\"\n\n    def __init__(self, name):\n        super(H2oModelArtifact, self).__init__(name)\n\n        self._model = None\n\n    def set_dependencies(self, env: BentoServiceEnv):\n        env.add_pip_dependencies_if_missing(['h2o'])\n        env.add_conda_dependencies(['openjdk'])\n\n    def _model_file_path(self, base_path):\n        return os.path.join(base_path, self.name)\n\n    def pack(self, model):  # pylint:disable=arguments-differ\n        self._model = model\n        return self\n\n    def load(self, path):\n        try:\n            import h2o\n        except ImportError:\n            raise MissingDependencyException(\n                \"h2o package is required to use H2oModelArtifact\"\n            )\n\n        h2o.init()\n        model = h2o.load_model(self._model_file_path(path))\n        self._model = model\n        return self\n\n    def save(self, dst):\n        try:\n            import h2o\n        except ImportError:\n            raise MissingDependencyException(\n                \"h2o package is required to use H2oModelArtifact\"\n            )\n\n        h2o_saved_path = h2o.save_model(model=self._model, path=dst, force=True)\n        shutil.move(h2o_saved_path, self._model_file_path(dst))\n        return\n\n    def get(self):\n        return self._model\n", "path": "bentoml/artifact/h2o_model_artifact.py"}]}