Skip to content

Latest commit

 

History

History
83 lines (50 loc) · 1.84 KB

README.md

File metadata and controls

83 lines (50 loc) · 1.84 KB

CircleCI

CANOSP-2019

This project implements a minimal server that can perform federated learning with differential privacy and accepts messages from clients.

Getting Started

We are using Miniconda to manage the environment. It can be installed using one of the installers available here. For MacOS, the bash installer is recommended.

Make sure to have conda init run during conda installation so that your PATH is set properly.

Installing locally to run tests

To install and run the tests for this project you can run:

# Set up the environment.
$ make setup_conda
$ conda activate mozfldp

# Run tests
$ make pytest

Running the server

You can run the server locally, serving requests on port 8000, using:

$ python -m mozfldp.server

Building a release

python setup.py sdist

Running from Docker

The server can also be built and run as a Docker container. First, install Docker.

Once you have Docker installed, you can build the container and run tests using:

$ make build_image
$ make docker_tests

To run the service in the container, use:

$ make up

Note that in the above command, we are exposing the container's port 8000 by binding it to port 8090 on the host computer.

Sending data to the server

You can submit arbitrary JSON blobs to the server using HTTP POST.

A sample curl invocation that will work is:

curl -X POST http://127.0.0.1:8000/api/v1/compute_new_weights

{"result":"ok","weights":[[[0.0,0.0,0.0,.... }

Note: If you are running locally, the port will be 8000. Port 8090 is used if you are running in a docker container.