Add initial xvfb system dependency for OpenGL cores support in the cloud environment (#226)

This commit is contained in:
sergystepanov 2020-09-16 18:26:06 +03:00 committed by GitHub
parent 10fa3c5170
commit b9dc56d85a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 8 deletions

5
Dockerfile vendored
View file

@ -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

14
README.md vendored
View file

@ -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

5
docker-compose.yml vendored
View file

@ -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"