Can gitlab CI run as non root?
Closed, ResolvedPublic

Description

Or at least the tests?

Our code is not usually expecting to be run as root, and there's at least one test that fails because of that

https://invent.kde.org/frameworks/kconfig/-/merge_requests/91

I think it would be a good idea to run tests as a "normal user" if possible since it resembles more the actual environment tests are supposed to be run.

If it's hard to fix i guess we can "workaround" it in code like that MR above.

aacid created this task.Nov 29 2021, 3:55 PM
Restricted Application added a subscriber: sysadmin. · View Herald TranscriptNov 29 2021, 3:55 PM

This has to wait until Jenkins (build.kde.org) can be decommissioned as only then will we be able to adjust our images default user to be non-root.
This is something Gitlab itself does not allow you to adjust unfortunately.

bcooksley changed the visibility from "Custom Policy" to "Public (No Login Required)".Sep 4 2022, 8:35 AM
bcooksley changed the edit policy from "Custom Policy" to "All Users".

Following the shutdown of build.kde.org, and a check of the Binary Factory (which appears it no longer makes use of the SUSE image) there is no longer any blockers to implementing this.

Given that Gitlab currently checks out code itself as root I do expect that this could cause some breakage (as the directory containing the sources will be owned by root) so will need to schedule some time in the coming week or so to implement this.

bcooksley closed this task as Resolved.Oct 2 2022, 8:35 AM
bcooksley claimed this task.

This has now been put in place.