|
1 | 1 | # OpenCue sandbox environment |
2 | 2 |
|
3 | | -The sandbox environment provides a way to run a test OpenCue deployment. You can use the sandbox |
4 | | -environment to run small tests or development work. The sandbox environment runs OpenCue components |
5 | | -in separate Docker containers on your local machine. |
| 3 | +The sandbox environment offers an easy way to run a test OpenCue deployment locally, with all components running in |
| 4 | +separate Docker containers or Python virtual environments. It is ideal for small tests, development work, and for |
| 5 | +those new to OpenCue who want a simple setup for experimentation and learning. |
6 | 6 |
|
7 | 7 | To learn how to run the sandbox environment, see |
8 | 8 | https://www.opencue.io/docs/quick-starts/. |
9 | 9 |
|
| 10 | +## Usage example |
| 11 | + |
| 12 | +If you don’t already have a recent local copy of the OpenCue source code, you must do one of the following: |
| 13 | + |
| 14 | +- Download and unzip the [OpenCue source code ZIP file](https://github.com/AcademySoftwareFoundation/OpenCue/archive/master.zip). |
| 15 | +- If you have the git command installed on your machine, you can clone the repository: |
| 16 | + |
| 17 | +```bash |
| 18 | +git clone https://github.com/AcademySoftwareFoundation/OpenCue.git |
| 19 | +``` |
| 20 | + |
| 21 | +For developers, you can also use the following commands to set up a local copy of the OpenCue source code: |
| 22 | + |
| 23 | +- Fork the [Opencue repository](https://github.com/AcademySoftwareFoundation/OpenCue) using your GitHub account. |
| 24 | +- Clone your forked repository: |
| 25 | +```bash |
| 26 | +git clone https://github.com/<username>/OpenCue.git |
| 27 | +``` |
| 28 | + |
| 29 | +### 1. Deploying the OpenCue Sandbox Environment |
| 30 | + |
| 31 | +- Run the services: DB, Flyway, Cuebot, and RQD |
| 32 | + - A PostgreSQL database |
| 33 | + - A Flyway database migration tool |
| 34 | + - A Cuebot server |
| 35 | + - An RQD rendering server |
| 36 | + |
| 37 | +In one terminal, run the following commands: |
| 38 | + |
| 39 | +- Create required directories for RQD logs and shots: |
| 40 | + |
| 41 | +```bash |
| 42 | +mkdir -p /tmp/rqd/logs /tmp/rqd/shots |
| 43 | +``` |
| 44 | + |
| 45 | +- Change to the root of the OpenCue source code directory |
| 46 | + |
| 47 | +```bash |
| 48 | +cd OpenCue |
| 49 | +``` |
| 50 | + |
| 51 | +- Build the Cuebot container from source |
| 52 | + |
| 53 | +**Note:** Make sure [Docker](https://www.docker.com/) is installed and running on your machine. |
| 54 | + |
| 55 | +```bash |
| 56 | +docker build -t opencue/cuebot -f cuebot/Dockerfile . |
| 57 | +``` |
| 58 | + |
| 59 | +- Deploy the sandbox environment |
| 60 | + - This command will start the services (db, flyway, cuebot, rqd) in the background and create a network for them to |
| 61 | + communicate with each other. |
| 62 | + |
| 63 | +```bash |
| 64 | +docker compose up |
| 65 | +``` |
| 66 | + |
| 67 | +**Notes:** |
| 68 | +- Use `docker compose up -d` to run the services in detached mode. |
| 69 | +- Use `docker compose down` to stop the services and remove the network. |
| 70 | +- Use `docker compose logs` to view the logs of the services. |
| 71 | +- Use `docker compose ps` to view the status of the services. |
| 72 | +- Use `docker compose exec <service> bash` to open a shell in the container of the specified service. |
| 73 | +- Use `docker compose exec <service> <command>` to run a command in the container of the specified service. |
| 74 | +- Use `docker compose down --volumes` to remove the volumes created by the services. |
| 75 | +- Use `docker compose down --rmi all` to remove all images created by the services. |
| 76 | + |
| 77 | +### 2. Installing the OpenCue Client Packages |
| 78 | + |
| 79 | +In a second terminal, run the following commands: |
| 80 | + |
| 81 | +- Make sure you are in the root of the OpenCue source code directory |
| 82 | + |
| 83 | +```bash |
| 84 | +cd OpenCue |
| 85 | +``` |
| 86 | + |
| 87 | +- Create a virtual environment for the Python packages |
| 88 | + |
| 89 | +```bash |
| 90 | +python3 -m venv sandbox-venv |
| 91 | +``` |
| 92 | + |
| 93 | +- Activate the virtual environment |
| 94 | + |
| 95 | +```bash |
| 96 | +source sandbox-venv/bin/activate |
| 97 | +``` |
| 98 | + |
| 99 | +- Upgrade pip to the latest version |
| 100 | + |
| 101 | +```bash |
| 102 | +pip install --upgrade pip |
| 103 | +``` |
| 104 | + |
| 105 | +- Install the required Python packages |
| 106 | + |
| 107 | +```bash |
| 108 | +pip install -r requirements.txt |
| 109 | +pip install -r requirements_gui.txt |
| 110 | +``` |
| 111 | + |
| 112 | +- Install the OpenCue Python client libraries from source |
| 113 | + - This option is mostly used by developers that contribute to the OpenCue project. |
| 114 | + - It is recommended if you want to test the latest changes in the OpenCue source code. |
| 115 | + - To install Opencue from source, run: |
| 116 | + |
| 117 | +```bash |
| 118 | +./sandbox/install-client-sources.sh |
| 119 | +``` |
| 120 | + |
| 121 | +**Note:** The latest version of the OpenCue source code might include changes that are incompatible with the prebuilt |
| 122 | +OpenCue images of Cuebot and RQD on Docker Hub used in the sandbox environment. |
| 123 | + |
| 124 | +Alternatively, you can use the script `./sandbox/install-client-archive.sh` to download, extract, and install specified |
| 125 | +OpenCue client packages for a given release version from GitHub. To learn how to run the sandbox environment, see |
| 126 | +https://www.opencue.io/docs/quick-starts/. |
| 127 | +- To install the latest versions of the OpenCue client packages, you must configure the installation script with the |
| 128 | +version number. |
| 129 | +- The script `sandbox/get-latest-release-tag.sh` will automatically fetch this for you, but you can also look up the |
| 130 | +version numbers for OpenCue releases on GitHub. |
| 131 | + |
| 132 | +```bash |
| 133 | +export VERSION=$(sandbox/get-latest-release-tag.sh) |
| 134 | +``` |
| 135 | + |
| 136 | +### 3. Testing the Sandbox Environment |
| 137 | + |
| 138 | +To test the sandbox environment, run the following commands inside the Python virtual environment: |
| 139 | + |
| 140 | +- To verify the successful installation and connection between the client packages and sandbox, list the hosts in the |
| 141 | +sandbox environment: |
| 142 | + |
| 143 | +```bash |
| 144 | +cueadmin -lh |
| 145 | +``` |
| 146 | + |
| 147 | +- Launch the CueGUI (Cuetopia/CueCommander) app for monitoring and controlling jobs: |
| 148 | + |
| 149 | +```bash |
| 150 | +cuegui & |
| 151 | +``` |
| 152 | + |
| 153 | +- Launch the CueSubmit app for submitting jobs: |
| 154 | + |
| 155 | +```bash |
| 156 | +cuesubmit & |
| 157 | +``` |
| 158 | + |
10 | 159 | ## Monitoring |
11 | 160 |
|
12 | 161 | To get started with monitoring there is also an additional Docker compose file which sets up |
13 | 162 | monitoring for key services. |
14 | 163 |
|
15 | 164 | To learn how to run the sandbox environment with monitoring, |
16 | | -see https://www.opencue.io/docs/other-guides/monitoring-with-prometheus-loki-and-grafana/. |
| 165 | +see https://www.opencue.io/docs/other-guides/monitoring-with-prometheus-loki-and-grafana/. |
0 commit comments