Online Help

This help article applies to CloudShell 9.3. To see the latest, click here.

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 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:

  • Download the out-of-the-box dependencies zip file from the Download Center and extract it to the local PyPi Server repository (by default: C:\Program Files (x86)\QualiSystems\CloudShell\Server\Config\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 (do this 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