C. Deploy Using Docker (Windows)#

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

Prerequisites#

Server Deployment#

To deploy PySyft server on Windows, we need to configure ahead the parameters we want to set the server with:

Here is an example of how to run the docker command for setting up a PySyft server with powershell:

$env:VERSION = "0.8.7-beta.2"
$env:SERVER_NAME = "name_of_node"
$env:SERVER_SIDE_TYPE = "high" # or "low"
$env:SERVER_TYPE = "datasite" # or "gateway"
$env:PORT = "8089"
$env:SINGLE_CONTAINER_MODE = "true"

docker run --rm -d `
  --name $env:SERVER_NAME `
  -e VERSION=$env:VERSION `
  -e SERVER_NAME=$env:SERVER_NAME `
  -e SERVER_SIDE_TYPE=$env:SERVER_SIDE_TYPE `
  -e SERVER_TYPE=$env:SERVER_TYPE `
  -e PORT=$env:PORT `
  -e SINGLE_CONTAINER_MODE=$env:SINGLE_CONTAINER_MODE `
  -p "${env:PORT}:${env:PORT}" `
  openmined/grid-backend:$env:VERSION

Launch PySyft 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.

We need to start the client as follows:

docker run --rm -it -p 8888:8888 docker.io/openmined/syft-client:$env:VERSION

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

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.