简体   繁体   中英

How to reduce time running gclient sync for WebRTC

I am building WebRTC library using travis CI.

This is running well but takes lots of time and more and more often the build ends with the message :

The job exceeded the maximum time limit for jobs, and has been terminated.

You can consult a log that failed travis log

During the gclient sync :

_______ running 'download_from_google_storage --directory --recursive --num_threads=10 --no_auth --quiet --bucket chromium-webrtc-resources src/resources' in '/home/travis/build/mpromonet/webrtc-streamer/webrtc'
...
Hook 'download_from_google_storage --directory --recursive --num_threads=10 --no_auth --quiet --bucket chromium-webrtc-resources src/resources' took 1255.11 secs

I disabled the tests, so I think this is useless and it takes lots of time.

Is there anyway to give some arguments or setting some variables to avoid this time costly task ?

You can bake the entire toolchain into a docker image and run your actual tests/builds in that. Delegate the docker image update into another automated process (travis-ci cronjob for example).

An additional benefit is that you now have full control over when parts of your toolchain change. I find that very important.

Edit: Some resources to read.

A way to not download chromium-webrtc-resources defined in dependencies DEPS

{
    # Download test resources, i.e. video and audio files from Google Storage.
    'pattern': '.',
    'action': ['download_from_google_storage',
               '--directory',
               '--recursive',
               '--num_threads=10',
               '--no_auth',
               '--quiet',
               '--bucket', 'chromium-webrtc-resources',
               'src/resources'],
  },

is to pached it removing this section or adding a condition that is false.

In order to patch I used the folowing command :

sed -i -e "s|'src/resources'],|'src/resources'],'condition':'rtc_include_tests==true',|" src/DEPS

This save about 20mn and allow the travis build to stay below the timeout.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM