Skip to content

Installation


Get started and install BastionLab Client and BastionLab Server.

Pre-requisites


Technical requirements

To install BastionLab Client and BastionLab Server, ensure the following are already installed in your system:

To install BastionLab Server, you'll also need:

Here's the Docker official tutorial to set it up on your computer.

Installing BastionLab Client


From PyPI

pip install bastionlab

From source

First, you'll need to clone BastionLab repository:

git clone https://github.com/mithril-security/bastionlab.git
Then install the client library:
cd ./bastionlab/client
make dev-install

Installing BastionLab Server


From PyPI

For testing purposes only, BastionLab server can be installed using our pip package.

Warning

This package is meant to quickly setup a running instance of the server and is particularly useful in colab notebooks. It does not provide any mean to configure the server which makes certain features impossible to use (like authentication).

For production, please use the Docker image or install the server from source.

pip install bastionlab-server

Once installed, the server can be launched using the following script:

import bastionlab_server
srv = bastionlab_server.start()

And stoped this way:

bastionlab_server.stop(srv)

Using the official Docker image

docker run -p 50056:50056 -d mithrilsecuritysas/bastionlab:latest

By locally building the Docker image

Clone the repository and build the image using the Dockerfile:

git clone https://github.com/mithril-security/bastionlab.git
cd ./bastionlab/server
docker build -t bastionlab:0.1.0 -t bastionlab:latest .
Then run a container based on the image:
docker run -p 50056:50056 -d bastionlab

From source

First make sure that the following build dependencies (Debian-like systems) are installed on your machine:

sudo apt update && apt install -y build-essential patchelf libssl-dev pkg-config curl unzip

Then, clone our repository:

git clone https://github.com/mithril-security/bastionlab.git
Download and unzip libtorch (Pytorch's C++ backend) from Pytorch's website (you can chose the right build according to your cuda version):
cd ./bastionlab
curl -o libtorch.zip https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.12.1%2Bcpu.zip
unzip libtorch.zip
Lib torch binaries are now available under the libtorch folder. You can now turn to building the server crates:
cd server
LIBTORCH_PATH="$(dirname $(pwd))/libtorch" make build

To run the server, use:

make run