Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

The specification of the UCB build agents unknown

Discussion in 'Unity Build Automation' started by erdemsahinardentblue, Feb 10, 2020.

  1. erdemsahinardentblue

    erdemsahinardentblue

    Joined:
    Dec 3, 2019
    Posts:
    6
    Are they running on a windows os or mac os?

    which toolS are already installed on them?

    a documentation reference would be great. I got stuck working on asset bundles. I have no idea how to push them to Amazon S3
     
  2. erdemsahinardentblue

    erdemsahinardentblue

    Joined:
    Dec 3, 2019
    Posts:
    6
    Any examples on this ?

    I assume the build agent is running mono

    and

    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    unzip awscliv2.zip
    sudo ./aws/install

    after this install should i be able to copy the files in the ucb to the S3 is there any limitations on this ?
     
  3. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    459
    You will not be able to run sudo on the build agents due to security restrictions, this will make it much more difficult to install the AWS CLI. I'm also not sure if curl or unzip are installed on the build agents, likewise due to security restrictions. You're welcome to try this out but I doubt it will work.

    We are working actively on improving the workflow for Asset Bundles/Addressables in UCB and you should expect to see additional functionality in this area in the near future. For the moment you might find it easiest to create a webhook listening app that takes responsibility for uploading the asset bundles - see this post for an example of a webhook listener.
     
  4. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    459
    To a certain extent this is intentional - post-build scripting is permitted but not supported. We do not make any promises about what hardware or software the build agents will use since we may need to swap it out at any point (or even operate multiple separate configurations at the same time). You are welcome to try out post-build scripting and we aren't going to actively try to make things difficult for you but we aren't willing to make any promises around what will happen there. If you want to avoid the risks associated with post-build scripting then I would again recommend seeing my above post which uses the (fully supported) webhooks method to grab details about the build and could easily be modified to apply to S3 uploads.

    That said, we're currently running builds on OSX. In the near future we're also expecting to deploy Windows builders and are currently unwilling to commit to how exactly those will execute. Most likely those will have cygwin available however. OSX is currently in the process of deprecating bash support and moving to zsh so that will be another consideration if you're trying to use shell scripting. Additionally (as outlined above) the build agents are quite locked down and do not install any tools which are not necessary for the build, this includes many applications which you may have expected to see as standard shell utilities.

    If you are committed to writing a post-build script then I would recommend using Ruby to achieve your goals. We run Ruby v2.4.2 and since this is OS-independent you are much less likely to encounter interruptions and breakages when we update the build agents. I believe you can run gem installs on build agents but if that does not work then you should be able to upload the required source files into your VCS. There is a full-featured SDK for Ruby provided by Amazon, with examples of uploading a file available.

    (Also note that environment variables are supported by Unity Cloud Build and I recommend using those to store your AWS keys if you do take this approach)
     
  5. erdemsahinardentblue

    erdemsahinardentblue

    Joined:
    Dec 3, 2019
    Posts:
    6
    thanks for the detailed answers.

    What I got
    1.use webhooks if you can
    2.Post-build scripts can fail due to changes.
    3.Don't use Sudo, and try to leverage ruby which is already there.

    By the way
    I was able to use the UCB API to download the assets and push them to S3.After selecting the AssetBundles options in the build config.

    Right now I need to have the webhook or the ruby trigger my AWS API Gateway to start the process.