简体   繁体   English

如何减少为WebRTC运行gclient同步的时间

[英]How to reduce time running gclient sync for WebRTC

I am building WebRTC library using travis CI. 我正在使用travis CI构建WebRTC库。

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 您可以查阅travis日志失败的日志

During the gclient sync : 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. 您可以将整个工具链烘焙到docker映像中,然后在其中运行您的实际测试/构建。 Delegate the docker image update into another automated process (travis-ci cronjob for example). 将docker映像更新委托给另一个自动化过程(例如,travis-ci cronjob)。

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 一种不下载依赖项DEPS中定义的chromium-webrtc-resources 方法

{
    # 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. 要修补它以删除此部分或添加为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. 这样可以节省约2000万,并使travis构建保持在超时以下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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