You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fvdb/README.md
+56-18Lines changed: 56 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,62 @@ conda activate fvdb_learn
46
46
47
47
48
48
## Building *f*VDB from Source
49
-
*f*VDB is a Python library implemented as a C++ Pytorch extension.
49
+
50
+
### Environment Management
51
+
ƒVDB is a Python library implemented as a C++ Pytorch extension. Of course you can build ƒVDB in whatever environment suits you, but we provide two paths to constructing reliable environments for building and running ƒVDB: using [docker](#setting-up-a-docker-container) and using [conda](#setting-up-a-conda-environment).
52
+
53
+
`conda` tends to be more flexible since reconfiguring toolchains and modules to suit your larger project can be dynamic, but at the same time this can be a more brittle experience compared to using a virtualized `docker` container. Using `conda` is generally recommended for development and testing, while using `docker` is recommended for CI/CD and deployment.
54
+
55
+
#### Setting up a Docker Container
56
+
57
+
Running a docker container is a great way to ensure that you have a consistent environment for building and running ƒVDB.
58
+
59
+
Our provided [`Dockerfile`](Dockerfile) has two modes for building the image: `dev` and `production`. `production` constructs an image capable of building ƒVDB, builds and installs the ƒVDB libraries and is read for you to start running python code that uses the `fvdb` module. `dev` mode constructs an image which is ready to build ƒVDB but does not build the ƒVDB libraries.
60
+
61
+
Building the docker image in `production` mode is the default and is as simple as running the following command from the root of this repository:
62
+
```shell
63
+
# Build the docker image in production mode
64
+
docker build -t fvdb/prod .
65
+
```
66
+
67
+
Building the docker mage in `dev` mode is done by setting the `BUILD_MODE` argument to `dev`:
68
+
```shell
69
+
# Build the docker image in dev mode
70
+
docker build --build-arg MODE=dev -t fvdb/dev .
71
+
```
72
+
73
+
Running the docker container is done with the following command:
74
+
```shell
75
+
# Run an interactive bash shell (or replace with your command)
76
+
docker run -it --gpus all --rm \
77
+
fvdb/dev:latest \
78
+
/bin/bash
79
+
```
80
+
81
+
82
+
#### Setting up a Conda Environment
83
+
84
+
In order to get resolved package versions in your conda environment consistent with our testing, it is necessary to configure your `.condarc` since not all package resolving behaviour can be controlled with an `environment.yml` file. We recommend using `strict` channel priority in your conda configuration. This can be done by running the following command:
85
+
86
+
```shell
87
+
conda config --set channel_priority strict
88
+
```
89
+
90
+
Further, it is recommend to not mix the `defaults` and `conda-forge` package channels when resolving environments. We have generally used `conda-forge` as the primary channel for our dependencies. You can remove the `defaults` channel and add `conda-forge` with the following command:
91
+
92
+
```shell
93
+
conda config --remove channels defaults
94
+
conda config --add channels conda-forge
95
+
```
96
+
97
+
With these changes, it is recommended that your `.condarc` file looks like the following:
98
+
99
+
```yaml
100
+
channel_priority: strict
101
+
channels:
102
+
- conda-forge
103
+
```
104
+
50
105
51
106
**(Optional) Install libMamba for a huge quality of life improvement when using Conda**
52
107
```
@@ -55,7 +110,6 @@ conda install -n base conda-libmamba-solver
55
110
conda config --set solver libmamba
56
111
```
57
112
58
-
### Conda Environment
59
113
60
114
Next, create the `fvdb` conda environment by running the following command from the root of this repository, and then grabbing a ☕:
61
115
```shell
@@ -106,22 +160,6 @@ sphinx-build -E -a docs/ build/sphinx
106
160
open build/sphinx/index.html
107
161
```
108
162
109
-
### Docker Image
110
-
111
-
To build and test *f*VDB, we have the dockerfile available:
0 commit comments