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 not internet connection.
Important: If you have the
<PythonOfflineRepositoryPath> configuration key enabled, it will continue working. However, since it will be deprecated in CloudShell 8.3, when upgrading to CloudShell 8.3 and above, you will need to copy your offline python dependencies to your local PyPi Server repository. For details about the migration process, see this CloudShell Suite Installation Guide article. For details about PyPi Server, see PyPi Server - Managing Python Driver and Script Dependencies.
In this article (perform the procedures that are relevant for you):
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.
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:
- 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).
- Download the out-of-the-box dependencies zip file from the Download Center and extract it 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:
- If you haven't created and configured the local PyPi Server repository to work with the execution server, perform the suitable procedure: Add Python packages to the local PyPi Server repository (offline mode) or Configuring CloudShell to Execute Python Commands in Offline Mode.
For each Shell or script you add into CloudShell:
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's Developer Center, 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
- Place these zip files in the local PyPi Server repository.