Search Unity

Build process always checks out while repo (SVN)

Discussion in 'Unity Build Automation' started by msibrandi, Sep 29, 2014.

  1. msibrandi

    msibrandi

    Joined:
    Sep 19, 2012
    Posts:
    14
    It seems the build process always checks out the whole repository after a commit. I see this in every log:

    Checking out a fresh workspace because there's no workspace at /BUILD_PATH/com.<rest-of-bundle-id-removed>15.53f5c0501a6c061f250009f5.default-ios

    since the server is located in our network, it actually kills our network connection a little bit.

    Is this normal?

    Cheers,
    Maurice
     
    StarManta likes this.
  2. David-Berger

    David-Berger

    Unity Technologies

    Joined:
    Jul 16, 2014
    Posts:
    745
    Probably yes, this is normal behaviour for UCB. There are several reasons for making a clean checkout on each commit, but we usually cache the previous build library to save time there.

    So the log message might sound like an error, but it's not. We might make it a little bit clearer what's happening though.

    But you can disable the auto-build option in your project settings in the platform section if it kills the performance of your network and trigger it manually.

    Does the system finish the checkout and build your app?
     
  3. msibrandi

    msibrandi

    Joined:
    Sep 19, 2012
    Posts:
    14
    Yeah, it always finished and builds the app, but it is a relative small app and it takes 15 minutes to build it, which is mostly due to a full svn checkout (out upload speed isn't that great). It even checks it out 3 times, one for android, one for ios and one for web.

    > But you can disable the auto-build option in your project settings in the platform section if it kills the
    > performance of your network and trigger it manually.
    And that is why I would love a trigger mechanism where I can trigger a build by specifying a keyword in the commit message :)

     
    mgear and David-Berger like this.
  4. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Could you elaborate on this? To me this seems like just a huge waste of resources on every end of the process.
     
    msibrandi likes this.
  5. msibrandi

    msibrandi

    Joined:
    Sep 19, 2012
    Posts:
    14
    Indeed, (at least) svn takes care of delete, add and update operations. And because you do not edit files there is no chance of conflict (and if files do get edited because of the build process you can always revert before updating)
     
  6. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    It sounds like UCB is not keeping a copy of our project any longer than it has to for a specific build.

    That's probably a good thing.
     
  7. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Why would that be a good thing? Because it saves them space? Surely, if a repository is being committed to more than once a week, it must be more cost-effective to store a 1GB project file than it is to download a 1GB project file anew each time. Let alone if the project is being committed to several times a day!

    Would it be better because my studio's IP shouldn't reside outside my network? If that's the argument, downloading the project file each time should be an option - but it should still default to 'off'. Besides that, UT's bug reporter has been happily accepting (and, presumably, storing in perpetuity) project files for years.
     
  8. hypeNate

    hypeNate

    Unity Technologies

    Joined:
    Apr 4, 2014
    Posts:
    272
    @StarManta and @msibrandi - I totally understand what you are saying. We recommend that customers who are hosting their own source control repos inside an internal network (with bandwidth limitations) to file a support ticket with us. We may be able to assist with this problem on a case-by-case basis. As always, thanks for the input!
     
  9. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    That was indeed my point.

    Yet you have made a valid counterpoint.

    I've submitted several projects with bug reports but I've always created an isolated prototype to demo the bug. I've never submitted my main game project. But I suppose that many people would submit their game, especially as part of the automated crash reporter.

    I wonder what Unity's policy is toward retaining projects submitted through bug reports.

    As for UCB, maybe the option to cache project assets should exist for one of their paid tiers.
     
  10. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    What kind of build times are you guys typically getting?

    We work with quite a big GIT repo with a lot of history. After the initial checkout (the build took around 2 hours 30 mins) I thought UCB would just pull the latest changes and do a build (each time a commit was pushed). But it seems as mentioned by hypeNate that UCB clones a fresh copy each time, which is resulting into build times in excess of 2 hours each.

    Is there anyway to get UCB just to pull the latest changes and not a fresh copy each time?
     
  11. fischer_ag

    fischer_ag

    Joined:
    Nov 19, 2014
    Posts:
    23
    I also want a feature to pull the project, not cloning for every build. Add such an ability to the settings
    UCB could also clean all local files before new push for getting rid of possible conflicts. But it will safe a lot of build time! My project build takes now more then 30 minutes. It is too long! On local machine and TeamCity it takes not more than 6 minutes!
     
    hypeNate likes this.
  12. hypeNate

    hypeNate

    Unity Technologies

    Joined:
    Apr 4, 2014
    Posts:
    272
  13. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    We use an Amazon web service with Gitlab deployed on to it.
     
  14. hypeNate

    hypeNate

    Unity Technologies

    Joined:
    Apr 4, 2014
    Posts:
    272
  15. greenalice

    greenalice

    Joined:
    May 16, 2014
    Posts:
    13
  16. hypeNate

    hypeNate

    Unity Technologies

    Joined:
    Apr 4, 2014
    Posts:
    272
    Thanks @greenalice - this is good to know. Others experiencing slow build times, can you estimate the size of your repo along with the build times you are seeing?
     
  17. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    I'm wondering, is this situation still the same? This older comment implies that "clone the whole project every time" is the expected behavior, and that there is some sort of switch the UCB team can flip to turn it off in particular cases. (If this is the case, couldn't you guys simply expose the switch in our settings?) Your more recent comments/questions, though, seem to suggest that the clone behavior is being treated as a bug rather than the expected behavior, and I'm not sure which behavior - push vs clone - is expected at this point.

    Our ~2.5GB repository (hosted on BitBucket) project takes more than 30 minutes to compile.
     
  18. hypeNate

    hypeNate

    Unity Technologies

    Joined:
    Apr 4, 2014
    Posts:
    272
    Hi @StarManta - sorry for the confusion. The situation hasn't changed much, but let's recap:
    1. Yes - cloning the repo is the expected behavior, by default.
    2. Library caching will help with build (processing) times, but not checkout (cloning) times.
    3. A single build from Unity Cloud Build will never be faster than a local build, because: it's on a network! But if you add up all the build time you save not having to build platforms separately, it's faster.
    4. However - If you're experiencing really slow build times (hours, not minutes), because you self-host your repo inside your network and it's killing your bandwidth, or because your project is massive, or if you just think there is another reason your builds should be faster than they are, please contact us via a support ticket!
     
  19. fischer_ag

    fischer_ag

    Joined:
    Nov 19, 2014
    Posts:
    23
    Our project is hosted on bitbucket (git).
     
  20. fischer_ag

    fischer_ag

    Joined:
    Nov 19, 2014
    Posts:
    23
    We really need faster build time. For release build 30min-1h is ok. But our team can't wait this time for development build. I'm ready to pay you for the new feature (checkbox in settings): Pull, do not clone)
    Offtop: we also need another feature: ability to check and build from more than one branches. E.g. for development we need to build project from develop branch and any branches under /feature or /test. So additionaly to develop, build server could check any other branches set up to build, e.g. under /feature. Teamcity allows it using /feature/* pattern for branches. But I want it on UCB too;)
     
    StarManta likes this.
  21. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    Included a screenshot of the build info.
     

    Attached Files:

    hypeNate likes this.
  22. greenalice

    greenalice

    Joined:
    May 16, 2014
    Posts:
    13
    We've been trying the advanced caching feature (thanks to hypeNate) last days and build times decreased from 2.5 hours to under 1 hour. So far it's working great.
     
  23. Disastercake

    Disastercake

    Joined:
    Apr 7, 2012
    Posts:
    317
    I noticed that this happens with Unity Cloud Build and Git while using GitHub and LFS. I make a small change and it downloads entire GBs of data. Because Github has limited bandwidth, I couldn't use their service for my game repo since Unity Cloud Build ate through the bandwidth within a few builds.

    Bitbucket doesn't have bandwidth limitations (at the moment), so that seems like a better place to host a repo for use with Unity Cloud Build.

    Regardless, it does seems a little strange that the entire repo needs to be downloaded each time. I thought the point of SCM systems were to prevent this waste of resources.

    (Edit: Just noticed this was a big necro, but still seems to be a problem 4 years later.)
     
    Last edited: Jun 29, 2018
    JasonOrtinskid and AA-Matt like this.
  24. JasonOrtinskid

    JasonOrtinskid

    Joined:
    Jan 6, 2016
    Posts:
    22
    2 more years passed.. still no update option, still checking out each commit. This is a 3 hour build for my project. No very good. I am better off building locally manually.
     
  25. dri_richard

    dri_richard

    Joined:
    Mar 10, 2017
    Posts:
    153
    Another thread necro here.
    Enabled UCB auto build on one of our projects yesterday and used $75 worth of bandwidth.
    Disabled it this morning.

    I'll happily pay Unity for storing the extra data. As it is now, we can't use the system.