Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cbi-dev] git operations failing on CI - workaround!
  • From: Denis Roy <denis.roy@xxxxxxxxxxxxxxxxxxxxxx>
  • Date: Mon, 8 Jun 2020 11:16:21 -0400
  • Autocrypt: addr=denis.roy@xxxxxxxxxxxxxxxxxxxxxx; prefer-encrypt=mutual; keydata= mQENBFSQVYcBCACphCllQd59H3sF23T1XUD8h6pNPvRwuKKpfcwTAL7qe98PbMBQBLuy3ocj 04PcvlRj8lCR9JmChFc9V5Bi61MTdCrshEbiyomw/ZWdfFbmc4/rlMWg00gTO94SP0zMl96x np0aNi8cGwD258NUVD1+tlvraukr6yixD25qCGQ313lOO71l1R8eJun/Kx7SEFXtMFJ7Er4r /QnfFioFFwWGiUXbGhioCZhggQWnq3U+LOZzGKp0SuWSQuu0RzQB57Fy8EN2bmX61EKGaFnr TR/8yk8EdifupYgDc6XCxndktFJYFse4v4XQSPNIIUwcBT/Ji732xdXiR4YnL0SNAVBDABEB AAG0NkRlbmlzIFJveSAoRWNsaXBzZSkgPGRlbmlzLnJveUBlY2xpcHNlLWZvdW5kYXRpb24u b3JnPokBOAQTAQIAIgUCWWjoCAIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQQI23 cA21ZyMHGgf/THQqUR43XqUhSytf3q0Wmq1KBCDUpLXQYfpe1uh464robj4iUsoCMDhlEzbU uy0p+de87aVv68ZGRPOlz0oIt80NZbHxLErhunjFGhJvnw/V5jf2lYThiWysDcQMUSIGERuy 3wIyVFVF4RDZB4jjvrPvQ/dy+x+mN38t76C8x5sp4oup19sy9u4EUzPpEInBNs8ADoKO9kOl ZbTOkIFSqC4aI0yABRMbur+mks+b9IaVVQytK4zlzTROuBNHnjx6kgfAV5L8ezQpgBkVLrLw HwB+Rmsnx/qbRXrRmESiiD6aVQQntkfj0zXK/XzMpm1+9qxA8TBj6nFXo/ivNqDx7LkBDQRU kFWHAQgAy/xnfKzcxiCyHtP2a3mbRW04xMwDoLWj+3khfudiHgQWNLDiN/oTAJag5cOrh17L ewRDuhEctJ71Nb+bkMNHvJvq5KC0oB1x54ocQGa493Q/9irIYaEbXVcVqyggmTO6lPvLcA9+ mdQZNvfFlnxS05z+c2CvNNqhgrFU4xS6MTuGEA6oduha0mbDodPKNBh8MkL7OjlYO/44H4l0 MsBYJ57QhQqeOVv1C8Sc2hstk8ZcCc3G2W29Beh0Li5WFYf7F8L0JtxuDSLGisWJL5cAZvdE Zrd/BNAOE02+fANl9iYkX+pG1rjYMdtm/UpLo38jovcyWhOc+TE7qab72wO8iQARAQABiQEf BBgBAgAJBQJUkFWHAhsMAAoJEECNt3ANtWcjxEMH/Rer0weIKA1jV72FNQpHaKuGuUmqW6ak qQHSRKZEECjTa9E1M/Mvdr21qE/zYR7tFD9zc2wqhxBDBD8azKQLZo2TSTnqyUPdr2Dy3KFS FoavCvaVzEt7c3sA/TxXWXQhxGJL56yj2VZaF+k7j/DtYl6nG62bS0rQbg/3/RllmXa51QIT V5ZPnTo6NFJ5K3lbn7EoQbVT2LdkPmabPqw6DT+ZjQlJS3Q8iI0wSoS6r9D7QQG/VaeKGjoK TRDRn/5YUnof4vjpao8jIRMJ+5RBlRto96jwt7hfNm842GsqT4ddMyYmTLGnYLUae9rl2GmN ahBMbQ9PB8Ta/DeCpIxpOyk=
  • Delivered-to: cbi-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/cbi-dev>
  • List-help: <mailto:cbi-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/cbi-dev>, <mailto:cbi-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/cbi-dev>, <mailto:cbi-dev-request@eclipse.org?subject=unsubscribe>
  • User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

Thanks, Jonah.

Denis

On 2020-06-05 5:03 p.m., Jonah Graham wrote:
Hi folks,

Those of us (like CDT) working with larger git repositories have been having lots of git failures on the new Jiro based Jenkins CI. There have been slow clones, and full on failing checkouts. 

For many of the examples it turns out this is a resource allocation problem in k8s and how Jenkins interacts with it. You can read about that in Bug 560283. Mikaël Barbero has an approved PR in Jenkins so hopefully the problems will be resolved soon. 

In the meantime you can do this workaround in your pipelines. Before the git/checkout pipeline step, fetch the changes from git in a sh step. This sh step can run in your main container, instead of the git/checkout which always runs in the JNLP container. Running in your main container means that much more resources are available to git and the git fetch will run faster.

For CDT our normal fetch time was 4+ minutes, and regularly timed out after 10 or even 20 minutes. With the workaround the fetch time is ~1 minute.

An example of what you need to change is this:

stage('Git Clone') {
steps {
container('cdt') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], ...
}
}
}


to

stage('Git Clone') {
steps {
container('cdt') {
timeout(activity: true, time: 20) {
/* Running the git fetch command manually is a workaround. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=560283#c16 */
sh 'git config remote.origin.url https://git.eclipse.org/r/cdt/org.eclipse.cdt.git'
sh 'git fetch --no-tags --force --progress -- https://git.eclipse.org/r/cdt/org.eclipse.cdt.git +refs/heads/*:refs/remotes/origin/*'
}
checkout([$class: 'GitSCM', branches: [[name: '*/master']], ...
}
}
}
You want to leave the git/checkout step in place as that is how Jenkins knows what to query and what to display changes on. With the change it won't have to do the heavy lifting of actually fetching the changes. 

See commit 5080b30 in cdt-infra for CDT's change in practice.
 
HTH,
Jonah


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

_______________________________________________
cbi-dev mailing list
cbi-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cbi-dev
--

Denis Roy

Director, IT Services | Eclipse Foundation, Inc.

Eclipse Foundation: The Platform for Open Innovation and Collaboration

Twitter: @droy_eclipse


Back to the top