diff --git a/content/_index.md b/content/_index.md index 72f68d8..50b692c 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,17 +1,14 @@ --- -title: My Site +title: Glympse toc: false --- -This is the landing page. - -## Explore - -{{< cards >}} - {{< card link="docs" title="Docs" icon="book-open" >}} - {{< card link="about" title="About" icon="user" >}} -{{< /cards >}} +Glympse is a your solution to a hybrid production. Access your rushes from across the globe and view in a web browser. Allow your teams to work where they want when they need to. ## Documentation -For more information, visit [Hextra](https://imfing.github.io/hextra). +{{< cards >}} + {{< card link="docs" title="Server Admin" icon="book-open" >}} + {{< card link="user_docs" title="User Documentation" icon="user" >}} +{{< /cards >}} + diff --git a/content/docs/Installation/_index.md b/content/docs/Installation/_index.md new file mode 100644 index 0000000..827264d --- /dev/null +++ b/content/docs/Installation/_index.md @@ -0,0 +1,12 @@ +--- +title: Installation +next: /docs/Installation/database +weight: 1 +--- +To install Glympse, you will need a database, a redis cache and a rabbitmq queue all of which must be accessible by all of the Glympse containers you deploy. For that reason it is recommended to keep this as a separate compose file. + +{{< cards >}} + {{< card link="/docs/installation/database/" title="Database Install" icon="database" >}} + {{< card link="/docs/installation/services" title="Services" icon="selector" >}} + {{< card link="/docs/installation/install_glympse" title="Glympse Install" icon="server" >}} +{{< /cards >}} \ No newline at end of file diff --git a/content/docs/Installation/database.md b/content/docs/Installation/database.md new file mode 100644 index 0000000..d3d1658 --- /dev/null +++ b/content/docs/Installation/database.md @@ -0,0 +1,145 @@ +--- +title: Database Installation +type: docs +prev: /_index +next: docs/install +--- + + + +To install you will first need the database and queue manager running. Every instance of Glympse you run will need to connect to these containers. + +First create your docker network. `docker network create glympse_net` + +Then create a a directory and compose file: +``` +mkdir /opt/glympse_database + +cd /opt/glympse_database + +nano /opt/glympse_database/compose.yml +``` + +Paste the following, be sure to change the passwords and any other personal details before saving. + +```yaml {filename="compose.yml"} +services: + redis: + image: redis:alpine + container_name: redis + restart: always + ports: + - 6379:6379 + volumes: + - /opt/glympse_database/redis_data:/data + healthcheck: + test: + - CMD + - redis-cli + - ping + interval: 30s + timeout: 10s + retries: 3 + networks: + glympse_net: null + rabbitmq: + image: rabbitmq:3.13.4-management + container_name: rabbitmq + volumes: + - type: bind + source: /opt/glympse_database/rabbitmq.conf + target: /etc/rabbitmq/conf.d/10-defaults.conf + ports: + - 15672:15672 + - 5672:5672 + networks: + glympse_net: null + mysql: + image: mysql:8.0 + container_name: mysql + environment: + MYSQL_ROOT_PASSWORD: + MYSQL_DATABASE: glympse + MYSQL_USER: glympse + MYSQL_PASSWORD: + volumes: + - /opt/glympse/mysql:/var/lib/mysql + - type: bind + source: /opt/glympse_database/my.cnf + target: /etc/my.cnf + ports: + - 6033:6033 + - 3306:3306 + networks: + glympse_net: null +networks: + default: + external: true + name: glympse_net +``` +There are two more files that you need to create and save before running the compose file. + +First is the mysql config file. + +Create a file called my.cnf in the glympse_database directory: `nano my.cnf` and paste the following: + +```conf {filename="my.cnf"} +# For advice on how to change settings please see +# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html + +[mysqld] +# +# Remove leading # and set to the amount of RAM for the most important data +# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. +# innodb_buffer_pool_size = 128M +# +# Remove leading # to turn on a very important data integrity option: logging +# changes to the binary log between backups. +# log_bin +# +# Remove leading # to set options mainly useful for reporting servers. +# The server defaults are faster for transactions and fast SELECTs. +# Adjust sizes as needed, experiment to find the optimal values. +# join_buffer_size = 128M +# sort_buffer_size = 2M +# read_rnd_buffer_size = 2M + +# Remove leading # to revert to previous value for default_authentication_plugin, +# this will increase compatibility with older clients. For background, see: +# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin +# default-authentication-plugin=mysql_native_password +skip-host-cache +skip-name-resolve +datadir=/var/lib/mysql +socket=/var/run/mysqld/mysqld.sock +secure-file-priv=/var/lib/mysql-files +user=mysql +connect_timeout = 600 +net_read_timeout = 30 +wait_timeout = 28800 +interactive_timeout = 28800 + +pid-file=/var/run/mysqld/mysqld.pid +[client] +socket=/var/run/mysqld/mysqld.sock + +!includedir /etc/mysql/conf.d/ + +``` + +Finally create a config file for rabbitmq: `nano rabbitmq.conf` and paste the following: + +be sure to change the password for something secure and keep note of it as you will need it for your compose env files. + +```conf {filename="rabbitmq.conf"} +default_vhost = glympse +default_user = glympse +default_pass = +default_permissions.configure = .* +default_permissions.read = .* +default_permissions.write = .* +default_user_tags.administrator = true +default_user_tags.management = true +default_user_tags.glympse = true +consumer_timeout = 31622400000 +``` \ No newline at end of file diff --git a/content/docs/Installation/install_glympse.md b/content/docs/Installation/install_glympse.md new file mode 100644 index 0000000..345c1f6 --- /dev/null +++ b/content/docs/Installation/install_glympse.md @@ -0,0 +1,97 @@ +--- +title: Install Glympse +type: docs +prev: docs/services +next: docs/ +--- +To install glympse we first need to create a docker compose file and then an env file. These two files will allow you to configure most out of the box settings. Once you're set these up, you will be able to change more setting from the webui. + +Services default to enabled, to disable a service, change yes to no in the environment section of the compose file. To enable a service, either change the environment variable to yes or delete/comment the line. + +UWSGI and NGINX are required for the webui service + +The following compose file will enable all services in a single container. This will work but it is possible that the transcoding and transcribing tasks can slow down the webui if you're running on a slower machine. + +```yaml {filename="compose.yml"} +services: + Glympse: + image: git.themainframe.co.uk/josh/glympse + container_name: Glympse + restart: unless-stopped + ports: + - 80:80 + environment: + TZ: Europe/London + ENABLE_UWSGI: yes + ENABLE_NGINX: yes + ENABLE_CELERY_BEAT: yes + ENABLE_PROCESSING: yes + ENABLE_MIGRATIONS: yes + ENABLE_TRANSCRIBER: yes + ENABLE_TRANSCODER: yes + volumes: + - /opt/glympse/logs:/Glympse/logs + - /opt/glympse/.env:/Glympse/config/.env + - :/media + - :/rushes:ro + deploy: + resources: + reservations: + devices: + - driver: nvidia + device_ids: + - 00000000:01:00.0 + capabilities: + - gpu + memcached: + image: memcached:latest + container_name: memcached + entrypoint: memcached -m 256 + restart: unless-stopped +networks: + default: + external: true + name: glympse_net +``` + + +The following env file is required. You will need to change some of the options to what you specified in the database section of the install. + +Every line must be in the env file for every container you run regardless of what services are enabled. + +```env {filename=".env"} +DJANGO_SETTINGS_MODULE="Glympse.settings.production" +SECRET_KEY="" +SECRET_ADMIN_URL= +CSRF_TRUSTED_ORIGINS=https://"" +ALLOWED_HOSTS="" +ADMINS='' +DOMAIN='' +MAX_FIELDS=5000 +SQL_ENGINE="django.db.backends.mysql" +SQL_DATABASE="glympse" +SQL_USER="glympse" +SQL_PASSWORD="" +SQL_HOST="mysql" +SQL_PORT="3306" +EMAIL_HOST="" +EMAIL_PORT="" +EMAIL_USE_TLS="" +EMAIL_HOST_USER="" +EMAIL_HOST_PASSWORD="" +DEFAULT_FROM_EMAIL="Glympse" +ALLOWED_EMAIL_DOMAINS="" +REDIS_HOST="redis://redis:6379" +RABBITMQ_URL="amqp://glympse:@rabbitmq:5672/glympse" +ADMIN_USERNAME="" +ADMIN_EMAIL="" +ADMIN_PASSWORD="" +LOG_LEVEL="INFO" +TIMEZONE="Europe/London" +MICROSOFT_AUTH_CLIENT_ID='' +MICROSOFT_AUTH_CLIENT_SECRET='' +MICROSOFT_AUTH_TENANT_ID='' +MEMCACHED='memcached:11211' +CUDA_DEVICE='cuda:0' +DEBUG=False +``` \ No newline at end of file diff --git a/content/docs/Installation/services.md b/content/docs/Installation/services.md new file mode 100644 index 0000000..2d1f985 --- /dev/null +++ b/content/docs/Installation/services.md @@ -0,0 +1,26 @@ +--- +title: Glympse Services +type: docs +prev: / +next: docs/install_glympse +--- + +Glympse is split into multiple services so you can split the workload between multiple machines. + +The available services are as follows: +* WebUI\ + This is the webui front end. The reverse proxy needs to point to the machine that is running this service. It is possible to run more than one frontend for load balancing purposes. + +* Processing\ + This service is responsible for scanning the rushes drives and inserting the rushes into the Glympse database. It is also responsible for other background tasks such as sending emails etc. This worker will run 16 simultaneous tasks. + +* Transcoding - **Prefers Nvidia GPU**\ +This is the transcoding engine. It takes the raw rushes and transcodes them to lower resolution proxy files that can be streamed. The transcoder will try use cuda hardware acceleration but will fall back to software if it is unavailable. This worker will run 4 simultaneous tasks. + +* Long Transcoding\ +This was set up to create the thumbnail preview for the video player when you hover over the video play bar to allow for scrubbing. This worker will run 16 simultaneous tasks. + +* Transcribing - **Requires Nvidia GPU**\ + This is responsible for transcribing clips. A modern Nvidia GPU is required for this to work. It is possible to select a different model that may better suit the available hardware. A GPU with more VRAM can support a larger model. This worker will run a single task at a time. + +It is possible to run one or more services in a single docker container. the running services are managed through the environment settings in the compose file. \ No newline at end of file diff --git a/content/docs/Setup/_index.md b/content/docs/Setup/_index.md new file mode 100644 index 0000000..02229b5 --- /dev/null +++ b/content/docs/Setup/_index.md @@ -0,0 +1,7 @@ +--- +title: System Setup +next: /docs/setup/admin_settings +weight: 2 +--- + +There are two main ways to change settings for Glympse. The first is the env file, the second is to change some settings from within the application. This can be done whilst the server is up and running from a central point, whereas changes to the env file will need to be replicated on each docker container. \ No newline at end of file diff --git a/content/docs/Setup/admin_settings.md b/content/docs/Setup/admin_settings.md new file mode 100644 index 0000000..03268a7 --- /dev/null +++ b/content/docs/Setup/admin_settings.md @@ -0,0 +1,4 @@ +--- +title: Admin Settings +#next: /docs/Installation/database +--- \ No newline at end of file diff --git a/content/docs/_index.md b/content/docs/_index.md index 73dfb20..0006510 100644 --- a/content/docs/_index.md +++ b/content/docs/_index.md @@ -1,18 +1,13 @@ --- -title: Documentation -next: first-page +title: Server Admin +next: /docs/Installation/database --- -This is a demo of the theme's documentation layout. +This is the documentation for the admin of a Glympse server. -## Hello, World! +Glympse is supplied as a docker container exclusively. -```go {filename="main.go"} -package main - -import "fmt" - -func main() { - fmt.Println("Hello, World!") -} -``` +#### Prerequisites: +* docker +* docker compose +* Nvidia GPU for transcribing (preferred for transcoding tasks) diff --git a/content/docs/first-page.md b/content/docs/first-page.md deleted file mode 100644 index 4af40a1..0000000 --- a/content/docs/first-page.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Demo Page -type: docs -prev: / -next: docs/folder/ ---- - -A simple demo page. - diff --git a/content/docs/folder/_index.md b/content/docs/folder/_index.md deleted file mode 100644 index 5050ade..0000000 --- a/content/docs/folder/_index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Folder -type: docs -prev: docs/first-page -next: docs/folder/leaf -sidebar: - open: true ---- - -Pages can be organized into folders. diff --git a/content/docs/folder/leaf.md b/content/docs/folder/leaf.md deleted file mode 100644 index 7c9ee2a..0000000 --- a/content/docs/folder/leaf.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Leaf Page -type: docs -prev: docs/folder/ ---- - -This page is under a folder. diff --git a/content/user_docs/_index.md b/content/user_docs/_index.md new file mode 100644 index 0000000..98898c6 --- /dev/null +++ b/content/user_docs/_index.md @@ -0,0 +1,18 @@ +--- +title: User Documentation +next: first-page +--- + +This is a demo of the theme's documentation layout. + +## Hello, World! + +```go {filename="main.go"} +package main + +import "fmt" + +func main() { + fmt.Println("Hello, World!") +} +``` \ No newline at end of file diff --git a/hugo.yaml b/hugo.yaml index 30f9991..a78ab8c 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -1,5 +1,5 @@ # Hugo configuration file -title: My Site +title: Glympse # import hextra as module module: @@ -19,13 +19,10 @@ markup: menu: main: - name: Docs - pageRef: /docs + pageRef: / weight: 1 - - name: About - pageRef: /about - weight: 2 - name: Contact ↗ - url: "https://github.com/imfing" + url: "https://git.themainframe.co.uk/josh" weight: 3 - name: Search weight: 4 @@ -33,24 +30,24 @@ menu: type: search - name: GitHub weight: 5 - url: "https://github.com/imfing/hextra-starter-template" + url: "https://git.themainframe.co.uk/josh/glympse_docs" params: icon: github - - name: Twitter - weight: 6 - url: "https://twitter.com/" - params: - icon: x-twitter params: navbar: displayTitle: true - displayLogo: false + displayLogo: true + logo: + path: images/logo.png + link: / + width: 40 + height: 40 footer: - displayCopyright: false - displayPoweredBy: true + displayCopyright: true + displayPoweredBy: false editURL: enable: true - base: "https://github.com/imfing/hextra-starter-template/edit/main/content" + base: "https://git.themainframe.co.uk/josh/Glympse_Docs/src/branch/main/content" diff --git a/i18n/en.yaml b/i18n/en.yaml new file mode 100644 index 0000000..41e5b5e --- /dev/null +++ b/i18n/en.yaml @@ -0,0 +1,2 @@ +copyright: "© 2024 Joshua Kirkcaldy" +editThisPage: "Edit this page on TheMainframe →" diff --git a/static/images/logo.png b/static/images/logo.png new file mode 100644 index 0000000..cde00ae Binary files /dev/null and b/static/images/logo.png differ