docs: Re-organize installation docs

- add user docs to use concretefhe with docker
This commit is contained in:
Arthur Meyre
2021-09-09 15:08:01 +02:00
parent 06be053a35
commit 42777d8888
5 changed files with 79 additions and 14 deletions

49
docs/dev/howto/DOCKER.md Normal file
View File

@@ -0,0 +1,49 @@
# Docker
## Setting up docker and X forwarding
Before you start this section, go ahead and install docker. You can follow [this](https://docs.docker.com/engine/install/) official guide for that.
### Linux
```console
xhost +localhost
```
### Mac OS
To be able to use X forwarding on Mac OS: first, you need to install xquartz. Secondly, open XQuartz.app application, and open a new terminal within XQuartz.app. Make sure in the application parameters to authorize network connections are set (currently in the Security settings); finally, in the XQuartz.app terminal, type
```console
xhost +127.0.0.1
```
and now, the X server should be all set in docker (in the regular terminal).
### Windows
Install Xming and use Xlaunch:
- Multiple Windows, Display number: 0
- Start no client
- **IMPORTANT**: Check `No Access Control`
- You can save this configuration to re-launch easily, then click finish.
## Logging in and building the image
Docker image of `concretefhe` is based on another docker image provided by the compiler team. Once you have access to this repository you should be able to launch the commands to build the dev docker image with `make docker_build`.
Upon joining to the team, you need to log in using the following command:
```shell
docker login ghcr.io
```
This command will ask for a username and a password. For username, just enter your GitHub username. For password, you should create a personal access token from [here](https://github.com/settings/tokens) selecting `read:packages` permission. Just paste the generated access token as your password, and you are good to go.
Once you do that you can get inside the docker environment using the following command:
```shell
make docker_build_and_start
```
After you finish your work, you can leave the docker by using the `exit` command or by pressing `CTRL + D`.

View File

@@ -0,0 +1,87 @@
# Project Setup
## Installing Python v3.8
`concretefhe` is a `Python` library. So `Python` should be installed to develop `concretefhe`. `v3.8` is the only supported version.
You can follow [this](https://realpython.com/installing-python/) guide to install it (alternatively you can google `how to install python 3.8`).
## Installing Poetry
`Poetry` is our package manager. It simplifies dependency and environment management by a lot.
You can follow [this](https://python-poetry.org/docs/#installation) official guide to install it.
## Installing make
The dev tools use make to launch the various commands.
On Linux you can install make from your distribution's preferred package manager.
On Mac OS you can install a more recent version of make via brew:
```bash
# check for gmake
which gmake
# If you don't have it, it will error out, install gmake
brew install make
# recheck, now you should have gmake
which gmake
```
It is possible to install gmake as make, check this [StackOverflow post](https://stackoverflow.com/questions/38901894/how-can-i-install-a-newer-version-of-make-on-mac-os) for more infos.
On Windows check [this GitHub gist](https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058#make).
**/!\\ In the next sections, be sure to use the proper `make` tool for your system, `make`, `gmake` or other. /!\\**
## Cloning repository
Now, it's time to get the source code of `concretefhe`. You can use the following command to do that.
```shell
git clone https://github.com/zama-ai/concretefhe-internal.git
```
## Setting up environment
We are going to make use of virtual environments. This helps to keep the project isolated from other `Python` projects in the system. The following commands will create a new virtual environment under the project directory and install dependencies to it.
```shell
cd concretefhe-internal
make setup_env
```
## Activating the environment
Finally, all we need to do is to activate the newly created environment using the following command.
### macOS or Linux
```shell
source .venv/bin/activate
```
### Windows
```shell
source .venv/Scripts/activate
```
## Leaving the environment
After your work is done you can simply run the following command to leave the environment.
```shell
deactivate
```
## Syncing environment with the latest changes
From time to time, new dependencies will be added to project or the old ones will be removed. The command below will make sure the project have proper environment. So run it regularly!
```shell
make sync_env
```