CloudShell Version: 8.3 GA

Help Version: 1.1

CloudShell
TestShell
Api Guide
View / Download All Help Versions
Online Help
You are here: CloudShell Administration > CloudShell Execution Server Configurations > Setting Up Python Virtual Environments > Configuring CloudShell to Execute Python Commands in Offline Mode

Configuring CloudShell to Execute Python Commands in Offline Mode

This article explains how to set up CloudShell to execute Python driver and script commands in an offline CloudShell environment. In such cases, the Python packages required by the drivers or scripts need to be prepared in a location that is accessible to the computer running the PyPi Server process.

Since the local PyPi Server repository is empty by default, after installing or upgrading CloudShell, the admin must first upload the out-of-the-box packages to the local PyPi Server repository to enable CloudShell to run its out-of-the-box processes, such as Setup and Teardown processes, and cloud provider deployments. The OfflinePackageRepository zip file containing the out-of-the-box packages is available for download from Quali's Download Center.

An offline deployment is any deployment in which the Quali Server and/or the execution servers have no internet connection.

Important: The <PythonOfflineRepositoryPath> configuration key that defines the local offline package folder has been deprecated in CloudShell 8.3. Therefore, when upgrading to CloudShell 8.3 and above, you will need to configure PyPi Server as the mechanism for serving Python dependencies to your Python drivers and scripts. For details, see this article in the CloudShell Suite Installation Guide. To learn more about PyPi Server, see PyPi Server - Managing Python Driver and Script Dependencies.

In this article (perform the procedures that are relevant for you):

Add Python packages to the local PyPi Server repository (offline mode)

If your Quali Server and/or execution servers work offline, you will need to copy all required Python packages, including the out-of-the-box ones, to the PyPi Server's repository on the Quali Server computer (by default: C:\Program Files (x86)\QualiSystems\CloudShell\Server\Config\Pypi Server Repository).

When a driver or script runs, the PyPi Server process running on the Quali Server computer will copy the required dependencies from this folder to the driver or script's virtual environment on the appropriate execution server.

To learn how to do this, see Loading packages to your PyPi Server repository.

Add the out-of-the-box dependencies package to the local PyPi Server repository

This procedure applies to CloudShell deployments in which the Quali Server and/or the execution servers are offline and must be done when installing or upgrading CloudShell.

Some native CloudShell operations require running Python code that uses certain Python packages. These include OOTB CloudShell orchestration, App deployments on private cloud providers and configuration management operations. These dependencies are included in the out-of-the-box dependencies zip package CloudShell provides with every CloudShell release.

To add out-of-the-box dependencies to the local PyPi Server repository:

  1. If you haven't placed the required dependencies in the local PyPi Server repository, perform the steps in Add Python packages to the local PyPi Server repository (offline mode).
  2. Download the out-of-the-box dependencies zip file from the Download Center and extract it to the local PyPi Server repository.

Add Shell and script packages to the local PyPi Server repository

This procedure applies to CloudShell deployments that are either offline or require the use of Python packages that are not in the public PyPi repository.

Shells and scripts running in CloudShell may also rely on packages in the public PyPi Python repository. Therefore, each time you add a Shell or script to CloudShell, to enable your offline execution servers to run this Shell or script, make sure to download its dependent packages and place them in the local PyPi Server repository as well.

To add Python packages to the local PyPi Server repository:

  1. If you haven't created and configured the local PyPi Server repository to work with the execution server, perform the steps in Add Python packages to the local PyPi Server repository (offline mode).
  2. For each Shell or script you add into CloudShell:

    1. From an online computer, do one of the following:

      • Connect to the Internet and download each dependency specified in the requirements.txt file with the following command: 

        pip download -r requirements.txt

        The Shell or script's requirements are downloaded as zip files.

      • In Quali Community’s Integrations page, locate the Shell and click the Shell's Download link. In the page that is displayed, from the Downloads area, extract the dependencies package zip file
    2. Place these zip files in the local PyPi Server repository.

Related Topics