Code Monkey home page Code Monkey logo

Comments (9)

AndrewKahr avatar AndrewKahr commented on July 18, 2024 2

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!

from docker.

AndrewKahr avatar AndrewKahr commented on July 18, 2024 1

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

from docker.

AndrewKahr avatar AndrewKahr commented on July 18, 2024 1

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?

from docker.

AndrewKahr avatar AndrewKahr commented on July 18, 2024 1

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

from docker.

paulbreuler avatar paulbreuler commented on July 18, 2024 1

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/

from docker.

paulbreuler avatar paulbreuler commented on July 18, 2024

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);

from docker.

paulbreuler avatar paulbreuler commented on July 18, 2024
#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?

from docker.

paulbreuler avatar paulbreuler commented on July 18, 2024

That's probably it!

from docker.

AndrewKahr avatar AndrewKahr commented on July 18, 2024

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

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.