From b9dc56d85aba63abd7e536d2344f908dd83d806e Mon Sep 17 00:00:00 2001 From: sergystepanov Date: Wed, 16 Sep 2020 18:26:06 +0300 Subject: [PATCH] Add initial xvfb system dependency for OpenGL cores support in the cloud environment (#226) --- Dockerfile | 5 ++++- README.md | 14 ++++++++------ docker-compose.yml | 5 ++++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index d5b30d24..620b4dd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,12 +35,15 @@ RUN apt-get update && apt-get install -y \ libopusfile0 \ libsdl2-2.0-0 \ libgl1-mesa-glx \ + xvfb \ && rm -rf /var/lib/apt/lists/* COPY --from=build ${BUILD_PATH}/bin/ ./ # it assumed there are only binary files yet RUN cp -s $(pwd)/* /usr/local/bin COPY web ./web -COPY assets/emulator/libretro/cores/*.so ./assets/emulator/libretro/cores/ +COPY assets/emulator/libretro/cores/*.so \ + assets/emulator/libretro/cores/*.cfg \ + ./assets/emulator/libretro/cores/ EXPOSE 8000 9000 3478/tcp 3478/udp diff --git a/README.md b/README.md index d23217a3..6486e0e3 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ [![Build](https://github.com/giongto35/cloud-game/workflows/build/badge.svg)](https://github.com/giongto35/cloud-game/actions?query=workflow:build) [![Latest release](https://img.shields.io/github/v/release/giongto35/cloud-game.svg)](https://github.com/giongto35/cloud-game/releases/latest) -**Open-source Cloud Gaming Service For Retro Games** -**Video demo**: https://www.youtube.com/watch?v=GUBrJGAxZZg -**Technical wrapup**: https://webrtchacks.com/open-source-cloud-gaming-with-webrtc/ +**Open-source Cloud Gaming Service For Retro Games** +**Video demo**: https://www.youtube.com/watch?v=GUBrJGAxZZg +**Technical wrapup**: https://webrtchacks.com/open-source-cloud-gaming-with-webrtc/ **CloudMorph**: [https://github.com/giongto35/cloud-morph](https://github.com/giongto35/cloud-morph): My current focus on generic solution for cloudgaming ## Introduction @@ -17,7 +17,7 @@ Theoretically, in cloud gaming, games are run on remote servers and media are st **(Currently, I'm working on [CloudMorph](https://github.com/giongto35/cloud-morph): It offers more generic solution to run any offline games/application on browser in Cloud Gaming approach: [https://github.com/giongto35/cloud-morph](https://github.com/giongto35/cloud-morph))** ## Try the service at -Single play: **[http://cloudretro.io](http://cloudretro.io)** +Single play: **[http://cloudretro.io](http://cloudretro.io)** Direct play an existing game: **[Pokemon Emerald](https://cloudretro.io/?id=4a5073a4b05ad0fe___Pokemon%20-%20Emerald%20Version%20(U))** \*In ideal network condition and less resource contention on servers, the game will run smoothly as in the video demo. Because I only hosted the platform on limited servers in US East, US West, Eu, Singapore, you may experience some latency issues + connection problem. You can try hosting the service following the instruction the next section to have a better sense of performance. @@ -63,6 +63,8 @@ Because the coordinator and workers need to run simultaneously. Workers connect * `go run cmd/coordinator/main.go` - spawn coordinator * `go run cmd/worker/main.go --coordinatorhost localhost:8000` - spawn workers connecting to coordinator +__Additionally, you may install and configure an `X Server` display in order to be able to run OpenGL cores.__ + ## Run with Docker In case if you want to run the app as a Docker container, @@ -114,9 +116,9 @@ We are very much thankful to everyone who contributes to the project: ## Author -Nguyen Huu Thanh +Nguyen Huu Thanh https://www.linkedin.com/in/huuthanhnguyen/ -Tri Dang Minh +Tri Dang Minh https://trich.im diff --git a/docker-compose.yml b/docker-compose.yml index 6916bdda..c970b718 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,8 +6,11 @@ services: image: cloud-game-local container_name: cloud-game-local privileged: true + environment: + - DISPLAY=:0 + # network_mode: "host" command: > - bash -c "coordinator --v=5 & worker --coordinatorhost localhost:8000" + bash -c "coordinator --v=5 & xvfb-run -s '-screen 0 1x1x24' worker --coordinatorhost localhost:8000" ports: - "8000:8000" - "9000:9000"