RapidCanvas Docs
  • Welcome
  • GETTING STARTED
    • Quick start guide
    • Introduction to RapidCanvas
    • RapidCanvas Concepts
    • Accessing the platform
  • BASIC
    • Projects
      • Projects Overview
        • Creating a project
        • Reviewing the Projects listing page
        • Duplicating a Project
        • Modifying the project settings
        • Deleting Project(s)
        • Configuring global variables at the project level
        • Working on a project
        • Generating the about content for the project
        • Generating AI snippets for each node on the Canvas
        • Marking & Unmarking a Project as Favorite
      • Canvas overview
        • Shortcut options on canvas
        • Queuing the Recipes
        • Bulk Deletion of Canvas Nodes
        • AI Guide
      • Recipes
        • AI-assisted recipe
        • Rapid model recipe
        • Template recipe
        • Code Recipe
        • RAG Recipes
      • Scheduler overview
        • Creating a scheduler
        • Running the scheduler manually
        • Managing schedulers in a project
        • Viewing the schedulers in a project
        • Viewing the run history of a specific scheduler
        • Publishing the updated data pipeline to selected jobs from canvas
        • Fetching the latest data pipeline to a specific scheduler
        • Comparing the canvas of the scheduler with current canvas of the project
      • Predictions
        • Manual Prediction
        • Prediction Scheduler
      • Segments and Scenarios
      • DataApps
        • Model DataApp
        • Project Canvas Datasets
        • Custom Uploaded Datasets
        • SQL Sources
        • Documents and PDFs
        • Prediction Service
        • Scheduler
        • Import DataApp
    • Connectors
      • Importing dataset(s) from the local system
      • Importing Text Files from the Local System
      • Connectors overview
      • Connect to external connectors
        • Importing data from Google Cloud Storage (GCS)
        • Importing data from Amazon S3
        • Importing data from Azure Blob
        • Importing data from Mongo DB
        • Importing data from Snowflake
        • Importing data from MySQL
        • Importing data from Amazon Redshift
        • Importing data from Fivetran connectors
    • Workspaces
      • User roles and permissions
    • Artifacts & Models
      • Adding Artifacts at the Project Level
      • Adding Models at the Project Level
      • Creating an artifact at the workspace level
      • Managing artifacts at the workspace level
      • Managing Models at the Workspace Level
      • Prediction services
    • Environments Overview
      • Creating an environment
      • Editing the environment details
      • Deleting an environment
      • Monitoring the resource utilization in an environment
  • ADVANCED
    • Starter Guide
      • Quick Start
    • Setup and Installation
      • Installing and setting up the SDK
    • Helper Functions
    • Notebook Guide
      • Introduction
      • Create a template
      • Code Snippets
      • DataApps
      • Prediction Service
      • How to
        • How to Authenticate
        • Create a new project
        • Create a Custom Environment
        • Add a dataset
        • Add a recipe to the dataset
        • Manage cloud connection
        • Code recipes
        • Display a template on the UI
        • Create Global Variables
        • Scheduler
        • Create new scenarios
        • Create Template
        • Use a template in a flow notebook
      • Reference Implementations
        • DataApps
        • Artifacts
        • Connectors
        • Feature Store
        • ML model
        • ML Pipeline
        • Multiple Files
      • Sample Projects
        • Model build and predict
  • Additional Reading
    • Release Notes
      • April 21, 2025
      • April 01, 2025
      • Mar 18, 2025
      • Feb 27, 2025
      • Jan 27, 2025
      • Dec 26, 2024
      • Nov 26, 2024
      • Oct 24, 2024
      • Sep 11, 2024
        • Aug 08, 2024
      • Aug 29, 2024
      • July 18, 2024
      • July 03, 2024
      • June 19, 2024
      • May 30, 2024
      • May 15, 2024
      • April 17, 2024
      • Mar 28, 2024
      • Mar 20, 2024
      • Feb 28, 2024
      • Feb 19, 2024
      • Jan 30, 2024
      • Jan 16, 2024
      • Dec 12, 2023
      • Nov 07, 2023
      • Oct 25, 2023
      • Oct 01, 2024
    • Glossary
Powered by GitBook
On this page
  • Available configurations
  • Parameters
  • Deleting an environment
  • Editing the environment details
  • Fetching all environments in a tenant
  • Searching for an environment by name or ID
  • Viewing the list of supported environments
  • Fetching resources from a specific environment type
  1. ADVANCED
  2. Notebook Guide
  3. How to

Create a Custom Environment

import sys

from utils.rc.client.requests import Requests
from utils.rc.client.auth import AuthClient

from utils.rc.dtos.env import Env
from utils.rc.dtos.env import EnvType

import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
#Requests.setRootHost("http://staging.dev.rapidcanvas.net/api/")
AuthClient.setToken(token="")

Available configurations

A custom environment allows you to choose the infrastructure you need to execute your project. Here are the available custom environments and their usage guidelines:

  • SMALL: 1 Core, 2GB Memory

  • MEDIUM: 2 Cores, 4GB Memory

  • LARGE: 4 Cores, 8GB Memory

  • CPU_LARGE: 8 Cores, 16GB Memory

  • MAX_LARGE: 12 Cores, 32GB Memory

  • EXTRA_MAX_LARGE: 12 Cores, 48GB Memory

env = Env.createEnv(
    name="new_custom_env", #pick a name for your env
    description="env for my projects",
    envType=EnvType.SMALL, #pick one of the predefined configs
    requirements="jq==1.2.2 yq==3.0.2" #additional packages to be installed for your custom environment
)
env.id

Parameters

Parameter name
Parameter description
Data type
Required
Example

name

The name of the environment.

String

Yes

new_custom_env1

description

The description for the environment.

String

No

env for my projects

envType

The hardware requirements for the environment. Possible values: SMALL, MEDIUM, LARGE, CPU_LARGE, MAX_LARGE, EXTRA_MAX_LARGE

String

Yes

If you are selecting the hardware requirement as SMALL: 1 core, 2GB memory, then you must enter EnvType.SMALL.

requirements

The additional packages to install for the custom environment.

No

jq==1.2.2 yq==3.0.2

Deleting an environment

The following code block must be used to delete an environment.

Env.deleteEnvById('envId')

Example code block for deleting an environment:

Env.deleteEnvById('4e8a8033-db43-4720-9309-ac0fce9163be')

Editing the environment details

Use this code block to modify environment details of a specific environment. You must pass the environment ID for which you want to modify the environment details.

Sample code:

env = Env.updateEnv(
        envId='4dae540d-1717-4b87-8c1e-e60357c7f7f4',
        description="env for my projects4353",
        envType=EnvType.SMALL, #pick one of the pre-defined configs
        requirements="jq==1.2.2 yq==3.0.2" #additional packages to be installed for your custom env
)

Example response:

INFO:Updating environment, this may take few minutes
INFO:Environment is updated.

Fetching all environments in a tenant

The following code block can be used to fetch all environments.

Env.getAllEnvs()

Example response:

{'new_custom_env1232eddd': <utils.rc.dtos.env.Env at 0x7f295d722e60>,
 'new_custom_env12234': <utils.rc.dtos.env.Env at 0x7f295d721000>,
 'new_custom_env1': <utils.rc.dtos.env.Env at 0x7f296e9970a0>,
 'new_custom_envtest1': <utils.rc.dtos.env.Env at 0x7f2929159000>,
 'new_custom_env12': <utils.rc.dtos.env.Env at 0x7f292915b460>,
 'new_custom_env': <utils.rc.dtos.env.Env at 0x7f2929159600>,
 'test_max_large': <utils.rc.dtos.env.Env at 0x7f2929305060>,
 'new_custom_env122': <utils.rc.dtos.env.Env at 0x7f2929304730>,
 'new_custom_envtest': <utils.rc.dtos.env.Env at 0x7f2929305150>}

Searching for an environment by name or ID

Use this code to search for an environment by its name.

env.getEnvByName('name')

Example code:

env.getEnvByName('new_custom_env12')

Use this code to search for an environment by its ID.

env.getEnvById('envId')

Example code:

env.getEnvById('4dae540d-1717-4b87-8c1e-e60357c7f7f4')

Viewing the list of supported environments

Use this code to fetch the list of supported environment types.

env.getEnvTypeInfo()

Example response:

{<EnvType.EXTRA_SMALL: 'EXTRA_SMALL'>: {'cores': 1, 'memory': 1},
 <EnvType.SMALL: 'SMALL'>: {'cores': 1, 'memory': 2},
 <EnvType.MEDIUM: 'MEDIUM'>: {'cores': 2, 'memory': 4},
 <EnvType.LARGE: 'LARGE'>: {'cores': 4, 'memory': 8},
 <EnvType.CPU_LARGE: 'CPU_LARGE'>: {'cores': 8, 'memory': 16},
 <EnvType.MAX_LARGE: 'MAX_LARGE'>: {'cores': 12, 'memory': 32},
 <EnvType.EXTRA_MAX_LARGE: 'EXTRA_MAX_LARGE'>: {'cores': 12, 'memory': 48},
 <EnvType.SUPER_LARGE: 'SUPER_LARGE'>: {'cores': 12, 'memory': 96}}

Fetching resources from a specific environment type

Use this code to fetch the resources such as cores and memory in a specific environment type.

env.getResourcesFromEnvType(envType)

Example code:

env.getResourcesFromEnvType('CPU_LARGE')

Example response:

(8, 16)
PreviousCreate a new projectNextAdd a dataset

Last updated 1 month ago