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

Dedicated Server support for Linux is not installed after updating from 2022.3.16f1 to 6000.0.0f1 #244

Closed
paulbreuler opened this issue May 2, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@paulbreuler
Copy link

Bug description

Linux server build fails in GitHub Actions after update of Unity Editor version from
unityci/editor:ubuntu-2022.3.16f1-linux-il2cpp-3.0.1
to
unityci/editor:ubuntu-6000.0.0f1-linux-il2cpp-3.0.1

Error:

#152 142.8 Error building Player: Dedicated Server support for Linux is not installed.

How to reproduce

Run build of Unity project in container.

# linux-specific Unity build
FROM --platform=$BUILDPLATFORM unityci/editor:ubuntu-6000.0.0f1-linux-il2cpp-3.0.1 AS build-unity-linux
WORKDIR "/src"
COPY --from=build-dependencies /src/src/SomeProject/ .
RUN --mount=type=secret,id=UNITY_USERNAME \
    --mount=type=secret,id=UNITY_PASSWORD \
    --mount=type=secret,id=UNITY_LICENSE \
    unity-editor -quit -batchmode -serial $(cat /run/secrets/UNITY_LICENSE) -username $(cat /run/secrets/UNITY_USERNAME) -password $(cat /run/secrets/UNITY_PASSWORD) && \
    unity-editor -quit -batchmode -nographics -buildTarget Linux64 -standaloneBuildSubtarget Server -executeMethod Builder.Build -projectPath . && \
    unity-editor -quit -batchmode -returnlicense -username $(cat /run/secrets/UNITY_USERNAME) -password $(cat /run/secrets/UNITY_PASSWORD)

Expected behavior

Build should succeed.

Previously used

FROM --platform=$BUILDPLATFORM unityci/editor:ubuntu-2022.3.16f1-linux-il2cpp-3.0.1 AS build-unity-linux

Additional details

I'm on MacOS so grabbing a Windows Machine to try to repro locally for more details. Currently running in GH Actions, where build had been working until version change.

@paulbreuler paulbreuler added the bug Something isn't working label May 2, 2024
@paulbreuler
Copy link
Author

Perhaps tied to regex check for version before installing server modules:

RUN echo "$version-$module" | grep -q -vP '^(2021.2.(?![0-4](?![0-9]))|2021.[3-9]|202[2-9]|20[3-9]).*linux' \
  && exit 0 \
  || unity-hub install-modules --version "$version" --module "linux-server" --childModules | tee /var/log/install-module-linux-server.log && grep 'Missing module' /var/log/install-module-linux-server.log | exit $(wc -l);

RUN echo "$version-$module" | grep -q -vP '^(2021.2.(?![0-4](?![0-9]))|2021.[3-9]|202[2-9]|20[3-9]).*windows' \
  && exit 0 \
  || unity-hub install-modules --version "$version" --module "windows-server" --childModules | tee /var/log/install-module-windows-server.log && grep 'Missing module' /var/log/install-module-windows-server.log | exit $(wc -l);

https://github.com/game-ci/docker/blob/main/images/ubuntu/editor/Dockerfile

Something like this would work to cover version 6+ and 10+ assuming this version style is maintained.

Regex addition:

^([6-9][0-9]{3}|[1-9][0-9]{4,}).*
  • Any 4-digit version starting from 6000 up to 9999.
  • Any 5-digit or larger version number starting from 10000 and upwards

Makes the final pattern a bit gross but likely works, haven't tested yet.

POTENTIAL SOLUTION:

RUN echo "$version-$module" | grep -q -vP '^(2021.2.(?![0-4](?![0-9]))|2021.[3-9]|202[2-9]|20[3-9]|[6-9][0-9]{3}|[1-9][0-9]{4,}).*linux' \
  && exit 0 \
  || unity-hub install-modules --version "$version" --module "linux-server" --childModules | tee /var/log/install-module-linux-server.log && grep 'Missing module' /var/log/install-module-linux-server.log | exit $(wc -l);

RUN echo "$version-$module" | grep -q -vP '^(2021.2.(?![0-4](?![0-9]))|2021.[3-9]|202[2-9]|20[3-9]|[6-9][0-9]{3}|[1-9][0-9]{4,}).*windows' \
  && exit 0 \
  || unity-hub install-modules --version "$version" --module "windows-server" --childModules | tee /var/log/install-module-windows-server.log && grep 'Missing module' /var/log/install-module-windows-server.log | exit $(wc -l);

@AndrewKahr
Copy link
Member

I actually discovered this a few hours ago while trying to fix the android modules. Your regex is much better than what I had though so I went ahead and incorporated it into my branch. Will try to fast track this to a release. Thanks for chasing this down!

AndrewKahr added a commit that referenced this issue May 7, 2024
* Increase freed disk space. Misc package updates

* Update report-to-backend deps

* Switch to github_output

* Fix missing variables for Unity 6 versions

* Improved version match strategy. Credit: #244
@AndrewKahr
Copy link
Member

The fix is live for Unity 6 images. Check to see if dedicated server is working for you now and if it is we can close this issue

@paulbreuler
Copy link
Author

#146 144.2 Asset Pipeline Refresh (id=905952f5a7a50c95394e27c5dcd177f1): Total: 0.022 seconds - Initiated by StopAssetImportingV2(NoUpdateAssetOptions)
#146 144.2 Error building Player: Dedicated Server support for Linux is not installed.

Maybe the image isn't built out yet?

@AndrewKahr
Copy link
Member

That's odd I see this in the build log: [Linux Dedicated Server Build Support] installed successfully.
Maybe pull the image locally and manually check the expected files exist for it?

@AndrewKahr
Copy link
Member

Also make sure you're using the updated image version. Not sure if you've pinned it to 3.0.1 or if that's just what was latest when you ran it. It should be 3.1.0 now

@paulbreuler
Copy link
Author

That's probably it!

@paulbreuler
Copy link
Author

That did the trick. I didn't see docs on pinning versions. I just noticed in unityci/editor each image has the version in the name.

Is there a string I should use to just pull the latest?

Updated to -3.1.0

# add file level variables
ARG UnityVersion=6000.0.0f1
ARG UnityCiDockerVersion=3.1.0

# build dependencies
...Truncated...

# linux-specific Unity build
FROM --platform=$BUILDPLATFORM unityci/editor:ubuntu-${UnityVersion}-linux-il2cpp-${UnityCiDockerVersion} AS build-unity-linux
WORKDIR "/src"
COPY --from=build-dependencies /src/src/someProject/ .
# Install the Linux Server Build module
RUN echo "Building User Interface for Linux..."
RUN --mount=type=secret,id=UNITY_USERNAME \
    --mount=type=secret,id=UNITY_PASSWORD \
    --mount=type=secret,id=UNITY_LICENSE \
    unity-editor -quit -batchmode -serial $(cat /run/secrets/UNITY_LICENSE) -username $(cat /run/secrets/UNITY_USERNAME) -password $(cat /run/secrets/UNITY_PASSWORD) && \
    unity-editor -quit -batchmode -nographics -buildTarget Linux64 -standaloneBuildSubtarget Server -executeMethod Builder.Build -projectPath . && \
    unity-editor -quit -batchmode -returnlicense -username $(cat /run/secrets/UNITY_USERNAME) -password $(cat /run/secrets/UNITY_PASSWORD)
RUN echo "Building User Interface for Linux... completed"

# windows-specific Unity build
FROM --platform=$BUILDPLATFORM unityci/editor:ubuntu-${UnityVersion}-windows-mono-3.0.1 AS build-unity-windows
WORKDIR "/src"
RUN echo "Building User Interface for Windows..."
COPY --from=build-dependencies /src/src/someProject/ .
RUN --mount=type=secret,id=UNITY_USERNAME \
    --mount=type=secret,id=UNITY_PASSWORD \
    --mount=type=secret,id=UNITY_LICENSE \
    unity-editor -quit -batchmode -serial $(cat /run/secrets/UNITY_LICENSE) -username $(cat /run/secrets/UNITY_USERNAME) -password $(cat /run/secrets/UNITY_PASSWORD) && \
    unity-editor -quit -batchmode -nographics -buildTarget win64 -standaloneBuildSubtarget Server -executeMethod Builder.Build -projectPath . && \
    unity-editor -quit -batchmode -returnlicense -username $(cat /run/secrets/UNITY_USERNAME) -password $(cat /run/secrets/UNITY_PASSWORD)# linux-specific base
RUN echo "Building User Interface for Windows... completed"

# platform-dynamic build-unity
FROM build-unity-${TARGETOS} AS build-unity

# linux-specific base
FROM ubuntu:latest AS base-linux
USER $APP_UID
ENTRYPOINT ["./someProject.x86_64"]

# windows-specific base
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 AS base-windows
ENTRYPOINT ["some.exe"]

# platform-dynamic final
FROM base-${TARGETOS} AS final
EXPOSE 7777/udp
WORKDIR /app
COPY --from=build-unity "src/Build/" .
COPY src/someProject/Assets/appsettings.json someProject_Data/

@AndrewKahr
Copy link
Member

If you use just 3 as the version it will be the latest version with a major version of 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants