Got "ERROR:root:Failed to get healthz info attempt 1 of 5." when deploy pipeline in the Kubeflow

huangapple go评论93阅读模式
英文:

Got "ERROR:root:Failed to get healthz info attempt 1 of 5." when deploy pipeline in the Kubeflow

问题

我正在尝试按照Kubeflow v2快速入门指南进行操作。

首先,我使用以下命令将Kubeflow部署到本地Kubernetes集群中:

export PIPELINE_VERSION="2.0.0-alpha.4"

kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=$PIPELINE_VERSION"
kubectl wait --for condition=established --timeout=60s crd/applications.app.k8s.io
kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION"

然后,我进行了端口转发操作:

kubectl port-forward service/ml-pipeline-ui --namespace=kubeflow 38620:80

我可以在http://localhost:38620看到UI。

接下来,我安装了kfp 2.0.1,并且这是我的代码:

from kfp import client, dsl

@dsl.component
def addition_component(num1: int, num2: int) -> int:
    return num1 + num2

@dsl.pipeline(name="addition-pipeline")
def my_pipeline(a: int, b: int, c: int = 10):
    add_task_1 = addition_component(num1=a, num2=b)
    add_task_2 = addition_component(num1=add_task_1.output, num2=c)

endpoint = "http://localhost:38620"  # <- 不确定是否正确,因为在快速入门文档中缺少此部分。
kfp_client = client.Client(host=endpoint)
run = kfp_client.create_run_from_pipeline_func(
    my_pipeline,
    arguments={"a": 1, "b": 2},
)
url = f"{endpoint}/#/runs/details/{run.run_id}"
print(url)

然而,我遇到了错误:

python src/main.py

我在endpoint中使用的是http://localhost:38620,但是我不确定是否正确,因为在快速入门文档中缺少此部分。

我尝试访问以下地址:

  • http://localhost:38620/apis/v2beta1/healthz
  • http://localhost:38620/#/apis/v2beta1/healthz

但它们都不存在。

我在https://github.com/kubeflow/kubeflow/issues/5989 上找到了类似的问题,但里面没有有用的信息。

感谢任何指导!

英文:

I am trying to follow the Kubeflow v2 quickstart.

First, I deployed Kubeflow to a local Kubernetes cluster by

export PIPELINE_VERSION=&quot;2.0.0-alpha.4&quot;

kubectl apply -k &quot;github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=$PIPELINE_VERSION&quot;
kubectl wait --for condition=established --timeout=60s crd/applications.app.k8s.io
kubectl apply -k &quot;github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION&quot;

I port forwarded by

kubectl port-forward service/ml-pipeline-ui --namespace=kubeflow 38620:80

I can see the UI at http://localhost:38620

Got "ERROR:root:Failed to get healthz info attempt 1 of 5." when deploy pipeline in the Kubeflow

Next, I installed kfp 2.0.1. And here is my code:

from kfp import client, dsl


@dsl.component
def addition_component(num1: int, num2: int) -&gt; int:
    return num1 + num2


@dsl.pipeline(name=&quot;addition-pipeline&quot;)
def my_pipeline(a: int, b: int, c: int = 10):
    add_task_1 = addition_component(num1=a, num2=b)
    add_task_2 = addition_component(num1=add_task_1.output, num2=c)


endpoint = &quot;http://localhost:38620&quot;  # &lt;- Not entirely sure if it is correct as it is missing in the quickstart document.
kfp_client = client.Client(host=endpoint)
run = kfp_client.create_run_from_pipeline_func(
    my_pipeline,
    arguments={&quot;a&quot;: 1, &quot;b&quot;: 2},
)
url = f&quot;{endpoint}/#/runs/details/{run.run_id}&quot;
print(url)

However, I got error

python src/main.py

/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp/client/client.py:158: FutureWarning: This client only works with Kubeflow Pipeline v2.0.0-beta.2 and later versions.
  warnings.warn(
ERROR:root:Failed to get healthz info attempt 1 of 5.
Traceback (most recent call last):
  File &quot;/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp/client/client.py&quot;, line 435, in get_kfp_healthz
    return self._healthz_api.get_healthz()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp_server_api/api/healthz_service_api.py&quot;, line 63, in get_healthz
    return self.get_healthz_with_http_info(**kwargs)  # noqa: E501
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp_server_api/api/healthz_service_api.py&quot;, line 134, in get_healthz_with_http_info
    return self.api_client.call_api(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp_server_api/api_client.py&quot;, line 364, in call_api
    return self.__call_api(resource_path, method,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp_server_api/api_client.py&quot;, line 188, in __call_api
    raise e
  File &quot;/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp_server_api/api_client.py&quot;, line 181, in __call_api
    response_data = self.request(
                    ^^^^^^^^^^^^^
  File &quot;/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp_server_api/api_client.py&quot;, line 389, in request
    return self.rest_client.GET(url,
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp_server_api/rest.py&quot;, line 230, in GET
    return self.request(&quot;GET&quot;, url,
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp_server_api/rest.py&quot;, line 224, in request
    raise ApiException(http_resp=r)
kfp_server_api.exceptions.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({&#39;X-Powered-By&#39;: &#39;Express&#39;, &#39;Content-Security-Policy&#39;: &quot;default-src &#39;none&#39;&quot;, &#39;X-Content-Type-Options&#39;: &#39;nosniff&#39;, &#39;Content-Type&#39;: &#39;text/html; charset=utf-8&#39;, &#39;Content-Length&#39;: &#39;159&#39;, &#39;Date&#39;: &#39;Mon, 03 Jul 2023 03:59:33 GMT&#39;, &#39;Connection&#39;: &#39;keep-alive&#39;, &#39;Keep-Alive&#39;: &#39;timeout=5&#39;})
HTTP response body: &lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;Error&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;pre&gt;Cannot GET /apis/v2beta1/healthz&lt;/pre&gt;
&lt;/body&gt;
&lt;/html&gt;

Inside for endpoint, I am using http://localhost:38620, However, I am not entirely sure if I am using correct one as it is missing in quickstart document.

I tried to access

  • http://localhost:38620/apis/v2beta1/healthz
  • http://localhost:38620/#/apis/v2beta1/healthz

and they do not exist.

I found a similar issue at https://github.com/kubeflow/kubeflow/issues/5989 but there is not any helpful info inside.

Any guide would be appreciate!

答案1

得分: 1

UPDATE: 我已经提交了一个拉取请求来更新文档。今天应该很好。

我仔细查看了Python脚本日志。它有一行:

> 未来警告:此客户端仅与Kubeflow Pipeline v2.0.0-beta.2及更高版本兼容。

原来Kubeflow v2快速入门已过时。

在我将2.0.0-alpha.4替换为2.0.0之后(您可以在https://github.com/kubeflow/pipelines/releases?q=Version找到最新版本),然后重新部署:

export PIPELINE_VERSION="2.0.0"

kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=$PIPELINE_VERSION"
kubectl wait --for condition=established --timeout=60s crd/applications.app.k8s.io
kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION"

现在流水线脚本成功执行:

python src/main.py

/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp/client/client.py:158: 未来警告此客户端仅与Kubeflow Pipeline v2.0.0-beta.2及更高版本兼容
  警告(
实验详情http://localhost:38620/#/experiments/details/c9d82bc3-712e-422a-804f-fcbe5d2b8acb
运行详情http://localhost:38620/#/runs/details/87398dae-6488-446b-b650-7bbc580aab56
http://localhost:38620/#/runs/details/87398dae-6488-446b-b650-7bbc580aab56

健康端点http://localhost:38620/apis/v2beta1/healthz也返回:

{
  "buildDate": "Tue Jun 20 16:56:00 UTC 2023",
  "frontendCommitHash": "e03e31219387b587b700ba3e31a02df486aa364f",
  "frontendTagName": "2.0.0",
  "apiServerReady": true,
  "apiServerCommitHash": "e03e31219387b587b700ba3e31a02df486aa364f",
  "apiServerTagName": "2.0.0",
  "apiServerMultiUser": false,
  "multi_user": false
}

Got "ERROR:root:Failed to get healthz info attempt 1 of 5." when deploy pipeline in the Kubeflow

英文:

UPDATE: I have opened a pull request to update the document. Today should be good.


I had a closer look of the Python script log. It has a line:

> FutureWarning: This client only works with Kubeflow Pipeline v2.0.0-beta.2 and later versions.

It turns out the Kubeflow v2 quickstart is out-of-date.

After I replaced 2.0.0-alpha.4 to 2.0.0 (You can find latest version at https://github.com/kubeflow/pipelines/releases?q=Version) and redeploy by

export PIPELINE_VERSION=&quot;2.0.0&quot;

kubectl apply -k &quot;github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=$PIPELINE_VERSION&quot;
kubectl wait --for condition=established --timeout=60s crd/applications.app.k8s.io
kubectl apply -k &quot;github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION&quot;

Now the pipeline script succeed:

python src/main.py

/Users/hongbo-miao/Library/Caches/pypoetry/virtualenvs/hm-kubeflow-calculate-PriecqfA-py3.11/lib/python3.11/site-packages/kfp/client/client.py:158: FutureWarning: This client only works with Kubeflow Pipeline v2.0.0-beta.2 and later versions.
  warnings.warn(
Experiment details: http://localhost:38620/#/experiments/details/c9d82bc3-712e-422a-804f-fcbe5d2b8acb
Run details: http://localhost:38620/#/runs/details/87398dae-6488-446b-b650-7bbc580aab56
http://localhost:38620/#/runs/details/87398dae-6488-446b-b650-7bbc580aab56

Got "ERROR:root:Failed to get healthz info attempt 1 of 5." when deploy pipeline in the Kubeflow

The health endpoint http://localhost:38620/apis/v2beta1/healthz also returns

{
  &quot;buildDate&quot;: &quot;Tue Jun 20 16:56:00 UTC 2023&quot;,
  &quot;frontendCommitHash&quot;: &quot;e03e31219387b587b700ba3e31a02df486aa364f&quot;,
  &quot;frontendTagName&quot;: &quot;2.0.0&quot;,
  &quot;apiServerReady&quot;: true,
  &quot;apiServerCommitHash&quot;: &quot;e03e31219387b587b700ba3e31a02df486aa364f&quot;,
  &quot;apiServerTagName&quot;: &quot;2.0.0&quot;,
  &quot;apiServerMultiUser&quot;: false,
  &quot;multi_user&quot;: false
}

huangapple
  • 本文由 发表于 2023年7月3日 13:15:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76601980.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定