Need some help writing gitlab and gitlab-shell specs

Vít Ondruch vondruch at redhat.com
Mon Sep 23 11:11:45 UTC 2013


Dne 19.9.2013 20:42, Axilleas Pipinellis napsal(a):
>
> I have asked in #fedora-infra what FHS they use with the git repos in 
> fedorahosted and we concluded that the rails apps would go to 
> /usr/share/ and git repos and satellites to /usr/lib/.

Git repos in /usr/lib? That does not sound right. Later, you mention on 
same places /var/lib, that is more appropriate IMO. You might want to 
link to specific section of FHS and elaborate on such decision.

> So the current structure is:
>
> |-- /usr/share/gitlab/
> |     |-- gitlab/
> |     |-- gitlab-shell/
> |
> |-- /var/lib/gitlab/
> |     |-- satellites/
> |     |-- repositories/
> |     |-- .ssh/authorized_keys
> |
> |-- /etc/gitlab/
> |    |-- gitlab.yml
> |    |-- shell.yml
> |    |-- database.yml
> |    |-- unicorn.rb
>
> In /etc there will be configuration files with symlinks in the rails 
> app dirs. What are your thoughts on the directory locations? Do you 
> agree?

That looks good. However, I am not sure about the /etc/gitlab. Why there 
should be linked all the configuration? Current trend (which I support) 
is keep default configuration somewhere by the application, e.g. in 
/usr/{lib,share} and into /etc/gitlab place just configuration 
overrides, i.e. if you need to differ, you place configuration file into 
/etc/gitlab, otherwise the defaults are taken.

>
>
> And now my questions about the specs.
> FYI I have seen the katello.spec and took some info from there[1].
>
> gitlab-shell.spec
> -----------------
>
> This is kinda finished.
>
> SPEC: 
> https://github.com/axilleas/fedora/blob/master/packages/gitlab-shell/gitlab-shell.spec
>
>
> I tested the package and the appropriate user and group are created 
> when install/upgrade but when uninstalling, the homedir doesn't get 
> removed. I suspect this has something to do with useradd and 
> protecting the homedir of the user?
>
>
> gitlab.spec
> -----------
>
> This is a draft, I didn't test to install yet.
>
> SPEC: 
> https://github.com/axilleas/fedora/blob/master/packages/gitlab/gitlab.spec
>
> ## Ruby specific
>
> - rake tasks
>
> Many jobs, like the backup, initial database seed, etc. are done with 
> rake tasks. How do we invoke them without getting in the app root dir 
> every time? Is there some sort of mechanism for that?

You can call "rake -f /path/to/your/Rakefile", but it depends how the 
task is written.

>
> ## Generic
>
> - symlink logs to /var/log/gitlab/
>
> Not all logs' directory is configurable.

They should be. Logging somewhere into /usr/share makes no sense.

>
> - pids: move to /var/run/gitlab/ (?)
>
> GitLab is practically running using unicorn and sidekiq. These two 
> create each its own pid file in app_dir/tmp/pids/ by default. Luckily 
> this is configurable via their configs or systemd services. Also 
> unicorn creates a gitlab.socket which uses to speak with the app. If 
> we use apache this isn't needed, but with nginx we can use it. I was 
> thinking it could go under /var/run/gitlab/ too.

Sounds right.

>
> - how to support both databases. Is it feasible?
>
> GitLab supports mysql(mariadb for us) and postgres. How do we deal 
> with these cases inside a spec file? For now, I have added a comment 
> about the postgres config and made mariadb the default one.

I would go with something like 'gitlab-mariadb' and 'gitlab-postgres', 
which would provide appropriate configurations, but some could argue, 
that configuring system by installation of package is wrong.

>
> - ownership of directories
>
> In upstream installation guide, gitlab and gitlab-shell reside in the 
> same location that's why I decided to have them both under 
> /usr/share/gitlab/. And my question is, which package owns 
> /usr/share/gitlab/? Both?

Both, if they are independent. Or you can create some -filesystem 
package, which would own the directory.


Vít


More information about the ruby-sig mailing list