From 42777d8888fa13fb03e3086baa024fd628951ee2 Mon Sep 17 00:00:00 2001 From: Arthur Meyre Date: Thu, 9 Sep 2021 15:08:01 +0200 Subject: [PATCH] docs: Re-organize installation docs - add user docs to use concretefhe with docker --- README.md | 35 +++++++++---- docs/{install => dev/howto}/DOCKER.md | 0 .../howto/PROJECT_SETUP.md} | 2 +- docs/index.rst | 6 +-- docs/user/howto/INSTALLING.md | 50 +++++++++++++++++++ 5 files changed, 79 insertions(+), 14 deletions(-) rename docs/{install => dev/howto}/DOCKER.md (100%) rename docs/{install/INSTALLING.md => dev/howto/PROJECT_SETUP.md} (99%) create mode 100644 docs/user/howto/INSTALLING.md diff --git a/README.md b/README.md index 1134bb33f..5beaf9126 100644 --- a/README.md +++ b/README.md @@ -2,25 +2,40 @@ Concrete Framework Python API - collection of tools to FHE all the things -## Installing + -Installation steps are described in [INSTALLING.md](docs/install/INSTALLING.md). +- [concretefhe](#concretefhe) + - [For end users](#for-end-users) + - [Using the project](#using-the-project) + - [For developers](#for-developers) + - [Project setup](#project-setup) + - [Documenting](#documenting) + - [Developing](#developing) + - [Contributing](#contributing) -## Using Docker + -Information about how to use Docker are available in [DOCKER.md](docs/install/DOCKER.md). +## For end users -## Documenting +### Using the project -Some information about how to build the documentation of `concretefhe` are available in [DOCUMENTING.md](docs/dev/DOCUMENTING.md). Notably, our documentation is pushed to [https://hdk.zama.ai](https://hdk.zama.ai). +To use the project you can check [INSTALLING.md](docs/user/howto/INSTALLING.md) -## Developping +## For developers -Some information about our terminology and the infrastructure of `concretefhe` are available in [TERMINOLOGY_AND_STRUCTURE.md](docs/dev/TERMINOLOGY_AND_STRUCTURE.md). An in-depth look at what is done in `concretefhe` is available in [COMPILATION.md](docs/dev/COMPILATION.md). +### Project setup -## Contributing +Installation steps are described in [PROJECT_SETUP.md](docs/dev/howto/PROJECT_SETUP.md). +Information about how to use Docker for development are available in [DOCKER.md](docs/dev/howto/DOCKER.md). -Information about how to contribute are available in [CONTRIBUTING.md](docs/dev/CONTRIBUTING.md). +### Documenting +Some information about how to build the documentation of `concretefhe` are available in [DOCUMENTING.md](docs/dev/howto/DOCUMENTING.md). Notably, our documentation is pushed to [https://hdk.zama.ai](https://hdk.zama.ai). +### Developing +Some information about our terminology and the infrastructure of `concretefhe` are available in [TERMINOLOGY_AND_STRUCTURE.md](docs/dev/explanation/TERMINOLOGY_AND_STRUCTURE.md). An in-depth look at what is done in `concretefhe` is available in [COMPILATION.md](docs/dev/explanation/COMPILATION.md). + +### Contributing + +Information about how to contribute are available in [CONTRIBUTING.md](docs/dev/howto/CONTRIBUTING.md). diff --git a/docs/install/DOCKER.md b/docs/dev/howto/DOCKER.md similarity index 100% rename from docs/install/DOCKER.md rename to docs/dev/howto/DOCKER.md diff --git a/docs/install/INSTALLING.md b/docs/dev/howto/PROJECT_SETUP.md similarity index 99% rename from docs/install/INSTALLING.md rename to docs/dev/howto/PROJECT_SETUP.md index a0408c683..f411074aa 100644 --- a/docs/install/INSTALLING.md +++ b/docs/dev/howto/PROJECT_SETUP.md @@ -1,5 +1,5 @@ -# Installing +# Project Setup ## Installing Python v3.8 diff --git a/docs/index.rst b/docs/index.rst index 803b85f7c..97700d36b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,8 +7,6 @@ Homomorphic Development Kit's documentation :caption: Basics README.md - install/INSTALLING.md - install/DOCKER.md .. toctree:: :maxdepth: 2 @@ -22,6 +20,7 @@ Homomorphic Development Kit's documentation :maxdepth: 2 :caption: How to + user/howto/INSTALLING.md user/howto/COMPILE.md user/howto/REDUCE_NEEDED_PRECISION.md user/howto/DEBUG_SUPPORT_SUBMIT_ISSUES.md @@ -46,6 +45,8 @@ Homomorphic Development Kit's documentation :maxdepth: 2 :caption: Developper - How To + dev/howto/PROJECT_SETUP.md + dev/howto/DOCKER.md dev/howto/DOCUMENTING.md Releasing on GitHub dev/howto/CONTRIBUTING.md @@ -58,4 +59,3 @@ Homomorphic Development Kit's documentation dev/explanation/TERMINOLOGY_AND_STRUCTURE.md dev/explanation/FLOAT-FUSING.md dev/explanation/MLIR.md - \ No newline at end of file diff --git a/docs/user/howto/INSTALLING.md b/docs/user/howto/INSTALLING.md new file mode 100644 index 000000000..126e2b5e1 --- /dev/null +++ b/docs/user/howto/INSTALLING.md @@ -0,0 +1,50 @@ +# Installing + +## Docker image + +Currently the project is only available as a docker image. To get the image you need to login to ghcr.io with docker. + +```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. + +You can then either pull the latest docker image or a specific version: + +```shell +docker pull ghcr.io/zama-ai/concretefhe-internal:latest +# or +docker pull ghcr.io/zama-ai/concretefhe-internal:v0.1.0 +``` + +You can then use this image with the following command: + +```shell +# Without local volume: +docker run --rm -it -p 8888:8888 ghcr.io/zama-ai/concretefhe-internal:v0.1.0 + +# With local volume to save notebooks on host: +docker run --rm -it -p 8888:8888 -v /host/path:/data ghcr.io/zama-ai/concretefhe-internal:v0.1.0 +``` + +This will launch a concretefhe enabled jupyter server in the docker, that you can access from your browser. + +Alternatively you can just open a shell in the docker: + +```shell +docker run --rm -it ghcr.io/zama-ai/concretefhe-internal:v0.1.0 /bin/bash + +root@e2d6c00e2f3d:/data# python3 +Python 3.8.10 (default, Jun 2 2021, 10:49:15) +[GCC 9.4.0] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> import concrete.numpy as hnp +>>> dir(hnp) +['ClearScalar', 'ClearTensor', 'CompilationArtifacts', 'CompilationConfiguration', 'EncryptedScalar', 'EncryptedTensor', 'Float', 'Float32', 'Float64', 'Integer', 'LookupTable', 'ScalarValue', 'SignedInteger', 'TensorValue', 'UnsignedInteger', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'compile', 'compile_numpy_function', 'compile_numpy_function_into_op_graph', 'draw_graph', 'get_printable_graph', 'np_dtypes_helpers', 'trace_numpy_function', 'tracing'] +>>> +``` + + + +