game-ci/docker

Docker Image based on Ubuntu20.04 as GitHub deprecated 18.04

sysnet-ai opened this issue · 6 comments

Context

Ubuntu is now flagging all jobs running in Ubuntu18 with a Deprecation Warning:
actions/runner-images#6002

From the issue it seems like they will outright drop support from it by April next year.

This can cause issues because artifacts build using Ubuntu20 will not be loaded by the unity running in Ubuntu18.

Suggested solution

Create a set of images that are based on Ubuntu20.04 instead of 18 (See: https://github.com/game-ci/docker/blob/main/images/ubuntu/base/Dockerfile#L1)

Considered alternatives
Without GitHub extending the support window, I don't think we have a lot of other options.

Thanks so much for raising this issue!

Suggested solution

Create a set of images that are based on Ubuntu20.04 instead of 18 (See: https://github.com/game-ci/docker/blob/main/images/ubuntu/base/Dockerfile#L1)

Please note that there are two separate concerns here:

  • GitHub Actions' support for Ubuntu versions
  • Unity's requirements/support for Ubuntu versions

Looking at the link, GitHub Actions is deprecating ubuntu 18.04 as their "runner image". In context of GameCI, the runner image is reflected in the OS for the runner. The runner then executes a javascript, which runs a docker image with specific arguments based on a workflows configuration.

As far as I understand, all we need to do is change

  runs-on: ubuntu-18.04

to be

  runs-on: ubuntu-latest

Please also correct me if you understood this and I didn't get the depth of the issue.

This can cause issues because artifacts build using Ubuntu20 will not be loaded by the unity running in Ubuntu18.

Could you elaborate on this? I'm not exactly sure what is meant by this.

Yes you're correct in your assessment - I definitely missed adding some context because maybe our use case is a bit more niche.

As you point out GitHub's runners are the ones being deprecated. And I started updating our pipeline when I saw the first deprecation warnings.

The issue is that in our current build process - We first build a C++ library and the appropriate C# wrappers to crate a "native plugin".
We then load our Unity project, which includes said plugin, using the unity-ci/builder action.
The issue we're seeing happens inside the docker container that the action kicks off, not on the runner - since the container is running Ubuntu18.04 when it tries to load our native plugin it hits DllNotFound because it can't load some load level dependencies (seems to be libc related from our triaging).

Basically - If we build native libraries in Ubuntu20, Unity can't load them while running on Ubuntu18.
We know is not the most common use case, but I'm guessing at least a few people depend on native plugins and will see more issues around this.

What if instead of building your dependencies on the runner host, you build it in a Ubuntu 18 container? Then you don't have to think about runner deprecations in the future.

When trying to use these containers to run jobs themselves (See for example game-ci/unity-builder#497) the 18.04 base image creates a few dependency troubles for various actions. Consider the following:

...
  test:
    needs:
      - checklicense
    if: needs.checklicense.outputs.is_unity_license_set == 'true'
    name: Test all modes ✨
    runs-on: ubuntu-latest
    container: unityci/editor:ubuntu-2021.3.17f1-linux-il2cpp-1

    steps:
      - uses: actions/checkout@v3
        with:
          lfs: true
      - run: unity-editor ... to setup some basics
      - run: dotnet build *.sln

This will fail as actions/checkout@v3 requires a newer git than 18.04 ships with.

I believe unity does support ubuntu 20.04, at least for newer versions of unity. Not sure how hard it would be to add additional tags or something along those lines. Alternatively, if the builder action had a way to pass an additional shell script to the container (perhaps to specify an alternative entrypoint?) I suppose I wouldn't need to use the job level container setting, and instead run the various actions inside that step.

We are skipping over Ubuntu 20 to Ubuntu 22 with v2 of the docker images.

I'm havin some problems running the the tests. I use Unity 2023.1.10f1 and I get this error when I run the action:

Run game-ci/unity-test-runner@v2 /usr/bin/docker run --workdir /github/workspace --cidfile /home/runner/work/_temp/container_tests --rm --env UNITY_LICENSE --env UNITY_LICENSE_FILE --env UNITY_EMAIL --env UNITY_PASSWORD --env UNITY_SERIAL --env UNITY_LICENSING_SERVER= --env UNITY_VERSION=2023.1.10f1 --env PROJECT_PATH=. --env CUSTOM_PARAMETERS= --env TEST_PLATFORMS=editmode --env COVERAGE_OPTIONS=generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.* --env COVERAGE_RESULTS_PATH=CodeCoverage --env ARTIFACTS_PATH=editmode-artifacts --env PACKAGE_MODE=false --env PACKAGE_NAME= --env GITHUB_REF --env GITHUB_SHA --env GITHUB_REPOSITORY --env GITHUB_ACTOR --env GITHUB_WORKFLOW --env GITHUB_HEAD_REF --env GITHUB_BASE_REF --env GITHUB_EVENT_NAME --env GITHUB_WORKSPACE=/github/workspace --env GITHUB_ACTION --env GITHUB_EVENT_PATH --env RUNNER_OS --env RUNNER_TOOL_CACHE --env RUNNER_TEMP --env RUNNER_WORKSPACE --env GIT_PRIVATE_TOKEN= --env CHOWN_FILES_TO= --volume /home/runner/work/_temp/_github_home:/root:z --volume /home/runner/work/_temp/_github_workflow:/github/workflow:z --volume /home/runner/work/unity-ci/unity-ci:/github/workspace:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v2/dist/test-standalone-scripts:/UnityStandaloneScripts:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v2/dist/steps:/steps:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v2/dist/entrypoint.sh:/entrypoint.sh:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v2/dist/unity-config:/usr/share/unity3d/config/:z --env USE_EXIT_CODE=false unityci/editor:ubuntu-2023.1.10f1-linux-il2cpp-1 /bin/bash -c /entrypoint.sh Unable to find image 'unityci/editor:ubuntu-2023.1.10f1-linux-il2cpp-1' locally docker: Error response from daemon: manifest for unityci/editor:ubuntu-2023.1.10f1-linux-il2cpp-1 not found: manifest unknown: manifest unknown. See 'docker run --help'. Error: The process '/usr/bin/docker' failed with exit code 125

What does it mean the last numer of: (il2cpp-1)
Unable to find image 'unityci/editor:ubuntu-2023.1.10f1-linux-il2cpp-1'

I checked the images here: https://hub.docker.com/r/unityci/editor/tags

And there is 'unityci/editor:ubuntu-2023.1.10f1-linux-il2cpp-2'

Why is not finding the image? What is the difference between il2cpp-1 and il2cpp-2?