diff --git a/INSTALLING.md b/INSTALLING.md index f3965543..e5683995 100644 --- a/INSTALLING.md +++ b/INSTALLING.md @@ -1,3 +1,14 @@ +# Installing TLDR + +1. Install docker & docker-compose +2. Download the + [`docker-compose.yml`](https://raw.githubusercontent.com/zoriya/Kyoo/master/docker-compose.prod.yml), + [`nginx.conf.template`](https://raw.githubusercontent.com/zoriya/Kyoo/master/nginx.conf.template) and + [`.env`](https://raw.githubusercontent.com/zoriya/Kyoo/master/.env.example) files +3. Fill the `.env` file with your configuration options (and an API Key from [themoviedb.org](https://www.themoviedb.org/)) +4. Look at [Hardware Acceleration section](#Hardware-Acceleration) if you need it +4. Run `docker compose up -d` and see kyoo at `http://localhost:8901` + # Installing To install Kyoo, you need docker and docker-compose. Those can be installed from here for @@ -24,21 +35,13 @@ To retrieve metadata, Kyoo will need to communicate with an external service. Fo For this purpose, you will need to get an API Key. For that, go to [themoviedb.org](https://www.themoviedb.org/) and create an account, then go [here](https://www.themoviedb.org/settings/api) and copy the `API Key (v3 auth)`, paste it after the `THEMOVIEDB_APIKEY=` on the `.env` file. +If you need hardware acceleration, look at [Hardware Acceleration section](#Hardware-Acceleration) if you need it + The next and last step is actually starting Kyoo. To do that, open a terminal in the same directory as the 3 configurations files and run `docker-compose up -d`. Congratulation, everything is now ready to use Kyoo. You can navigate to `http://localhost:8901` on a web browser to see your instance of Kyoo. -# Installing TLDR - -1. Install docker & docker-compose -2. Download the - [`docker-compose.yml`](https://raw.githubusercontent.com/zoriya/Kyoo/master/docker-compose.prod.yml), - [`nginx.conf.template`](https://raw.githubusercontent.com/zoriya/Kyoo/master/nginx.conf.template) and - [`.env`](https://raw.githubusercontent.com/zoriya/Kyoo/master/.env.example) files -3. Fill the `.env` file with your configuration options (and an API Key from [themoviedb.org](https://www.themoviedb.org/)) -4. Run `docker-compose up -d` - # Updating Updating Kyoo is exactly the same as installing it. Get an updated version of the `docker-compose.yml` and `nginx.conf.template` files and @@ -54,3 +57,17 @@ TLDR: `docker run -d --name watchtower -e WATCHTOWER_CLEANUP=true -e WATCHTOWER_ To uninstall Kyoo, you need to open a terminal in the configuration's directory and run `docker-compose down`. This will stop Kyoo's services. You can then remove the configuration files. + +# Hardware Acceleration + +## Nvidia + +To enable nvidia hardware acceleration, first install necessary drivers on your system. + +Then, install the [nvidia-container-toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html), you can simply +follow the instructions on the official webpage or your distribution wiki. + +To test if everything works, you can run `sudo docker run --rm --gpus all ubuntu nvidia-smi`. If your version of docker is older, +you might need to add `--runtime nvidia` like so: `sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi` + +After that, you can now use `docker compose --profile nvidia up -d` to start kyoo with nvidia hardware acceleration. diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 192c69fb..3efa3fed 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,5 +1,25 @@ version: "3.8" +x-transcoder: &transcoder-base + build: + context: ./transcoder + dockerfile: Dockerfile.dev + networks: + default: + aliases: + - transcoder + ports: + - "7666:7666" + restart: on-failure + cpus: 1 + env_file: + - ./.env + volumes: + - ./transcoder:/app + - ${LIBRARY_ROOT}:/video + - ${CACHE_ROOT}:/cache + - metadata:/metadata + services: back: build: @@ -53,20 +73,19 @@ services: - ${LIBRARY_ROOT}:/video transcoder: - build: - context: ./transcoder - dockerfile: Dockerfile.dev - ports: - - "7666:7666" - restart: on-failure - cpus: 1 - env_file: - - ./.env - volumes: - - ./transcoder:/app - - ${LIBRARY_ROOT}:/video - - ${CACHE_ROOT}:/cache - - metadata:/metadata + <<: *transcoder-base + profiles: [''] + + transcoder-nvidia: + <<: *transcoder-base + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + environment: + - GOTRANSCODER_HWACCEL=nvidia + profiles: ['nvidia'] ingress: image: nginx diff --git a/docker-compose.nvidia.yml b/docker-compose.nvidia.yml deleted file mode 100644 index 44a35494..00000000 --- a/docker-compose.nvidia.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: "3.8" - -services: - transcoder: - runtime: nvidia - deploy: - resources: - reservations: - devices: - - capabilities: [gpu] - environment: - - GOTRANSCODER_HWACCEL=nvidia diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index ce317c6c..98bef1e4 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,5 +1,19 @@ version: "3.8" +x-transcoder: &transcoder-base + image: zoriya/kyoo_transcoder:edge + networks: + default: + aliases: + - transcoder + restart: unless-stopped + env_file: + - ./.env + volumes: + - ${LIBRARY_ROOT}:/video + - ${CACHE_ROOT}:/cache + - metadata:/metadata + services: back: image: zoriya/kyoo_back:edge @@ -36,14 +50,19 @@ services: - ${LIBRARY_ROOT}:/video transcoder: - image: zoriya/kyoo_transcoder:edge - restart: unless-stopped - env_file: - - ./.env - volumes: - - ${LIBRARY_ROOT}:/video - - ${CACHE_ROOT}:/cache - - metadata:/metadata + <<: *transcoder-base + profiles: [''] + + transcoder-nvidia: + <<: *transcoder-base + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + environment: + - GOTRANSCODER_HWACCEL=nvidia + profiles: ['nvidia'] ingress: image: nginx diff --git a/docker-compose.yml b/docker-compose.yml index e77db239..9cac5164 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,19 @@ version: "3.8" +x-transcoder: &transcoder-base + build: ./transcoder + networks: + default: + aliases: + - transcoder + restart: on-failure + env_file: + - ./.env + volumes: + - ${LIBRARY_ROOT}:/video + - ${CACHE_ROOT}:/cache + - metadata:/metadata + services: back: build: ./back @@ -35,14 +49,19 @@ services: - ${LIBRARY_ROOT}:/video transcoder: - build: ./transcoder - restart: on-failure - env_file: - - ./.env - volumes: - - ${LIBRARY_ROOT}:/video - - ${CACHE_ROOT}:/cache - - metadata:/metadata + <<: *transcoder-base + profiles: [''] + + transcoder-nvidia: + <<: *transcoder-base + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + environment: + - GOTRANSCODER_HWACCEL=nvidia + profiles: ['nvidia'] ingress: image: nginx