MicroStrategy ONE

Create and Edit Python Runtimes

MicroStrategy ONE (June 2024) adds support for multi-tenant Python in un-containerized MicroStrategy Cloud Environments (MCE). Contact MicroStrategy Support to enable the feature.

Python scripts normally run on a user’s computer. Newer containerized environments allow you to run scripts directly in a MicroStrategy environment without the need to leave a computer running. You can save your scripts in these environments and access them anywhere within Workstation, as well as provide access to other administrators.

You must have the Manage runtime privilege and your environment must support Python server-side script execution. Currently, the support of server-side script execution is turned on for containerized environments only.

  1. Open the Workstation window and connect to an environment.
  2. In the Navigation pane, click Monitors.

  3. In the left pane, click Runtimes.

    Here you can see and manage currently existing runtimes. All environments have a default runtime with mstrio package installed. When creating a runtime you can manage its name, description, Python version, addresses it can connect to, packages installed on it, and size for script execution, script execution timeout, and the cached and maximum instance number.

  4. A default runtime is available. It is named (Default) MicroStrategy:

    1. The default runtime includes the latest versions of both Python and mstrio packages, as well as a default instance size and a default network access configuration. You can use mstrio package to access MicroStrategy data using the default runtime.

    2. The default runtime is a simplified sample if you want a trial without updating the configuration. You can create a new dedicated runtime using the steps below to customize the configuration such as the instance size, network access, or package configuration.

Create a Python Runtime

  1. In Runtimes, click Create a new runtime.

  2. In the runtime dialog, enter values in the following fields:

    • Name

    • Description

    • Python Version

    • Runtime Instance Size

    • Network Access: The network or library URL to connect by default from the Python runtime.

      MicroStrategy supports the following formats:

    • Package: The Python packages to be installed in the Python runtime. The latest version will be installed if the package version is not provided.

  3. Click OK. Wait for the runtime installation to finish.

  4. Refresh the page to check the status. Normally, the runtime creation process will take several minutes, depending on Python package size to install. If no customized package is needed, it will be ready within one minute.

Edit Python Runtime Settings

  1. Right-click the runtime and choose Properties.

  2. Click All Settings.

  3. Edit the following fields, as needed:

    • Script timeout(sec): This setting determines the timeout for executing Python scripts. The default value is 600 seconds.

    • Default Pod instance number: This setting determines the default number of cached Python execution instances. Once a pod instance is cached, it will exist long to avoid warm-up costs. Otherwise, the pod instance will be recycled after two minutes of idle time.

    • Maximum Pod instance number(total run scripts limits): This setting determines the maximum number of Python execution instances that can be created based on the runtime.

  4. Click OK.

Multi-Tenant Python Limits

Single-tenant Python is one component of MicroStrategy Containerized Environment shipped to customer.

Starting in MicroStrategy ONE (June 2024), multi-tenant Python is available on MicroStrategy Managed Cloud Service and you can connect to this environment after on-boarding process maintained by MicroStrategy Cloud Team.

  • In a multi-tenant environment, the maximum allowed Script timeout value is set to 3600 seconds (equivalent to 1 hour). Any value that exceeds 3600 seconds will automatically adjust to the maximum value of 3600 seconds.

  • In a multi-tenant environment, the cached pod instance will remain preserved for 30 minutes while it is in an idle state. Single-tenant Python has no limit.

  • The Default Library whitelist. To allow the whitelist in multi-tenant Python, the library address should be a public IP. Otherwise, it cannot be resolved by a multi-tenant Python environment.