tango-controls / cppTango

Moved to gitlab
http://tango-controls.org
41 stars 34 forks source link

Gitlab CI migration #820

Closed mliszcz closed 3 years ago

mliszcz commented 3 years ago

This PR adds configuration for Gitlab CI/CD pipelines and introduces necessary test code changes to make them pass on Gitlab.

mliszcz commented 3 years ago

Note that for now I disabled two tests (one testcase in CXX::cxx_dserver::misc and event::change_event). I do not know how to correct them.

mliszcz commented 3 years ago

Also note that the same branch is pushed to the test gitlab repository: https://gitlab.com/tango-controls/test_gh_import/cppTango/-/tree/gitlab-ci-migration

mliszcz commented 3 years ago

And FYI we've just hit the dockerhub pull limit:

toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

The command "docker build --build-arg APP_UID=$(id -u) --build-arg APP_GID=$(id -g) -t cpp_tango .travis/${OS_TYPE}
andygotz commented 3 years ago

Hi @mliszcz - HNY!

How to solve this? Should we upgrade to a TEAM licence or should we host our own docker images? I see the limit is 200 / 6 hours. How many pull requests do we have per build? We could host the docker images on gitlab in the future: https://docs.gitlab.com/ee/user/packages/container_registry/

mliszcz commented 3 years ago

Hi Andy!

I think for now we don't need to do anything. As you've said, we are just blocked for six hours. I don't know how many pulls we need. @t-b calculated that some time ago and if I recall we were below the current limits. I exhausted this limit only due to extensive use of CI for testing the new Gitlab CI pipeline for cppTango.

Yes, we can move the images to Gitlab container registry if necessary, this is a good idea IMO. We can also keep the images in dockerhub and just mirror them (manually by docker push for now) in gitlab so that cppTango CI pipeline will not contribute to the dockerhub pull limits. This would be very simple to do.

In the long run I think we should stop using docker or any containers for tests in CI because it contributes to the execution time and it increases complexity of our setup. But this would require some changes on database ds side (mainly adding support for SQLite).

bourtemb commented 3 years ago

I created the Merge Request on the Gitlab test repo to check whether the tests triggered only on Merge Request are working properly. Here is the MR: https://gitlab.com/tango-controls/test_gh_import/cppTango/-/merge_requests/819

mliszcz commented 3 years ago

Thanks for triggering the ABI/API check. It failed:

$ docker exec -w /home/tango/src -e CI_TARGET_BRANCH=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} -e CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) cpp_tango .travis/check-ABI-API-compliance.sh || true
fatal: No such ref: 'origin/tango-9-lts'

Either gitlab uses different remote name or does not fetch all branches. I'll have a look right now.

mliszcz commented 3 years ago

API/API compliance check is fixed now: https://gitlab.com/tango-controls/test_gh_import/cppTango/-/jobs/956206341 By default Gitlab runner is not fetching any branches except the current one.

mliszcz commented 3 years ago

Thanks @t-b! For cleanup tasks I created an issue: https://github.com/tango-controls/cppTango/issues/821 Please use that one to report any things we should remember about after the migration.

mliszcz commented 3 years ago

Thank both of you for the review. Today or tomorrow I'm going to port these changes to 9.3-backports and open a similar PR.

mliszcz commented 3 years ago

@t-b, @bourtemb should I merge that one? Or after the migration? Note that it is disabling two tests.

bourtemb commented 3 years ago

@mliszcz For me, it's fine to merge it now.