Skip to content

Commit 61c5163

Browse files
committed
Address testing feedback
1 parent 042203b commit 61c5163

File tree

4 files changed

+85
-5
lines changed

4 files changed

+85
-5
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,28 @@ Stream games (and GUI) running on Docker with HW acceleration and low latency!
44

55
Read more on our [documentation](https://games-on-whales.github.io/gow/)
66

7-
![Screenshot of GOW running](docs/assets/img/GOW-running.jpg)
7+
![Screenshot of GOW running](docs/modules/ROOT/images/GOW-running.jpg)
88

99
## Quickstart
1010

11+
To launch RetroArch in Games on Whales using your host system's desktop environment, try this:
12+
1113
```
1214
git clone https://github.com/games-on-whales/gow.git
1315
cd gow
1416
mkdir local_state
15-
sudo docker-compose pull
16-
sudo docker-compose up
17+
./run-gow --app retroarch up
1718
```
1819

1920
Wait, are you seriously running code from the internet?
2021

21-
It's dangerous out there! Make sure to checkout the [documentation](https://games-on-whales.github.io/gow/) first!
22+
It's dangerous out there! Make sure to checkout the
23+
[documentation](https://games-on-whales.github.io/gow/) first! It has details
24+
on several other interesting scenarios including
25+
[headless](https://games-on-whales.github.io/gow/debian-headless.html) mode and
26+
[unRAID](https://games-on-whales.github.io/gow/headless-unraid.html) support.
27+
You'll also [learn how
28+
to](https://games-on-whales.github.io/gow/debian-headless.html) change Sunshine
29+
settings and connect with Moonlight.
2230

2331

docs/modules/ROOT/pages/headless-unraid.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ cd gow
4141
mkdir local_state
4242
----
4343

44+
TIP: On unRAID, the `local_state` folder you just created will be owned by
45+
`root`, and it may not be writable from the containers launched by GoW, which
46+
mostly do _not_ run as `root`. Until GoW has support for changing the UID
47+
inside the containers, you may need to `chmod 777 local_state` to make sure
48+
anyone can write to it.
49+
4450
Now it’s time to download the containers prebuilt images:
4551

4652
[source,bash]

env/base.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ SUNSHINE_PASS=admin
1616
# if your system already runs avahi-daemon just mount host /run/dbus into Sunshine
1717
# TODO: create avahi docker image instead
1818
DBUS=/run/dbus
19+
20+
XORG_SOCKET=/tmp/.X11-unix/X0
21+
XORG_DISPLAY=:0

run-gow

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ apps=()
1616
gpu_type=none
1717
quiet=false
1818
headless=false
19+
debug=false
1920

2021
function main {
2122
parse_cli SCRIPT_ARGV
@@ -55,6 +56,10 @@ function main {
5556
done
5657
set +o allexport
5758

59+
if [ "$debug" = "true" ]; then
60+
print_debug_info
61+
fi
62+
5863
echo_stderr "Running docker compose..."
5964
if [ "${#SCRIPT_ARGV}" -gt 0 ]; then
6065
eval "$(get_compose_cmd) ${SCRIPT_ARGV[*]}"
@@ -80,6 +85,9 @@ function usage() {
8085
echo_stderr " -a, --app <app name>"
8186
echo_stderr " Specify an application to launch. Can be used multiple times."
8287
echo_stderr
88+
echo_stderr " -d, --debug"
89+
echo_stderr " Print some extra debugging information before running Docker commands."
90+
echo_stderr
8391
echo_stderr " -e, --env-file <file>"
8492
echo_stderr " Specify an additional file of environment varibles to load before launching 'docker compose'."
8593
echo_stderr
@@ -102,6 +110,12 @@ function usage() {
102110
# Parse the command line args we were given
103111
function parse_cli {
104112
local -n argv=$1
113+
114+
if [ "${#argv}" -eq 0 ]; then
115+
usage
116+
exit 1
117+
fi
118+
105119
local idx=0
106120
while [ "$idx" -le "${#argv[@]}" ]; do
107121
case "${argv[$idx]}" in
@@ -113,6 +127,9 @@ function parse_cli {
113127
apps+=("${argv[$idx+1]}")
114128
idx=$((idx + 1))
115129
;;
130+
-d|--debug)
131+
debug=true
132+
;;
116133
-e|--env-file)
117134
launch_env+=("${argv[$idx+1]}")
118135
idx=$((idx + 1))
@@ -156,6 +173,47 @@ function echo_stderr() {
156173
[ "$quiet" != "true" ] && echo "$txt" >&2
157174
}
158175

176+
177+
178+
# Print out some extra debugging info. Currently, this is the list of
179+
# environment variables we're loading, plus the transformed contents of each
180+
# compose file.
181+
function print_debug_info() {
182+
local variable_re='^[[:space:]]*([[:alpha:]][[:alnum:]_]*)='
183+
184+
# Print out the environment variables
185+
echo_stderr "Loading environment variables:"
186+
for env_file in "${launch_env[@]}"; do
187+
local full_file="$SCRIPT_DIR/$env_file"
188+
if [ -f "$full_file" ]; then
189+
while IFS= read -r line; do
190+
if [[ $line =~ $variable_re ]]; then
191+
echo_stderr " - ${line} (from $env_file)"
192+
fi
193+
done < "$full_file"
194+
fi
195+
done
196+
echo_stderr
197+
198+
# Print out each transformed file
199+
for file in "${compose_files[@]}"; do
200+
if [ -f "$file" ]; then
201+
echo_stderr "Transformed file: $file"
202+
echo_stderr "$(transform_file "$file")"
203+
echo_stderr
204+
fi
205+
done
206+
207+
for app in "${apps[@]}"; do
208+
app_file="compose/$app.yml"
209+
if [ -f "$app_file" ]; then
210+
echo_stderr "Transformed file: $app_file"
211+
echo_stderr "$(transform_file "$app_file")"
212+
echo_stderr
213+
fi
214+
done
215+
}
216+
159217
# read the given text line by line and add the given padding string to the
160218
# front of each line.
161219
function pad_lines() {
@@ -267,13 +325,18 @@ function get_compose_cmd() {
267325
function check_compose_version {
268326
local min_version installed_version
269327
local compose_re='version v?([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)'
270-
if [[ "$(docker-compose --version)" =~ $compose_re ]]; then
328+
if [[ "$(docker compose version)" =~ $compose_re ]]; then
329+
if [ "$debug" = "true" ]; then
330+
echo_stderr "Found Docker Compose version ${BASH_REMATCH[1]}"
331+
fi
332+
271333
local IFS=.
272334
# shellcheck disable=2086
273335
printf -v installed_version %08d ${BASH_REMATCH[1]}
274336
printf -v min_version %08d $MIN_COMPOSE_VERSION
275337
test "$installed_version" \> $min_version
276338
else
339+
echo_stderr "Docker Compose was not found. Please install Docker Compose version $MIN_COMPOSE_VERSION or newer."
277340
false
278341
fi
279342
}

0 commit comments

Comments
 (0)