Giter Club home page Giter Club logo

python-quickstart-cloud's Introduction

Quickstart in Couchbase Cloud with Python

Prerequisites

How to Run

  • Create Couchbase Cloud Account.

  • Connect your Cloud to Couchbase Cloud to create the Virtual Private Cloud (VPC) to manage the clusters in your cloud. Currently, AWS & Azure are supported. This operation will take a few minutes to finish.

  • Generate an API Key (Access Key and Secret) for the Couchbase Cloud Account. This is used by the script to create the cluster in the following steps.

  • Install the dependencies for the script

    pip install -r requirements.txt

  • Setup the environment variables to bootstrap the cloud settings. This can be done by copying the .env.example file and filling it out the variables.

Variables and their description

CBC_ACCESS_KEY: API Access Key for the Couchbase Cloud Account
CBC_SECRET_KEY: API Secret Key for the Couchbase Cloud Account
CBC_URL: The end point for the Couchbase Cloud API. It should be https://cloudapi.cloud.couchbase.com unless it changes
CBC_PROJECT: Name of the project to be created in Couchbase Cloud
CBC_CLUSTER: Name of the cluster to be created in Couchbase Cloud
USERNAME: Username of the Database User to be created in Couchbase Cloud
PASSWORD: Password of the Database User to be created in Couchbase Cloud
BUCKET: Set to `couchbasecloudbucket` the default bucket in Couchbase Cloud. If this is changed, the bucket needs to be created on Couchbase Cloud before running the script.
COLLECTION: Set to `_default` until Couchbase 7 is released on Cloud
SCOPE: Set to `_default` until Couchbase 7 is released on Cloud
  • Run the script cloud_bootstrap.py. The script perfroms the following functionality

    • Check if the cloud (AWS/Azure) is connected to the Couchbase Cloud account.
    • Create the project in Couchbase Cloud account.
    • Create the cluster in the project in Couchbase Cloud account. This process will take a bit of time (upto 30 minutes) as the resources are being created in your cloud.
    • Enable access to the cluster from everywhere.
    • Create the Database Users to access the Cluster.
    • Optionally, you can also delete the cluster by uncommenting the relevant part of the code and inserting the cluster id manually.
  • The script will output the URL to access the Cluster in the end. This can be used to connect to the Cluster running in Couchbase Cloud from your machine. Additionally, the cloud, project and cluster ids are also printed on the console after their creation. Example:Database access URL: cc260b0d-0aba-4038-a846-442d9279117c.dp.cloud.couchbase.com

How to Proceed

  • You can run the flask application app.py after adding the DB_HOST to the .env file with the URL obtained in the bootstrap process.

  • For more detailed instructions on the application, please check README_APP.md

Known Issues

  • The first cloud connected to the account is used.
  • The instances created are hardcoded to AWS m5.xlarge. All of them will run the data, query and index services.
  • If multiple clusters are associated with the same project, only the first cluster will be used by the script.
  • The cluster is accessible from any IP.

Notes

  • The Couchbase Cloud is free to try but the resources being used from your cloud provider are charged by your cloud provider.

python-quickstart-cloud's People

Contributors

nithishr avatar

Watchers

Steve Yen avatar Sarath Lakshman avatar Jeffry Morris avatar Priya Rajagopal avatar James Cloos avatar Brett Lawson avatar Jack Harper avatar Wayne Siu avatar  avatar Dan Owen avatar Dave Finlay avatar  avatar Adam Fraser avatar Keshav Murthy avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.