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

Building Unity Project Times Out #30

Closed
Renanse opened this issue Sep 12, 2022 · 8 comments · Fixed by #32
Closed

Building Unity Project Times Out #30

Renanse opened this issue Sep 12, 2022 · 8 comments · Fixed by #32
Assignees
Labels
bug Something isn't working

Comments

@Renanse
Copy link

Renanse commented Sep 12, 2022

Orb version:

1.1.0

What happened:

I am building an Android project with Unity 2021.3.6f1 at CircleCI. The framework terminates the job due to no output after 10 minutes.

Starting: /opt/unity/Editor/Data/Tools/netcorerun/netcorerun "/opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer/AndroidPlayerBuildProgram.exe" "/opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer/Bee:/opt/unity/Editor/Data/Tools/BuildPipeline" "Library/Bee/Player01afee0d.dag.json" "Library/Bee/Player01afee0d-inputdata.json" "Library/Bee/buildprogram2.traceevents"
WorkingDir: /root/project/android/unity_build
ExitCode: 0 Duration: 1s499ms
Starting: /opt/unity/Editor/Data/bee_backend --profile="Library/Bee/backend_profiler3.traceevents" --stdin-canary --dagfile="Library/Bee/Player01afee0d.dag" --continue-on-failure --dagfilejson="Library/Bee/Player01afee0d.dag.json" Player
WorkingDir: /root/project/android/unity_build
++++ trap_build_script_exit
++++ exit_status=0
++++ set +x
Compressing build artifacts...

Too long with no output (exceeded 10m0s): context deadline exceeded

It appears CircleCI supports customizing this timeout, but it must be passed through by the orb. See also: https://discuss.circleci.com/t/how-to-handle-no-output-timeout-in-orb-command/44934/2

Expected behavior:

Should build, or provide a way around the timeout.

@Renanse Renanse added the bug Something isn't working label Sep 12, 2022
@Renanse Renanse changed the title Building Building Unity Project Times Out Sep 12, 2022
@EricRibeiro
Copy link
Member

EricRibeiro commented Sep 12, 2022

Hi, @Renanse 👋

Thank you for opening this issue.

Per your output, Unity's build command finishes its execution. If the following is the last message you see, what is hanging is the compression step:

Compressing build artifacts...

Can you try running the job with compress: false? Also, what Executor are you using?

@Renanse
Copy link
Author

Renanse commented Sep 12, 2022

Thank you for the follow-up! Great spot on the compress. That actually does not show up until the process finally times out. In the circleci interface it shows this up until canceling:

Starting: /opt/unity/Editor/Data/bee_backend --profile="Library/Bee/backend_profiler3.traceevents" --stdin-canary --dagfile="Library/Bee/Player01afee0d.dag" --continue-on-failure --dagfilejson="Library/Bee/Player01afee0d.dag.json" Player
WorkingDir: /root/project/android/unity_build

But perhaps that is the result of some output buffering or something like that? I will give disabling compression a shot.

Here's a snippet of my config, with executor and such:

jobs:
  build-unity-android:
    working_directory: "~/project/android/unity_build"
    executor: 
      editor_version: 2021.3.6f1
      name: unity/ubuntu
      resource_class: large
      target_platform: android
    steps:
      - sync-submodules
      - unity/prepare-env:
          unity-password-var-name: UNITY_PASSWORD
          unity-serial-var-name: UNITY_SERIAL
          unity-username-var-name: UNITY_USERNAME
      - unity/build:
          step-name: Building KSTV in Unity for Android
          build-target: Android
          project-path: .
      - persist_to_workspace: 
          root: "./Builds/android/"
          paths:
            - UnityBuild/

@Renanse
Copy link
Author

Renanse commented Sep 12, 2022

Turning off compression did not fix the issue. Note how there is no ExitCode immediately before the trap_build_script_exit? I believe that run of bee_backend is exceeding the 10minute timeout, perhaps indicating something else is wrong in general with my build because outside of running it here, these commands all take a handful of seconds tops. (e.g. on Unity Cloud Build, etc.)

Starting: /opt/unity/Editor/Data/Tools/netcorerun/netcorerun "/opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer/AndroidPlayerBuildProgram.exe" "/opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer/Bee:/opt/unity/Editor/Data/Tools/BuildPipeline" "Library/Bee/Player01afee0d.dag.json" "Library/Bee/Player01afee0d-inputdata.json" "Library/Bee/buildprogram2.traceevents"
WorkingDir: /root/project/android/unity_build
ExitCode: 0 Duration: 1s335ms
Starting: /opt/unity/Editor/Data/bee_backend --profile="Library/Bee/backend_profiler3.traceevents" --stdin-canary --dagfile="Library/Bee/Player01afee0d.dag" --continue-on-failure --dagfilejson="Library/Bee/Player01afee0d.dag.json" Player
WorkingDir: /root/project/android/unity_build
++++ trap_build_script_exit
++++ exit_status=0
++++ set +x

Too long with no output (exceeded 10m0s): context deadline exceeded

@EricRibeiro
Copy link
Member

Got it. Thanks for trying and sharing your config! Any chance you can share the full output in Pastebin or somewhere like that? If you can, remember to redact your license.

I'll publish a developer version of the orb with the no_output_timeout parameter and share it here for you to try and check if it fixes the issue. I'm not super hopeful because of this:

these commands all take a handful of seconds tops

But we might as well try it.

@EricRibeiro
Copy link
Member

Made the change here: https://github.com/game-ci/unity-orb/tree/feat_no_output_timeout_param.

You can try the no_output_timeout parameter by replacing your game-ci/unity@1.x.x slug with game-ci/unity@dev:5adf234fc35540145f112e63eeb7cb9c406473dc

@Renanse
Copy link
Author

Renanse commented Sep 13, 2022

Thanks, Eric. I will give that a shot later today. This whole thing took a little wind out of my sail and wondering if I should go with GHA instead :/

@Renanse
Copy link
Author

Renanse commented Sep 14, 2022

Hi Eric, happy to report that increasing the timeout helped my build pass. Thank you for your help!

@EricRibeiro
Copy link
Member

Hi Eric, happy to report that increasing the timeout helped my build pass. Thank you for your help!

Thanks for trying it out @Renanse! I have a PR open to officially include the new parameter in the orb on #32.

Thanks, Eric. I will give that a shot later today. This whole thing took a little wind out of my sail and wondering if I should go with GHA instead :/

That's fair. GameCI's Builder Action has been around for three years now, which means It's battle-tested and has had more time to evolve. Nevertheless, I'm glad you took the time to test the orb and provide us with your feedback.

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

Successfully merging a pull request may close this issue.

2 participants