diff --git a/notebooks/README.md b/notebooks/README.md index 4ae67189085..568e548c807 100644 --- a/notebooks/README.md +++ b/notebooks/README.md @@ -1,20 +1,52 @@ -# Notebook Tutorials +# AI Platform Notebooks -This directory contains Jupyter notebook tutorials for Google Cloud Platform. -The tutorials assume you have performed the following steps: +[AI Platform Notebooks](https://cloud.google.com/ai-platform-notebooks) +is a managed service that offers an integrated and secure JupyterLab +environment for data scientists and machine learning developers to +experiment, develop, and deploy models into production. -1. Install Jupyter notebooks ([instructions](https://jupyter.org/install)) +This directory contains AI Platform Notebooks code samples and +tutorials. The tutorials are divided into 2 sections: +- AI Platform Notebooks [API code samples](samples) +- AI Platform Notebooks [tutorials](tutorials) + +## Notebooks API + +In [this](samples) folder you will find Python code samples to interact +with the +[AI Platform Notebooks API](https://cloud.google.com/ai-platform/notebooks/docs/reference/rest) + +## AI Platform Notebooks tutorials + +**Run in AI Platform Notebooks** + +1. Create a Notebook + [instance](https://cloud.google.com/ai-platform/notebooks/docs#how-to) +2. Clone this repository via Jupyter console or using the Git clone + button + +```bash +git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git +``` + +3. Open the tutorials folder and open the Jupyter notebooks + + +**Run locally** + +1. Install Jupyter notebooks + ([instructions](https://jupyter.org/install)) 1. Install the dependencies in the [requirements.txt](./requirements.txt) file ([instructions below](#install-the-dependencies)) 1. Registered the `google-cloud-bigquery` magic commands ([instructions below](#register-magics-and-configure-matplotlib)) 1. Set `matplotlib` to render inline ([instructions below](#register-magics-and-configure-matplotlib)) -## Install the dependencies +### Install the dependencies Install the dependencies with the following command: pip install --upgrade -r requirements.txt -## Register magics and configure matplotlib +### Register magics and configure matplotlib You can either perform these set up steps in a single notebook, or add the steps to your IPython configuration file to apply to all notebooks. diff --git a/notebooks/samples/README.md b/notebooks/samples/README.md new file mode 100644 index 00000000000..ba2696212f4 --- /dev/null +++ b/notebooks/samples/README.md @@ -0,0 +1,39 @@ +# AI Platform Notebooks API code samples + +Sample command-line programs for interacting with the Notebooks API. + +## Prerequisites to run locally: + +* [Python 3](https://www.python.org/downloads/) +* [pip](https://pypi.python.org/pypi/pip) + +Go to the [Google Cloud Console](https://console.cloud.google.com). + +Under API Manager, search for the Google Cloud Notebooks API and enable +it. You can also enable API via Command Line: + +```bash +gcloud services enable notebooks.googleapis.com +``` + +## Set Up Your Local Dev Environment + +To install, run the following commands. If you want to use +[virtualenv](https://virtualenv.readthedocs.org/en/latest/) +(recommended), run the commands within a virtualenv. + +```bash +pip install -r requirements.txt +``` + +**Note:** While this sample demonstrates interacting with Notebooks via +the API, the functionality demonstrated here could also be accomplished +using the Cloud Console or the +[gcloud CLI](https://cloud.google.com/sdk/gcloud/reference/beta/notebooks) + +## Authentication + +Please see the +[Google cloud authentication guide](https://cloud.google.com/docs/authentication/). +The recommended approach to running these samples is a Service Account +with a JSON key. diff --git a/notebooks/samples/requirements-test.txt b/notebooks/samples/requirements-test.txt new file mode 100644 index 00000000000..7e2ff41603d --- /dev/null +++ b/notebooks/samples/requirements-test.txt @@ -0,0 +1 @@ +pytest==5.3.2 \ No newline at end of file diff --git a/notebooks/samples/requirements.txt b/notebooks/samples/requirements.txt new file mode 100644 index 00000000000..3fe36269e29 --- /dev/null +++ b/notebooks/samples/requirements.txt @@ -0,0 +1 @@ +google-api-python-client>=1.8.2 \ No newline at end of file