无法从 Vertex AI Pipelines 运行 gcloud run deploy
我一直在尝试将模型部署到云运行,但不断收到权限错误。尝试使用所有可用的建议和答案,但没有成功。最终授予所有者访问服务帐户的权限,但没有成功。
我正在尝试做的事情的屏幕截图。
代码
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.
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
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论