Merge pull request #586 from Kolloom/install_doc

Install doc
This commit is contained in:
Devin Neal 2019-06-19 14:46:34 -07:00 committed by GitHub
commit 43b643db6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 7 deletions

View file

@ -74,19 +74,29 @@ python3 -m manim example_scenes.py SquareToCircle -pl
### Using Docker ### Using Docker
Since it's a bit tricky to get all the dependencies set up just right, there is a Dockerfile and Compose file provided in this repo as well as [a premade image on Docker Hub](https://hub.docker.com/r/eulertour/manim/tags/). The Dockerfile contains instructions on how to build a manim image, while the Compose file contains instructions on how to run the image. Since it's a bit tricky to get all the dependencies set up just right, there is a Dockerfile and Compose file provided in this repo as well as [a premade image on Docker Hub](https://hub.docker.com/r/eulertour/manim/tags/). The Dockerfile contains instructions on how to build a manim image, while the Compose file contains instructions on how to run the image.
In order to do this with the Compose file, you must set the `INPUT_PATH` The prebuilt container image has manin repository included.
environment variable to the directory containing your source code and the `INPUT_PATH` is where the container looks for scene files. You must set the `INPUT_PATH`
`OUTPUT_DIRECTORY` environment variable to the directory where you want media environment variable to the absolute path containing your scene file and the
to be written. `OUTPUT_PATH` environment variable to the directory where you want media to be written.
1. [Install Docker](https://docs.docker.com) 1. [Install Docker](https://docs.docker.com)
2. [Install Docker Compose](https://docs.docker.com/compose/install/) 2. [Install Docker Compose](https://docs.docker.com/compose/install/)
3. Render an animation 3. Render an animation
```sh ```sh
INPUT_PATH=/path/to/dir/containing/source/code \ INPUT_PATH=/path/to/dir/containing/source/code \
OUTPUT_PATH=/path/to/dir/for/media \ OUTPUT_PATH=/path/to/output/ \
docker-compose run manim example_scenes.py SquareToCircle -l docker-compose run manim example_scenes.py SquareToCircle -l
``` ```
The command needs to be run as root if your username is not in the docker group.
You can replace `example.scenes.py` with any relative path from your `INPUT_PATH`.
<img src=./manim_docker_diagram.png/>
After running the output will say files ready at `/tmp/output/`, which refers to path inside the container. Your OUTPUT_PATH is bind mounted to this `/tmp/output` so any changes made by the container to `/tmp/output` will be mirrored on your OUTPUT_PATH. `/media/` will be created in `OUTPUT_PATH`.
`-p` won't work as manim would look for video player in the container system, which it does not have.
The first time you execute the above command, Docker will pull the image from Docker Hub and cache it. Any subsequent runs until the image is evicted will use the cached image. The first time you execute the above command, Docker will pull the image from Docker Hub and cache it. Any subsequent runs until the image is evicted will use the cached image.
Note that the image doesn't have any development tools installed and can't preview animations. Its purpose is building and testing only. Note that the image doesn't have any development tools installed and can't preview animations. Its purpose is building and testing only.

View file

@ -10,7 +10,7 @@ services:
- manim - manim
- --media_dir=/tmp/output - --media_dir=/tmp/output
volumes: volumes:
- ${INPUT_DIR:?INPUT_DIR environment variable isn't set}:/tmp/input - ${INPUT_PATH:?INPUT_PATH environment variable isn't set}:/tmp/input
- ${OUTPUT_DIR:?OUTPUT_DIR environment variable isn't set}:/tmp/output - ${OUTPUT_PATH:?OUTPUT_PATH environment variable isn't set}:/tmp/output
working_dir: /tmp/input working_dir: /tmp/input
network_mode: "none" network_mode: "none"

BIN
manim_docker_diagram.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB