Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 chore(server): Test with a real world game #7

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dev/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ubuntu:20.04 as runtime

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update && \
apt install -y x11-apps

CMD /usr/bin/xclock
13 changes: 12 additions & 1 deletion .dev/x11.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /bin/bash

#This fixes the error where x11-apps in docker cannot seem to access the hosts DISPLAY server
# Error: No protocol specified
# Error: Can't open display: :10.0
Expand All @@ -10,4 +12,13 @@ xhost
weston --backend=x11-backend.so

#Run inside the terminal of the weston you just created... cool right?
weston --backend=wayland-backend.so
weston --backend=wayland-backend.so

#Start docker and run a game
docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -v $(pwd)/games:/games:ro --gpus all --entrypoint /bin/bash -e DISPLAY=$DISPLAY server

#Run the game using proton
dbg=2 /usr/bin/netris/proton -r /games/npp.exe

#Sometimes the Xserver unix socket will disappear (and i have to reinitialiase the VM again), so here is the manual way to check
ls -la /tmp/.X11-unix #If something exists (anything for that matter :), then you are okay
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
games
21 changes: 14 additions & 7 deletions server.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

FROM ubuntu:22.04

#FIXME: install Vulkan drivers (should be done in the .scripts/gpu)
#FIXME: install https://git.dec05eba.com/gpu-screen-recorder (should be done in the .scripts/stream)
#TODO: Add mango-hud and gamescope
#FIXME: add pulseaudio

ENV DEBIAN_FRONTEND=noninteractive \
TIMEZONE=Africa/Nairobi
Expand All @@ -29,11 +30,6 @@ ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8

# COPY .scripts/ /usr/bin/netris/

# RUN ls -la /usr/bin/netris \
# && chmod +x /usr/bin/netris/proton

# Expose NVIDIA libraries and paths
ENV PATH=/usr/local/nvidia/bin:${PATH} \
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}:/usr/local/nvidia/lib:/usr/local/nvidia/lib64 \
Expand Down Expand Up @@ -103,9 +99,20 @@ RUN apt-get update -y \
# Prepare the XDG_RUNTIME_DIR for wayland
&& mkdir -p ${XDG_RUNTIME_DIR} && chmod 0700 ${XDG_RUNTIME_DIR}

#Install wine
# Wine, Winetricks, Lutris, and PlayOnLinux, this process must be consistent with https://wiki.winehq.org/Ubuntu
ARG WINE_BRANCH=staging
RUN mkdir -pm755 /etc/apt/keyrings && curl -fsSL -o /etc/apt/keyrings/winehq-archive.key "https://dl.winehq.org/wine-builds/winehq.key" \
&& curl -fsSL -o "/etc/apt/sources.list.d/winehq-$(grep UBUNTU_CODENAME= /etc/os-release | cut -d= -f2 | tr -d '\"').sources" "https://dl.winehq.org/wine-builds/ubuntu/dists/$(grep UBUNTU_CODENAME= /etc/os-release | cut -d= -f2 | tr -d '\"')/winehq-$(grep UBUNTU_CODENAME= /etc/os-release | cut -d= -f2 | tr -d '\"').sources" \
&& apt-get update && apt-get install --install-recommends -y winehq-${WINE_BRANCH}

COPY .scripts/ /usr/bin/netris/

RUN ls -la /usr/bin/netris \
&& chmod +x /usr/bin/netris/proton

#Install proton
# RUN /usr/bin/netris/proton -i
RUN /usr/bin/netris/proton -i

ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
Expand Down
Loading