Google CloudML服务是否允许连接到NoSQL数据库,例如数据存储区?

问题描述 投票:1回答:1

[我们有一个当前在Cloud ML上使用的模型。作为修改,我们向数据存储区添加了连接,该连接返回403,权限不足。

产生错误的模拟代码是:

    from google.cloud import datastore
    import datetime
    # create & upload task
    client = datastore.Client()
    key = client.key('Task')
    task = datastore.Entity(
        key, exclude_from_indexes=['description'])

    task.update({
        'created': datetime.datetime.utcnow(),
        'description': 'description',
        'done': False
    })

    client.put(task)

    # now list tasks
    query = client.query(kind='Task')
    query.order = ['created']
    return list(query.fetch())

下一步将是添加凭据(服务帐户)并将新路径导出到GOOGLE_APPLICATION_DEFAULT参数。但是,由于很难获得该帐户(公司分层),因此我想通过提问来节省时间。

是通过Cloud Functions与NoSQL DB通信的唯一方法吗?这是常用的方法吗?

google-cloud-ml
1个回答
0
投票
gcloud components install beta gcloud beta ai-platform versions create your-version-name \ --service-account your-service-account-name@your-project-id.iam.gserviceaccount.com ...
© www.soinside.com 2019 - 2024. All rights reserved.