Creating a Notebook Session
Create a Data Science notebook session to access a JupyterLab interface that uses a customizable compute, storage, and network configuration.
Before You Begin
To use a runtime configuration, identify the custom environment variables and any Git repository URLs that you want you want to use.
The network configuration of a notebook session can't be changed when the notebook session is reactivated. If a notebook session was configured to use a default network, you can't deactivate the notebook session then select custom networking when you reactivate it.
Networking Setup for Using Oracle Managed Features
To use any of the Oracle managed features inside the Notebook, Notebook Lifecycle Scripts, AI Quick Actions, Environment Explorer and Example Notebooks, the Notebook subnet must have permissions to access OCI Object Storage.
If you select Default Networking for your Notebook, your Notebook subnet has access to Object Storage. If you select Custom Networking, you need to set up Object Storage access with either the Service Gateway or Nat Gateway. You can set up Service Gateway to access all services or region specific Object Storage. For more information, see Creating a Service Gateway and Overview of Service Gateways in the Networking documentation. Or, you can set up the Nat Gateway to allow public internet access. For more information, see Nat Gateway in the Networking documentation.
If you use Internet Gateway, you can't connect to the public internet with your Notebook. This is because the Internet Gateway expects the resources behind it to be a public subnet with public IPs which Data Science Notebooks don't use. Nor is the Notebook going to work with connecting to Oracle managed features.
Setting up Storage Mounts
To use storage mounts, you must have an Object Storage bucket or OCI File Storage Service (FSS) mount target and export path.
To use FSS, you must first create the file system and the mount point. Use the custom networking option and ensure that the mount target and the notebook are configured with the same subnet. Configure security list rules for the subnet with the specific ports and protocols.
Ensure that service limits are allocated to file-system-count and mount-target-count.
You must set up policies to use either Object Storage or File Storage Service (FSS) for storage mounts in the notebook.
Using OCI File Storage
Set up Storage Mounts when using OCI File Storage.
Setting Up Storage Mounts
Using OCI Object Storage
Set up Storage Mounts when using OCI Object Storage.
Storage mounts for Object Storage use resource principals based authorization to communicate between notebook and required bucket.
To use the default network option for a notebook, the managed egress works without the need to configure any extra network rules.
To use the custom network option for a notebook, some more network setup is required.
Setting Up Storage Mounts
- In the choice of your VCN, create the service gateway.
-
For the required private subnet, add
Service Gatewayto the route table configurations. - Change the egress rules of security list of the required subnet to allow traffic to all services in the regional Oracle network.
Using the Console, CLI, or API
We recommend that you review Persisting Data and Files on a Notebook Session Block Volume to help decide the block volume size.
1. Basic Information
Optionally change identifying information.
- Compartment: Select the compartment to create the notebook session in.
- Name (Optional): Enter a unique name for the notebook session (limit of 255 characters). If you don't provide a name, a name is automatically generated. For example,
datasciencenotebooksession20200108222435. - Tags (Optional): Add tags to the notebook session. If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.
2. Configuration
Specify the Compute shape and networking setup.
- Shape (Optional): Change the Compute shape by selecting Change shape. Then, follow these steps in the Select compute shape panel.
- Select an instance type.
- Select a shape series.
- Select one of the supported Compute shapes in the series. Select the shape that best suits how you want to use the resource.
- Expand the selected shape to configure OCPUs and memory.
- Number of OCPUs
- Amount of memory (GB): For each OCPU, select up to 64 GB of memory and a maximum total of 512 GB. The minimum amount of memory allowed is either 1 GB or a value matching the number of OCPUs, whichever is greater.
- Enable Burstable Shape: Select if using burstable VMs, and then for Baseline utilization per OCPU, select the percentage of OCPUs that you usually want to use. The supported values are 12.5% and 50%. (For model deployments, only the value of 50% is supported.)
- Select Select shape.
- Block storage size: Enter the block storage size to use, between 50 GB and 10, 240 GB (10 TB). You can change the value by 1 GB increments. The default value is 100 GB.
- Networking type: Select the relevant option.
-
Default networking—The workload is attached by using a secondary VNIC to a preconfigured, service-managed VCN, and subnet. This provided subnet allows egress to the public internet through a NAT gateway, and access to other Oracle Cloud services through a service gateway.
If you need access only to the public internet and OCI services, we recommend using this option. It doesn't require you to create networking resources or write policies for networking permissions.
-
Custom networking—Select the VCN and subnet (from the indicated compartment) that you want to use for the resource (notebook session or job).
For egress access to the public internet, use a private subnet with a route to a NAT gateway.
If you don't see the VCN or subnet that you want to use, select a different compartment.
Important
To use a file storage mount, you must select custom networking. The VCN and subnet must be the same as those used for the creation of the mount target.
Note
The network configuration of a notebook session can't be changed when the notebook session is reactivated. If a notebook session was configured to use a default network, you can't deactivate the notebook session then select custom networking when you reactivate it. -
- Endpoint type: Select the relevant option.
- Public endpoint—Data access in a managed instance from outside a VCN.
- Private endpoint—Select the VCN, subnet, and private endpoint (from the indicated compartment) that you want to use for the notebook session.
3. Additional configuration
Optionally add storage mounts, runtime configuration, and tags.
- File storage mounts (Optional): Select Add file storage mount and enter the following information.
- Compartment: Select the compartment that contains the target that you want to mount.
- Mount target: The mount target that you want to use.
- Export path: The export path that you want to use.
- Destination path and directory: Enter the path to use for mounting the storage.
The path must start with an alphanumeric character. The destination directory must be unique across the storage mounts provided. The allowed characters are alphanumerics, hyphen ( - ) and underscore ( _ ).
You can specify the full path, such as
/opc/storage-directory. If only a directory is specified, such as/storage-directory, then it's mounted under the default/mntdirectory. You can't specify OS specific directories, such as/binor/etc.
- Object storage mounts (Optional): Select Add object storage mount and enter the following information.
- Compartment: Select the compartment that contains the bucket that you want to mount.
- Bucket: Select the bucket that you want to use.
- Object name prefix (Optional): Object name prefix. The prefix must start with an alphanumeric character. The allowed characters are alphanumerics, slash ( / ), hyphen ( - ) and underscore ( _ ).
- Destination path and directory: Enter the path to use for mounting the storage.
The path must start with an alphanumeric character. The destination directory must be unique across the storage mounts provided. The allowed characters are alphanumerics, hyphen ( - ) and underscore ( _ ).
You can specify the full path, such as
/opc/storage-directory. If only a directory is specified, such as/storage-directory, then it's mounted under the default/mntdirectory. You can't specify OS specific directories, such as/binor/etc.
Note
If using custom networking:- Create the service gateway in the VCN.
- For the route table configurations in the private subnet, add the service gateway.
- Change the egress rules of security list of the required subnet to let traffic to all services in the network.
- Runtime configuration (Optional): Define custom environment variables (key-value pairs) and Git settings.
- Key value pairs: Select Add key value pair and enter a key and value. Up to 30 key value pairs can be added. To name keys, see key value pair constraints.
- Git settings: Select Add Git setting and enter a public Git repository URL. Up to 3 Git repositories can be added. Review the Git repository constraints for number and size of the URLs.Tip
You can use the ADS repository example to quickly create a Git repository for a notebook that you can use when you open it in JupyterLab. See https://github.com/oracle/accelerated-data-science.git.
- Tags (Optional): Add tags to the notebook session. If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.
4. Review and Create
Review configuration and then select Create.
The notebook sessions page opens. When the notebook session is successfully created, the status turns to Active, and you can open the notebook session. The create notebook session action is asynchronous and starts a work request. You can use the work request to track the status of an operation.
For general information about using work requests in OCI, see Work Requests.
Use the oci data-science notebook-session create commands and required parameters to create a notebook session in a compartment:
oci data-science notebook-session create --compartment-id <compartment-id>, -c [<name>], -c [<project-id>] ... [OPTIONS]For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the CreateNotebookSession operation to create a notebook session.