diff --git a/README.md b/README.md index 5d4b125..452dfe7 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,17 @@ N.B. The `configure.py` setup process is required because the actual IP address A test version of the app is deployed at http://liionsden.rcs.ic.ac.uk:8080/ (internal access only). +This service is mostly automated with a few steps required to be run outside of the docker container causing some limitations. To run a production version of this, the required files and directories are: + +- `docker-compose.setup.ove.yml` +- `configure.py` +- `run.sh` +- `config/` +- `logs/` - this can be empty +- A `.env` file to define `MY_SECRET` for the OpenVidu login + +To run the production version should be as simple as running `bash run.sh` with the above files alongside any override for watchtower etc. + Utimately, we will want to automate this setup as much as possible so the environment (local testing vs. deployment) is autodetected. For now, the configuration files differ from those generated in the above setup in the following ways: **config/default.conf:** @@ -27,24 +38,22 @@ Utimately, we will want to automate this setup as much as possible so the enviro + server_name liionsden.rcs.ic.ac.uk; ``` +There is also a requirements to have the OpenVidu server running - see [Deploying OpenVidu CE on premises](https://docs.openvidu.io/en/stable/deployment/ce/on-premises/) + ## Current steps for Running a WebRTC app and sharing an application window -1. Make sure nothings running -2. Run `run.sh`` for vis system to run config script and docker-compose - * For local/develop versions, use locally built images (the run.sh should cover the config for this). Images must be named: - * ove-apps:9.9.9 - * ove-ove:9.9.9 - * ove-ui:9.9.9 - * Check get_ip_address is correct - * Check ip address from configure.py is running OVE -3. Go to OVE Core at http://localhost:8080 -4. Select "Launch new OVE Application instances" -5. Select WebRTC application, fill in settings and launch instance -6. Start call button on controller and get session ID - * Note: closing controller ends the session -7. Go to openvidu ip address and manually trust website (OPENVIDU_HOST in the docker-compose.yml) -8. Log in with username: admin, password: (OPENVIDU_SECRET from docker-compose.yml) -9. Enter session ID (from controller window) as room name and join the call -10. Share a window and check it can be viewed from other windows +1. Make sure nothing's running +2. Run `bash run_develop.sh` for vis system to run config script and `docker-compose.yml` + - For production, use `run.sh` +3. Go to OVE Core at the IP address defined in the `API_URL` environment variable you will now find in `docker-compose.yml` +4. Go to OpenVidu IP address and manually trust website (OPENVIDU_HOST in the `docker-compose.yml`) +5. Log in with username: admin, password: (OPENVIDU_SECRET from docker-compose.yml) +6. Return to OVE Core, open the View for the desired WebRTC space - link under Space Layouts, will be something like `IP`/view.html?oveViewId=PC01-Top-0 +7. Open the Controller - link is ID Number under Sections +8. Start the call from the Controller - will generate and display a Session ID +9. Copy the Session ID into the OpenVidu textbox to join the call (there should be three users connected to the call) +10. Share the application (NMX) window into the video call +11. Go to the Controller and select the desired screen to share. It should have a yellow box around it once selected. +12. Confirm the view is displaying the screen. **Note:** Only one screen can be shared from one browser, so multiple screens will require multiple computers/browsers/incognito windows etc. diff --git a/configure.py b/configure.py index bc20e07..193dfa8 100755 --- a/configure.py +++ b/configure.py @@ -5,8 +5,6 @@ Finds the line in docker-compose.setup.ove.yml that contain the host IP address and replaces the value with the IP address of the machine in the new file. - -Does the same for config/credentials.json file. """ import logging @@ -28,9 +26,7 @@ def get_ip_address() -> str: return ip -def generate_docker_compose( - template_file: str, ip: str, develop: bool = False, local: bool = False -) -> None: +def generate_docker_compose(template_file: str, ip: str, develop: bool = False) -> None: """Generate the docker-compose.yml file. Uses a template file and the IP address of the machine. @@ -39,7 +35,6 @@ def generate_docker_compose( template_file: Path to the template file. ip: IP address of the machine. develop: Flag for when running in develop mode. - local: Flag for when running locally with locally-built docker images. Returns: None @@ -72,7 +67,6 @@ def generate_docker_compose( logging.info("Adding dash app to docker-compose.yml...") docker_compose["services"]["dash"] = { "ports": ["8050:8050"], - "volumes": ["./app:/app"], "environment": { "API_URL": f"http://{lines_to_replace['OVE_HOST']}", "PLOT_URL": f"http://{lines_to_replace['PLOT_URL']}", @@ -82,14 +76,12 @@ def generate_docker_compose( } if develop: docker_compose["services"]["dash"]["build"] = "." + docker_compose["services"]["dash"]["volumes"] = ["./app:/app"] + docker_compose["services"]["dash"]["environment"]["DH_URL"] = "http://127.0.0.1" else: docker_compose["services"]["dash"][ "image" - ] = "ghcr.io/imperialcollegelondon/gridlington-vis:main" - if local: - docker_compose["services"]["ovehub-ove-apps"]["image"] = "ove-apps:9.9.9" - docker_compose["services"]["ovehub-ove-ove"]["image"] = "ove-ove:9.9.9" - docker_compose["services"]["ovehub-ove-ui"]["image"] = "ove-ui:9.9.9" + ] = "ghcr.io/imperialcollegelondon/gridlington-vis:latest" # Configure logging for nginx logging.info("Adding volume for nginx logs...") @@ -109,5 +101,4 @@ def generate_docker_compose( "docker-compose.setup.ove.yml", ip, develop="develop" in sys.argv, - local="local" in sys.argv, ) diff --git a/credentials.setup.json b/credentials.setup.json deleted file mode 100644 index db58c44..0000000 --- a/credentials.setup.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "default": "default", - "stores": [ - { - "name": "default", - "endpoint": "ovehub-ove-asset-storage:9000", - "proxyUrl": "http://0.0.0.0:6081/default/", - "accessKey": "MINIO_ACCESS_KEY", - "secretKey": "MINIO_SECRET_KEY" - } - ] -} \ No newline at end of file diff --git a/docker-compose.setup.ove.yml b/docker-compose.setup.ove.yml index 73a6df3..956ba7b 100644 --- a/docker-compose.setup.ove.yml +++ b/docker-compose.setup.ove.yml @@ -1,13 +1,13 @@ version: '3.1' services: ovehub-ove-ove: - image: ovehub/ove:0.5.0 + image: ovehub/ove:0.6.3 restart: unless-stopped volumes: - ./config/Spaces.json:/usr/src/app/packages/ove-core/dist/client/Spaces.json:ro ovehub-ove-apps: - image: ovehub/ove-apps:0.5.0 + image: ovehub/ove-apps:0.6.4 restart: unless-stopped depends_on: - ovehub-ove-ove @@ -17,7 +17,7 @@ services: OPENVIDU_SECRET: "MY_SECRET" ovehub-ove-ui: - image: ovehub/ove-ui:0.2.0 + image: ovehub/ove-ui:0.2.1 restart: unless-stopped depends_on: - ovehub-ove-ove diff --git a/run.sh b/run.sh index 5a82aac..83334d1 100644 --- a/run.sh +++ b/run.sh @@ -1,2 +1,2 @@ -python configure.py develop +python configure.py docker-compose up -d diff --git a/run_develop.sh b/run_develop.sh new file mode 100644 index 0000000..5a82aac --- /dev/null +++ b/run_develop.sh @@ -0,0 +1,2 @@ +python configure.py develop +docker-compose up -d