无法从 Vertex AI Pipelines 运行 gcloud run deploy

发布于 2025-01-10 15:06:26 字数 1180 浏览 5 评论 0原文

我一直在尝试将模型部署到云运行,但不断收到权限错误。尝试使用所有可用的建议和答案,但没有成功。最终授予所有者访问服务帐户的权限,但没有成功。

我正在尝试做的事情的屏幕截图。

输入图片此处描述

代码

storage_client = storage.Client()

bucket = storage_client.get_bucket(bucket_name)
blobs = bucket.list_blobs(prefix=prefix)  # Get list of files
for blob in blobs:
    filename = blob.name
    if not filename.endswith("/"):
        blob.download_to_filename(dl_dir+filename.split("/")[-1])  # Download

bucket = storage_client.get_bucket(tar_path.split("/")[0])
blob = bucket.blob("/".join(tar_path.split("/")[1:]))
blob.download_to_filename("/tmp/model_serving/model.pth.tar")

os.chdir("/tmp/model_serving/")
print("############### ", os.listdir())

os.system("gcloud run deploy --port 5050 --allow-unauthenticated --region us-central1 darts-rnn-from-pipeline --source .")   

我收到的

错误在此处输入图像描述

我能够在管道外运行该命令,不会出现任何错误。 我还能够在管道内运行存储和 bq 客户端,不会出现任何错误。 但只有这个命令我无法运行。

I have been trying to deploy a model to cloud run but I am continuously getting a permission error. Tried using all the available suggestions and answers but had no success. Finally gave the owner access to the service accounts but no success.

screenshot of what I am trying to do.

enter image description here

the code

storage_client = storage.Client()

bucket = storage_client.get_bucket(bucket_name)
blobs = bucket.list_blobs(prefix=prefix)  # Get list of files
for blob in blobs:
    filename = blob.name
    if not filename.endswith("/"):
        blob.download_to_filename(dl_dir+filename.split("/")[-1])  # Download

bucket = storage_client.get_bucket(tar_path.split("/")[0])
blob = bucket.blob("/".join(tar_path.split("/")[1:]))
blob.download_to_filename("/tmp/model_serving/model.pth.tar")

os.chdir("/tmp/model_serving/")
print("############### ", os.listdir())

os.system("gcloud run deploy --port 5050 --allow-unauthenticated --region us-central1 darts-rnn-from-pipeline --source .")   

error I am getting

enter image description here

I am able to run the command outside the pipeline without any errors.
I am also able to run the storage and bq clients inside the pipeline without any errors.
But only this command I am not able to run.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文