Configuring CloudShell to Execute Python Commands in Offline Mode

When a Python driver or script runs in CloudShell, the local PyPi Server process downloads the Python packages it needs from the online public PyPi repository and places them in the driver or script's virtual environment on the execution server.

PyPi Server is installed on the Quali Server machine and requires an internet connection, so if Quali Server and/or the execution servers work offline, you will need to copy all required Python packages, including the out-of-the-box ones, to the local PyPi Server repository on the Quali Server computer. 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. For additional information, see Loading packages to your PyPi Server repository.

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 Migrate Python Dependencies to PyPi Server. 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