0

Hy There!

Please excuse me for not knowing mutch about GitLab, I'll summ up what do I wish for and please tell me if it is possible or not. And if yes, then refer a how to for me please. :slight_smile:

I wish to implement GitLab to store our repos which are mainly Laravel 5 projects. Also I wish to run some tests on them, like PHPUnit test, Behat, etc. For this, I currently use the docer ability of GitLab to build a project. It puts the files into a docker, there I have to run composer install, and a few other things. But this takes soooo long! It just slows down the development.

Is it possible to: Run "composer install" and "npm install" and other things that we need to set up the website ONCE on the repository, and from then on, we can do only the testing.

Bert
  • 347
  • 7
  • 25
  • You should configure your composer cache directory so you don't have to download all the dependencies every time. This question might help you: http://stackoverflow.com/a/34982814/4245525 – BrokenBinary May 31 '16 at 05:09
  • One way, it sounds good. Thank you very mutch. I'll try it out right away. However this could cause version missmatching between the test and production server. Just had an issue with this and it wasn't easy to find it out. Do you recommend testing the files directly on the server or I should stick to dockers? – Bert May 31 '16 at 07:38
  • Well, I've managed to set it up, but it saved me only 1 minute, but the build time is still at ~5 min. :( – Bert May 31 '16 at 13:02
  • Where is the bulk of that 5 minutes being spent? If its in the actual tests, then there's not much you can do. – BrokenBinary May 31 '16 at 16:32
  • That is the funny thing. It is not in the test itself but the whole setup. 1-2 minutes just to start the actual process. Then the 2nd part, where it slowes down and halts for another 1-2 minute is the `php artisan migrate:refresh --seed` command. When I check the CPU with `htop`, I can see mysqld is running with 100%. I don't think 2GB RAM + 4GB SWAP is that small for a GitLab Server. Or is it? – Bert Jun 01 '16 at 07:45
  • What is your swap utilization? Are you running your CI runners on your Gitlab host? That's not recommended. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/requirements.md#gitlab-runner – BrokenBinary Jun 01 '16 at 15:45
  • Unfortunatelly I have the runners on the same machine as the GitLab. Would that make so mutch impact on the build speed? And I have 2GB RAM and 4 GB swap if this was yout question. – Bert Jun 03 '16 at 07:22

1 Answers1

0

After you setup docker to cache the dependency downloads, your next step is to move your runners to a new host, or give your current host more RAM.

I'm using GitLab's Omnibus installation and my GitLab instance uses 1.7GB of RAM with very little traffic, and my runners use up to 1GB when running some of my builds and tests. If your GitLab instance and runners have a similar memory footprint, then your machine will start to use the swap memory during tests and that will really slow down your runners.

Also, your runners likely have high CPU usage when running tests, and add on top of that the CPU required when your system is using swap memory, and you start to slow down there too.

I would recommend moving the runners to a different machine, for performance and security reasons. If you can't do that, then at least increase the RAM to 3GB.

Community
  • 1
  • 1
BrokenBinary
  • 7,731
  • 3
  • 43
  • 54