D. Deploy using Podman (RHEL)#

This guide helps you deploy a Datasite server on your local machine or a virtual machine hosted in the cloud that is running a Redhat distribution.

Prerequistes#

If you encounter issues installing podman, please refer to the Troubleshooting guide to resolve common issues we have noticed while installing Podman in Redhat based systems.

Test Podman works#

To test your prerequisites were properly installed, try to run:

podman ps

This should not return any error. If it does, please check you have the right permissions to run Podman commands.

Server Deployment#

A one-liner convenience script is provided to launch your server using Docker. You can read the script before executing it.

Step 1: Download script#

Downloaded it as follows:

curl -o setup.sh https://raw.githubusercontent.com/OpenMined/PySyft/syft-setup-script/scripts/podman-setup.sh

Step 2: Execute script#

To deploy your server, a range of arguments are available to setup the type of server you would like to launch and its profile:

  • --version or -v: version of PySyft you’d like to setup

  • --name or -n: an arbitrary name you’d like to give the server

  • --side or -s: high or low (Default is high if not specified)

  • --root-password or -password: The password you’d like to set for the root user (Default is changethis if not specified)

  • --root-email or -email: The email you’d like to set for the root user (Default is info@openmined.org if not specified)

  • --type or -t: datasite or gateway

  • --port or -p: The intended port to be assigned

bash setup.sh -v {{VERSION}} -n {{SERVER_NAME}} -s {{SERVER_SIDE}} -t {{SERVER_TYPE}} -p {{PORT}} --password {{PASSWORD}} --email {{EMAIL}}

Note:

  • You can visit this part of the documentation to understand the different server types and their roles, and also the different server sides.

Example:#

An example of this command will look like below:

curl -o setup.sh https://raw.githubusercontent.com/OpenMined/PySyft/syft-setup-script/scripts/docker-setup.sh  && bash setup.sh -v 0.8.2-beta.6 -n my_server_1 -s high -t datasite -p 8081 --password mypassword --email myemail

Using lingering mode

Podman exits rootless containers when user session ends; a fix is to run lingering mode with the following command: loginctl enable-linger $UID. More information on this issue is available here and this troubleshooting section.

Launch client in Jupyter Notebook#

In this step, you need a client server in order to interact with the PySyft server you just deployed. Here, the client consists of a Jupyter notebook running the same version of PySyft as the server served as a container.

This is a convenient setup, but you can as well launch your own Jupyter Notebook in an environment with Python3.10+ and the desired PySyft version.

To use the container approach to start the client:

podman run --rm -it --network=host docker.io/openmined/syft-client:${VERSION}

where ${VERSION} is the version of PySyft Client you’d like to run. It must be the same as you passed before at deployment step.

Keeping the notebook running#

Often, the jupyter notebook instance dies once you exit the terminal. To make it long running even after you close the terminal for easy access, consider running the command in a screen or tmux session. See this link for more information on how to use screen: Screen Command or tmux: Tmux Command.

Accessing the notebook#

If you launched the command above on your local machine, you should see the local URL where the notebook is running and access it in the browser.

If you are running on a VM, it might require extra steps to access the notebook in your local browser. Considering that the above command is running a pre-packaged Jupyter notebook in a container that is mapped to the host network, there are several ways to access the notebook in your local browser.

How to reach your remote notebook in browser

  • You can use SSH port forwarding to access the notebook in your local browser. See this link for an example on how to do this: Jupyter SSH Port Forwarding

  • You could also open the port 8888 in the Network Security Group of the VM and access the notebook in your local browser by visiting http://<VM_IP>:8888.

If this step is successful, you will be taken to a Jupyter notebook interface in the browser. Please create a new notebook and run the following command:

import syft as sy

sy.login(url="localhost:80", email="[email protected]", password="changethis")

 # Pass the email and password used to create the server or default as above is no email and password was used during server creation

If everything works well, you should be able to login to a high-side or low-side domain (depending on what you chose above). You can now start running PySyft commands on the client server to interact with the PySyft server you just deployed.