Remote Python Script Snap has the ability to execute a Python script natively on local/remote Python executors. Remote Python Executor (RPE) can be installed either on the same node as the Snaplex or a remote node which is accessible by the Snaplex.
- Establish SSH connection to the node.
- Install Docker CE.
- Create and start RPE container.
SSH to the Node
Establish SSH connection to the node where you want to install the RPE. Root access may be required for the latter steps.
Follow the instructions on the official Docker site to install Docker CE on your machine. Click here for Ubuntu, here for CentOS, and here for Windows. If using Amazon Linux AMI follow the instructions here.
Docker container is an instance created from Docker image. We provide RPE as Docker images which can be found here. Currently, there are 4 tags (types) available.
- min: the minimal version for CPU instances.
- ds: the data science version for CPU instances containing recommended libraries for data science.
- min-cuda9-cudnn7: the minimal version for GPU instances.
- ds-cuda9-cudnn7: the data science version for GPU instances containing recommended libraries for data science.
Below is the list of Python libraries in the ds and ds-cuda9-cudnn7 tags.
ds-cuda9-cudnn7 has tensorflow-gpu==1.11.0 instead of tensorflow==1.5.0.
Execute the following command to start the RPE container data science version:
Execute the following command to start the RPE container minimal version:
Execute the following command to start the RPE container data science version for GPU instance:
Execute the following command to start the RPE container minimal version for GPU instance:
See below for explanation of each option:
|--memory-swap="-1" --restart=always||--memory-swap="<memory_swap_limit>" --restart=always||The container can use unlimited space for memory swapping. See Memory Swap for more information.|
"–restart=always" automatically restarts the docker container if the machine restarts.
|-p 5301:5301||-p <host_port>:5301||The RPE is accessible from host port which is 5301 by default. You may change the host port to support multiple containers on the same node.|
|-e "REMOTE_PYTHON_EXECUTOR_TOKEN="||-e "REMOTE_PYTHON_EXECUTOR_TOKEN=<token>"||The default token is empty. Strong token is recommended.|
|-v /opt/remote_python_executor_log/:/opt/remote_python_executor_log/||-v <log_dir>/opt/remote_python_executor_log/||The log is mounted to /opt/remote_python_executor_log/by default. This location can be changed.|
|--name=rpe||--name=<container_name>||The container's name which can be changed in case of multiple containers on the same node.|
Since the RPE starts with the container, use the following commands to start, stop, restart and remove the RPE.
The custom RPE package can be download here. This package contains Dockerfile and others. You can modify the Dockerfile and add required libraries in requirements.txt. Then, executing the following command to build the Docker image (make sure to cd into the directory containing Dockerfile).
Once the image is built, execute the following command to create and start the custom RPE container.