slapos.git
7 years agoAdd nayuos software recipe.
Isabelle Vallet [Fri, 12 Feb 2016 14:14:01 +0000 (06:14 -0800)]
Add nayuos software recipe.

This is a SR to build NayuOS binary images.
More info on https://www.nayuos.com and in the README.

Merging this recipe from a standalone repository was a decision made together with @kirr and @vpelletier.

7 years agonayuos: Add error message shown in the runner's services logs.
iv [Fri, 12 Feb 2016 12:49:40 +0000 (12:49 +0000)]
nayuos: Add error message shown in the runner's services logs.

7 years agonayuos: Automatically clone NayuOS ebuilds set, change comments.
iv [Wed, 10 Feb 2016 16:10:02 +0000 (16:10 +0000)]
nayuos: Automatically clone NayuOS ebuilds set, change comments.

7 years agocomponent/openblas: put `build-common-options` in one line
Jérome Perrin [Wed, 10 Feb 2016 10:00:26 +0000 (11:00 +0100)]
component/openblas: put `build-common-options` in one line

slapos.recipe.cmmi executes command lines by line, so this build options
were ignored.

7 years agoversion up: gmp 6.1.0
Rafael Monnerat [Tue, 9 Feb 2016 16:50:01 +0000 (17:50 +0100)]
version up: gmp 6.1.0

  older versions are failing on ARM arch.

7 years agonayuos: Update README.
iv [Tue, 9 Feb 2016 13:00:51 +0000 (14:00 +0100)]
nayuos: Update README.

7 years agonayuos: Add virtualenv.
iv [Mon, 8 Feb 2016 14:35:39 +0000 (14:35 +0000)]
nayuos: Add virtualenv.

7 years agoversion up : OpenBLAS 0.2.15. First try with auto-detected target and if it fails... erp5-component
Kazuhiko Shiozaki [Tue, 26 Jan 2016 15:05:58 +0000 (16:05 +0100)]
version up : OpenBLAS 0.2.15. First try with auto-detected target and if it fails try TARGET=GENERIC.

You can also spcify the target explicitly by build-ext-options.

reviewd-by @Tyagov (on nexedi/slapos!42).

7 years agoversion up : OpenSSL 1.0.2f, fixing CVE-2016-0701 and CVE-2015-3197.
Kazuhiko Shiozaki [Tue, 2 Feb 2016 09:20:09 +0000 (10:20 +0100)]
version up : OpenSSL 1.0.2f, fixing CVE-2016-0701 and CVE-2015-3197.

7 years agoerp5: ERP5 and Jupyter integrated together
Kirill Smelkov [Mon, 1 Feb 2016 11:19:34 +0000 (14:19 +0300)]
erp5:  ERP5 and Jupyter integrated together

This patch series teaches ERP5 software release to automatically instantiate
Jupyter notebook web UI and tune it to connect to ERP5 by default. When Jupyter
is enabled, it also installs on-server erp5_data_notebook bt5 (see
nexedi/erp5!29 and nexedi/erp5@f662b5a2) which handles code execution requested
for Jupyter.

For ERP5 - for security and backward compatibility reasons - Jupyter
instantiation and erp5_data_notebook bt5 install happen only if jupyter is
explicitly enabled in instance parameters. The default is not to have Jupyter
out of the box.

On the other hand for Wendelin SR, which inherits from ERP5 SR, the
default is to have Jupyter out of the box, because Wendelin SR is fresh
enough without lots of backward compatibility needs, and Jupyter is
usually very handy for people who use Wendelin.

--------

NOTE Currently erp5-data-notebook bt5 has the following limitations (see
details on nexedi/slapos!43 and nexedi/erp5!29):

- errors are not reported properly to users;
- state is not fully saved to ZODB.

the latter point means notebook works only if it is connected to Zope family
with only 1 zope process. Hopefully this will be resolved some day.

Technical overview about how the integration is done itself on slapos part and
other notes are in 0a446263.

/proposed-for-review-on nexedi/slapos!43

7 years agoJupyter: ERP5 kernel sends code using POST
Douglas [Wed, 23 Dec 2015 14:04:39 +0000 (12:04 -0200)]
Jupyter: ERP5 kernel sends code using POST

Query strings used on GET requests have size limitations
on servers and this causes big code cells to not be executed
at all, returning only an Internal Server Error with no
further explanation.

/reviewed-by @kirr, @Tyagov (on nexedi/slapos!43)

7 years agoerp5: Provide pandas, scikit-learn & matplotlib out of the box
Kirill Smelkov [Wed, 27 Jan 2016 18:35:23 +0000 (21:35 +0300)]
erp5: Provide pandas, scikit-learn & matplotlib out of the box

Pandas and scikit-learn are handy to have for data processing which we
are going to do more and more in ERP5 context. Matplotlib is very handy
to have when one works with Jupyter, but also can be used by just
backend code to generate graphs.

From this point of view it makes sense to have this eggs always
available out of the box. To do so move them from Wendelin to ERP5.

/suggested-by @tiwariayush
/reviewed-by @Tyagov (on nexedi/slapos!43)

7 years agoERP5 and Jupyter integrated together
Kirill Smelkov [Wed, 27 Jan 2016 08:40:23 +0000 (11:40 +0300)]
ERP5 and Jupyter integrated together

This patch teaches ERP5 software release to automatically instantiate Jupyter
notebook web UI and tune it to connect to ERP5 by default. When Jupyter is
enabled, it also installs on-server erp5_data_notebook bt5 (nexedi/erp5!29)
which handles code execution requested for Jupyter.

For ERP5 - for security and backward compatibility reasons - Jupyter
instantiation and erp5_data_notebook bt5 install happen only if jupyter is
explicitly enabled in instance parameters. The default is not to have Jupyter
out of the box.

On the other hand for Wendelin SR, which inherits from ERP5 SR, the
default is to have Jupyter out of the box, because Wendelin SR is fresh
enough without lots of backward compatibility needs, and Jupyter is
usually very handy for people who use Wendelin.

~~~~

For integration, we reuse already established in ERP5 infrastructure, to
request various slave instances, and request Jupyter in a way so it
automatically tunes and connects to balancer of one of Zope family.

Jupyter code itself is compiled by reusing
software/ipython_notebook/software.cfg, and Jupyter instance code is
reused by hooking software/ipython_notebook/instance.cfg.in into ERP5 SR
properly (the idea to override instance-jupyter not to render into
default template.cfg is taken from previous work by @tiwariayush).

~~~~

I tested this patch inside webrunner with create-erp5-site software type and
various configurations (whether to have or not have jupyter, to which zope
family to connect it, etc).

I have not tested frontend instantiation fully - because tests were done only
in webrunner, but I've tried to make sure generated buildout code is valid for
cases with frontend.

NOTE the code in this patch depends erp5_data_notebook bt5 (nexedi/erp5!29) which just got merged to erp5.git recently (see nexedi/erp5@f662b5a2)

NOTE even when erp5_data_notebook bt5 is installed, on a freshly installed ERP5, it
is required to "check site consistency" first, so that initial bt5(s) are
actually installed and erp5 is ready to function.

/cc @vpelletier, @Tyagov, @klaus, @Camata, @tiwariayush, @Kreisel, @jerome, @nexedi
/proposed-for-review-on nexedi/slapos!43

7 years agocomponent/slapos: version up setuptools 19.6.2 and zc.buildout 2.5.0+slapos001.
Kazuhiko Shiozaki [Sun, 31 Jan 2016 13:48:47 +0000 (14:48 +0100)]
component/slapos: version up setuptools 19.6.2 and zc.buildout 2.5.0+slapos001.

7 years agoversion up : MariaDB 10.1.11, groonga 5.1.2 and mroonga 5.12.
Kazuhiko Shiozaki [Sat, 30 Jan 2016 20:54:31 +0000 (21:54 +0100)]
version up : MariaDB 10.1.11, groonga 5.1.2 and mroonga 5.12.

7 years agoversion up : libpng 1.6.21.
Kazuhiko Shiozaki [Wed, 27 Jan 2016 20:09:26 +0000 (21:09 +0100)]
version up : libpng 1.6.21.

7 years agoversion up : curl 7.47.0, fixing CVE-2016-0754 and CVE-2016-0755.
Kazuhiko Shiozaki [Wed, 27 Jan 2016 19:41:04 +0000 (20:41 +0100)]
version up : curl 7.47.0, fixing CVE-2016-0754 and CVE-2016-0755.

7 years agoversion up eggs.
Kazuhiko Shiozaki [Mon, 25 Jan 2016 08:43:15 +0000 (09:43 +0100)]
version up eggs.

7 years agogitlab: Fix rendering of ReStructuredText documents
Kirill Smelkov [Wed, 27 Jan 2016 20:31:36 +0000 (23:31 +0300)]
gitlab: Fix rendering of ReStructuredText documents

Gitlab uses github-markup to render various text-based markups
(markdown, rst, ...) into html. For rst github-markup wants to run
python and have docutils egg available:

    https://github.com/github/markup/blob/5393ae93/lib/github/markups.rb#L36

as we were not having docutils installed and path to proper python
interpreter setup, rst documents were not automatically rendered and
were show just as plain text.

We do a lot of documents in rst - that case is important for us.

So fix it by providing gitlab with properly setup python interpreter
with all needed eggs installed.

/cc @kazuhiko, @jerome
/proposed-for-review-on nexedi/slapos!39

7 years agonayuos: Fix bashrc!
iv [Thu, 28 Jan 2016 14:10:24 +0000 (14:10 +0000)]
nayuos: Fix bashrc!

7 years agoJupyter: Switch to using JSON in instance parameters
Kirill Smelkov [Wed, 27 Jan 2016 08:30:23 +0000 (11:30 +0300)]
Jupyter: Switch to using JSON in instance parameters

The reason is: we are going to integrate Jupyter into ERP5 SR, and in
ERP5 SR code, there is already established infrastructure, which
requests slave instances. That infrastructure passes parameters in
serialized (= json) form, that's why we need to switch.

On the other hand, slapos.cookbook:slapconfiguration.serialised handles
non-json instance parameters as well: when there parameters format is
not

    {'_' -> <json>}

it decodes them as slapos.cookbook:slapconfiguration would do:

    https://lab.nexedi.com/nexedi/slapos/blob/69229988/slapos/recipe/slapconfiguration.py#L232
    https://lab.nexedi.com/nexedi/slapos/blob/69229988/slapos/recipe/librecipe/__init__.py#L51

So from this point of view, though we don't really need it here (Jupyter
SR is relatively new), we are staying backward compatible.

/cc @tiwariayush

7 years agocomponent/slapos: version up zc.buildout 2.4.7+slapos001 and zc.recipe.egg 2.0.3...
Kazuhiko Shiozaki [Tue, 10 Nov 2015 12:49:29 +0000 (13:49 +0100)]
component/slapos: version up zc.buildout 2.4.7+slapos001 and zc.recipe.egg 2.0.3+slapos001.

7 years agowendelin: Don't pin what is already included and pinned in erp5 SR
Kirill Smelkov [Tue, 26 Jan 2016 09:39:12 +0000 (12:39 +0300)]
wendelin: Don't pin what is already included and pinned in erp5 SR

Both numpy and ipython are included in ERP5 SR which wendelin inherits
from, and are pinned there. Here are e.g. latest pin-ups for numpy and
ipython in erp5:

    e3144a8a    (version up eggs.)
    135570c9    (version up eggs.)

Furthermore: this is not only a cleanup. As e3144a8a shows current
version of numpy in erp5 is 1.10.4 and in wendelin we still have 1.9.2
which is unintentional downgrade compared to erp5.

Don't do that.

/cc @kazuhiko
/reviewed-by @Tyagov  (on nexedi/slapos!41)

7 years agoNEO repository has moved to lab.nexedi.com
Julien Muchembled [Mon, 25 Jan 2016 20:26:57 +0000 (21:26 +0100)]
NEO repository has moved to lab.nexedi.com

7 years agobabeld moved to https://lab.nexedi.com/nexedi/babeld
Nicolas Wavrant [Mon, 25 Jan 2016 16:23:08 +0000 (17:23 +0100)]
babeld moved to https://lab.nexedi.com/nexedi/babeld

7 years agowendelin: Remove bt5_list leftover
Kirill Smelkov [Sun, 24 Jan 2016 18:36:04 +0000 (21:36 +0300)]
wendelin: Remove bt5_list leftover

@rafael added this in 971d0bb7 (erp5: Make possible extent the list of
initial business templates to install), but we dropped that change while
merging erp5-cluster to master - see:

    6bbb61a8 "Merge branch 'master' into erp5-cluster", and
    e84d5e83 "Merge branch 'erp5-cluster'"

6bbb61a8 claimed that it

    Dropped commit 971d0bb7d6fbb7e51fd8417386b7956d83597ccd
    ("erp5: Make possible extent the list of initial business templates to install").

but it actually dropped changes only under stack/erp5/ , not software/wendelin/

Fix it.

/cc @rafael, @jm, @Tyagov
/reviewed-by TrustMe

7 years agoERP5: remove a few dependencies to obsolete eggs
Julien Muchembled [Fri, 22 Jan 2016 23:12:05 +0000 (00:12 +0100)]
ERP5: remove a few dependencies to obsolete eggs

7 years agofixup! add md5sum in egg patches.
Jérome Perrin [Thu, 21 Jan 2016 04:47:34 +0000 (05:47 +0100)]
fixup! add md5sum in egg patches.

7 years agoopenssl: code clean up, with possibility to easily override --openssldir/--prefix
Julien Muchembled [Fri, 15 Jan 2016 18:52:01 +0000 (19:52 +0100)]
openssl: code clean up, with possibility to easily override --openssldir/--prefix

In slapos.package.git/obs, we need to build binaries for specific paths,
without changing where buildout actually install them.

7 years agocleanup setup-eggs.
Kazuhiko Shiozaki [Fri, 15 Jan 2016 15:53:33 +0000 (16:53 +0100)]
cleanup setup-eggs.

7 years agoadd md5sum in egg patches.
Kazuhiko Shiozaki [Fri, 15 Jan 2016 11:42:52 +0000 (12:42 +0100)]
add md5sum in egg patches.

7 years agoGitLab Software Release - first version
Kirill Smelkov [Sun, 17 Jan 2016 23:33:48 +0000 (02:33 +0300)]
GitLab Software Release - first version

Hello up there,

Here comes SlapOS port of GitLab. We start from GitLab 8.2.X as that is what we
currently run on KVM on lab.nexedi.com, so that our data can be
straightforwardly migrated.

The SR compiles all needed software and organized all (sub-)services in one
partition and interconnects them with unix sockets for security and speed
reasons (see patch "gitlab: Make a plan to base instance layout on
gitlab-omnibus and to interconnect all internal services").

Services configuration files are originally taken from omnibus-gitlab
"distribution" and incrementally ported to slapos variant. This way we
establish a (imho) good path on how to track upstream changes and minimize our
delta & effort supporting it.

GitLab itself is patched (above patches that were already applied by upstream):

  - to support HTTP(S) only
  - to show site's ICP number
  - to speedup raw blob downloading ~ 17x times
    ( see patch "gitlab: Optimize raw blob downloading" for details and
      https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/17 )

Overall it should work and we should finally be able to migrate slapos.git
(because of raw blob downloading is not slow now) to GitLab and all other
Nexedi git repositories.

Thanks,
Kirill

P.S.

Somewhat outdated, but this picture on GitLab architecture might help to
understand how parts are glued together:

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/architecture.md

P.P.S.

Native resiliency is not implemented yet, but we should be able to use gitlab
inside resilient webrunner already.

/proposed-for-review-on nexedi/slapos!39
/partly-reviewed-by @kazuhiko, @jerome, @Yanni, @jp
/cc @rafael, @jm

7 years agogitlab: First SR version works - freeze md5 sums
Kirill Smelkov [Fri, 8 Jan 2016 12:23:52 +0000 (15:23 +0300)]
gitlab: First SR version works - freeze md5 sums

We've reached a state where first gitlab SR version should work. So as
promised let's freeze the md5 checksums.

All later patches should update corresponding md5 info when they change
a file.

/cc @kazuhiko, @jerome

7 years agogitlab: Optimize raw blob downloading
Kirill Smelkov [Fri, 8 Jan 2016 11:24:53 +0000 (14:24 +0300)]
gitlab: Optimize raw blob downloading

In slapos we do a lot of automated software rebuild constantly, and thus
there is constant flow of requests to get raw blobs from git service,
e.g. like this

    https://lab.nexedi.com/nexedi/slapos/raw/master/software/wendelin/software.cfg

A lot of requests comes to slapos.git repository and currently gitlab,
out of the box, cannot keep up with that load.

I've prepared patches to offload raw blobs download requests handling
from unicorn (ruby) to gitlab-workhorse (go), and that resulted in ~ 17x
speedup - e.g. previously our std shuttle can handle ~ 70 raw-blob
requests/s and with my changes it is now ~ 1200 requests/s.

The patches were sent upstream

    https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/17

and we discussed with GitLab people and made a plan how to proceed
incrementally. It will probably take some time for gitlab team to fully
accept the approach though.

For now we can use our gitlab-workhorse fork. The patches itself are:

    https://lab.nexedi.com/kirr/gitlab-workhorse/commit/1b274d0d
    https://lab.nexedi.com/kirr/gitlab-workhorse/commit/2beb8c95

/cc @kazuhiko, @jerome, @jm

7 years agogitlab: Switch to "GitLab Nexedi Edition"
Kirill Smelkov [Fri, 8 Jan 2016 10:48:40 +0000 (13:48 +0300)]
gitlab: Switch to "GitLab Nexedi Edition"

GitLab Nexedi Edition is currently upstream 8.2.X + the following
patches:

    - HTTP(S) is made to be default clone protocol

        https://lab.nexedi.com/kirr/gitlab-ce/commit/5c1f2fb3

      and SSH info is completely removed from UI

        https://lab.nexedi.com/kirr/gitlab-ce/commit/dfe9fb16
        https://lab.nexedi.com/kirr/gitlab-ce/commit/f3f84743

      so essentially the only way to access a repository is via HTTP(S).

    - Rake check tasks are adjusted to exit with non-zero code if there
      is a failure

        https://lab.nexedi.com/kirr/gitlab-ce/commit/a93ae418

      We need this for promises to work correctly with failures being
      detected, not silently skipped. The patch was sent upstream:

        https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1885

    - GitLab supports setting up site's ICP License in gitlab.yml and
      shows it in appropriate places together with info about GitLab
      itself:

        https://lab.nexedi.com/kirr/gitlab-ce/commit/e7e0fd88
        https://lab.nexedi.com/kirr/gitlab-ce/commit/79c127e6

    + other cosmetic/minor changes.

More patches will probably come (e.g. apply a single patch from a
merge-request with `git am` without creating merge commit for just 1
patch, etc) but for now that's all.

NOTE ICP is non-ascii text with hieroglyphs. slapos.core was taught to
    be able to pass parameters with non-ascii values to instance:

        https://lab.nexedi.com/nexedi/slapos.core/commit/347d33d6

    That patch is included in slapos.core 1.3.15, but as we currently
    have a lot of older slapos.core deployed (e.g. 1.3.5 on my
    development webrunner) a workaround is (hopefully temporarily) used
    to pass non-ascii values as URL-encoded strings.

/cc @kazuhiko, @jerome, @rafael

7 years agogitlab: Publish connection URL
Kirill Smelkov [Fri, 8 Jan 2016 10:41:45 +0000 (13:41 +0300)]
gitlab: Publish connection URL

In the previous patch we setup nginx service which listens to the world
and as such gitlab service becomes to be ready to used - so publish
backend URL.

NOTE we'll need to optimise and tweak gitlab a bit further in upcoming
    patches, so it can be really used under load and with our use-cases,
    but even now it listens to http ok and generally works.

/cc @kazuhiko, @jerome

7 years agogitlab/nginx: Slapos'ify config and turn nginx into a service
Kirill Smelkov [Fri, 8 Jan 2016 10:08:38 +0000 (13:08 +0300)]
gitlab/nginx: Slapos'ify config and turn nginx into a service

Go through nginx configuration templates and convert them to jinja2 with
slapos parameters (reminder: names and default values are imported from
omnibus-gitlab 8.2.3+ce.0-0-g8eda093), except commenting out features we
do not want to support (yet ?).

As nginx is a reverse-proxy, i.e. it integrates all internal services
and works as frontend to them, our gitlab service is now ready to listen
and talk to the world over (standard to slapos services backend) IPv6.

Nginx also acts as SSL termination point - for it to work by default we
setup self-signed certificate for the backend, which can be manually
changed to proper certificate if needed. Backend certificate is used
if gitlab is configured to work in HTTPS mode (and frontend certificate
is another story).

NOTE ssl certificate is generated with just `openssl req ...` - yes, there
    is slapos.cookbook:certificate_authority.request but it requires
    to start whole service and has up to 60 seconds latency to generate
    certificate. And we only need to run 1 command to do that...

The features disabled are:

    - http -> https redirection

      not needed for us at nginx level - the frontend can do the
      redirection and also gitlab speaks HSTS on https port so when we access
      https port via http protocol, it gets redirected to https.

    - kerberos
    - ssl_dhparam
    - providing custom nginx configuration via instance parameter

/cc @kazuhiko, @jerome

7 years agogitlab: Hook nginx configuration files into SR system
Kirill Smelkov [Fri, 8 Jan 2016 09:57:05 +0000 (12:57 +0300)]
gitlab: Hook nginx configuration files into SR system

Like with Rails configuration files, hook nginx configuration files into
SR / instance build process; rename *.erb -> *.in and add our header.

The templates are still not valid - a lot of erb code is left there -
we'll slapos'ify it incrementally in the following patches.

/cc @kazuhiko, @jerome

7 years agogitlab: Import nginx http configuration from omnibus-gitlab
Kirill Smelkov [Fri, 8 Jan 2016 09:42:48 +0000 (12:42 +0300)]
gitlab: Import nginx http configuration from omnibus-gitlab

Like with Rails configuration this first step is pristine import of
nginx configuration files from omnibus-gitlab. All files were imported
as-is in their ERB form and filenames from omnibus-gitlab
8.2.3+ce.0-0-g8eda093 from here:

    https://gitlab.com/gitlab-org/omnibus-gitlab/tree/8eda093/files/gitlab-cookbooks/gitlab/templates/default

We import only nginx main http configuration - nginx's CI and Mattermost
configurations are not imported, as we do not support CI and Mattermost (yet ?).

As with Rails configuration files, we will convert the templates to
jinja2 and adjust them to slapos version in the following patches.  We
will also use the same (commit from last-erb-mod commit + merge)
approach to track upstream changes.

/cc @kazuhiko, @jerome

7 years agogitlab: Setup sidekiq service
Kirill Smelkov [Fri, 8 Jan 2016 09:23:55 +0000 (12:23 +0300)]
gitlab: Setup sidekiq service

Sidekiq[1] is used in GitLab as background jobs manager - i.e. if a
request handler needs to spawn some non-light job - it adds it to
sidekiq queue (in Redis) and relies on sidekiq service to later pick
this job up and execute it.

The service is setup with just to run bin/gitlab-sidekiq with
appropriate queues (extracted from omnibus-gitlab) and appropriate
settings to controlling GitLab's sidekiq Out-Of-Memory killer[2].

NOTE Unlike unicorn OOM killer, Sidekiq memory killer just makes sidekiq
    processes to be SIGKILL terminated and relies on managing service to
    restart it. In slapos we don't have mechanism to set autorestart=true,
    nor bang/watchdog currently work with slapproxy, so we setup to do
    such monitoring ourselves manually with here-introduced
    watcher-sigkill program.

NOTE2 sidekiq promise, because it is rake/gitlab based, is slow to
    load/run and thus is put into etc/promise.slow/

[1] http://sidekiq.org/
[2] https://gitlab.com/gitlab-org/gitlab-ce/blob/1322bd78/doc/operations/sidekiq_memory_killer.md

/cc @kazuhiko, @jerome

7 years agogitlab: Upgrade gitlab-shell & gitlab-workhorse to versions which propagate $HOME
Kirill Smelkov [Thu, 7 Jan 2016 21:37:50 +0000 (00:37 +0300)]
gitlab: Upgrade gitlab-shell & gitlab-workhorse to versions which propagate $HOME

As was described in the previous patch, we need $HOME to be propagated
by this programs so that git can find partition's .gitconfig.

Specifically we need the following patches to be present in our build:

    https://gitlab.com/gitlab-org/gitlab-shell/commit/9e087f64
    https://gitlab.com/gitlab-org/gitlab-workhorse/commit/b5f1b803

They both have been applied upstream very close to revisions we
previously had in software.cfg, so we only need to update the revisions
to get them.

/cc @kazuhiko, @jerome

7 years agogitlab: Slapos'ify / tweak gitconfig and hook it into the system
Kirill Smelkov [Thu, 7 Jan 2016 21:19:54 +0000 (00:19 +0300)]
gitlab: Slapos'ify / tweak gitconfig and hook it into the system

Convert gitconfig template to jinja2 (reusing already-there
`email_display_name` and `email_from` parameters for commits generated by
gitlab).

System-level git config from gitlab-omnibus is also imported to this
file (on slapos we cannot tweak system-level git config -
software/.../parts/git/... is read-only for programs in instance
partitions - so we move all gitlab's system-wide git settings to this
"user-level" gitconfig.

System gitconfig in omnibus is defined here:

    https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8eda093/files/gitlab-cookbooks/gitlab/attributes/default.rb#L23

so it is

    pack.threads = 1    and
    receive.fsckObjects = true

which makes sense to not waste a lot of memory when packing and not to
allow corrupt objects to enter to system by evil users intentionally.

To make the file foundable by git - we put it into partition root
directory and set $HOME to point to partition root when running
appropriate programs / services.

NOTE we'll need to upgrade gitlab-shell and gitlab-workhorse to
    propagate $HOME for this setting to actually have effect.
    See the next patch.

/cc @kazuhiko, @jerome

7 years agogitlab: Import gitconfig from omnibus-gitlab
Kirill Smelkov [Thu, 7 Jan 2016 21:13:31 +0000 (00:13 +0300)]
gitlab: Import gitconfig from omnibus-gitlab

Like with Rails configuration files, this is pristine import of template
gitconfig from omnibus GitLab from

    https://gitlab.com/gitlab-org/omnibus-gitlab/tree/8eda093/files/gitlab-cookbooks/gitlab/templates/default

This is only a "user" part of git configuration. System-wide
configuration is generated dynamically:

    https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8eda093/files/gitlab-cookbooks/gitlab/attributes/default.rb#L23

and we'll import it by hand in the follow-up patches.

/cc @kazuhiko, @jerome

7 years agogitlab: Setup gitlab-workhorse service
Kirill Smelkov [Thu, 7 Jan 2016 20:49:39 +0000 (23:49 +0300)]
gitlab: Setup gitlab-workhorse service

Gitlab-workhorse[1] is a service which offloads Ruby-on-Rails based
GitLab from long-running and slow requests. It is written in Go.

Now as we have unicorn service set up, we can setup gitlab-workhorse
service (which uses unicorn as authentication backend).

Gitlab-workhorse setup is easy - it is just one program and several
command line options to point to unicorn socket and to configure on
which unix socket gitlab-workhorse will listen itself.

NOTE we have to care that git and ruby to be on PATH when running
    gitlab-workhorse - because on e.g. git push'ing workhorse will run `git
    receive-pack` and a hook will be called which calls gitlab-shell,
    which is written in ruby.

NOTE2 promise to check whether gitlab-workhorse is alive is to ping it
    via URL to non-existent endpoint and check for proper 403 HTTP code
    returned.

[1] https://gitlab.com/gitlab-org/gitlab-workhorse

/cc @kazuhiko, @jerome

7 years agogitlab: Compile assets on instantiation and make sure DB is properly setup/migrated...
Kirill Smelkov [Thu, 7 Jan 2016 20:04:23 +0000 (23:04 +0300)]
gitlab: Compile assets on instantiation and make sure DB is properly setup/migrated before unicorn runs

There are several actions that needs to be done on gitlab instance
upgrade:

    - we have to (re-)compile assets
    - we have to migrate DB

and also before the first run

    - we have to initialize DB

We can compile assets as part of instantiation process, but regarding
DB migration / setup - it is not currently possible to do that as part
of instantiation - for that operations we need PG & Redis to be already
running, but the first time slapos instantiates an SR it first prepares
all services, and only after instantiation is done, starts them all. There is
currently no way to hook into starting process, and run some scripts
after one service is started but before another service startup...

So the solution is: to perform such actions in delayed mode as part of
application - unicorn service - startup: it makes sure PG is running and
initializes it and does other actions which needs to be done to migrate
the DB. Only if/after they succeed the main application is started.

NOTE the comment about unicorn/gitlab startup slowness from the previous
    patch still holds true - so in order to get "all ok" after
    instantiation, it is required to perform the instantiation several
    times, because unicorn promise initially fails.

/cc @kazuhiko, @jerome

7 years agogitlab: Set up unicorn service
Kirill Smelkov [Thu, 7 Jan 2016 19:36:08 +0000 (22:36 +0300)]
gitlab: Set up unicorn service

Now that all gitlab Rails application configuration files are ready, we
can setup unicorn service to start it.

NOTE there is a promise to check unicorn by url which works, but there
    are also rake tasks to check gitlab itself, e.g. like

        gitlab:app:check
        gitlab:gitlab_shell:check
        gitlab:repo:check

    Unfortunately this tasks are slow to run (and gitlab:repo:check is
    very slow to run). That's why we do not put them into etc/promise/ -
    if we do - slapos reports promises time outs.

    What we do is we put them into etc/promise.slow/ so we have those
    scripts ready, but currently no one automatically checks them.

    Again, the promise to check unicorn just by accessing it by URL is
    there and is checked automatically out of the box.

NOTE2 GitLab is very slow to load. That's why it can take some time
    after unicorn starts that it's promise start to report ok. This can
    show itself as temporary instantiation errors which say promise such and
    such failed.

NOTE3 Unicorn start, but so far we did not cared to setup GitLab DB
    schema on instantiation. That's why unicorn remains not very usable
    and a lot of requests fail. We'll teach instance to setup DB and
    perform all other needed settings in the next patch.

/cc @kazuhiko, @jerome

7 years agogitlab: Add helper to set up promise to check something via url
Kirill Smelkov [Thu, 7 Jan 2016 18:54:00 +0000 (21:54 +0300)]
gitlab: Add helper to set up promise to check something via url

Like with [promise-wrapper] a recipe could do

    [promise-<service>]
    <= promise-byurl
    url     = ...

and a script to check such ur will be generated and automatically put
into etc/promise/<service>.

/cc @kazuhiko, @jerome

7 years agogitlab/unicorn: Automatically load all available CPUs by default
Kirill Smelkov [Thu, 7 Jan 2016 18:44:10 +0000 (21:44 +0300)]
gitlab/unicorn: Automatically load all available CPUs by default

Automatically configure unicorn to spawn as much worker processes as
there are CPUs on the system by default.

GitLab omnibus pre-hardcodes this value default to 2 (which we copied)
and then also tweaks it this way in active code

    https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8eda0933/files/gitlab-cookbooks/gitlab/attributes/default.rb#L230

which we also do here.

/cc @kazuhiko, @jerome

7 years agogitlab/gitlab-shell-config.yml: Explicitly point it to secret file
Kirill Smelkov [Thu, 7 Jan 2016 18:33:32 +0000 (21:33 +0300)]
gitlab/gitlab-shell-config.yml: Explicitly point it to secret file

Explicitly point gitlab-shell to location where we keep secrets.

We already pointeg gitlab to that place and now we do that for
gitlab-shell so those 2 peieces can connect to each other ok.

Regarding the setting itself - there is no such block in omnibus-gitlab,
but it is present in gitlab-shell configuration example:

    https://gitlab.com/gitlab-org/gitlab-shell/blob/82b3a4e8/config.yml.example#L35

/cc @kazuhiko, @jerome

7 years agogitlab/gitlab-shell-config.yml: Slapos'ify it
Kirill Smelkov [Thu, 7 Jan 2016 18:21:50 +0000 (21:21 +0300)]
gitlab/gitlab-shell-config.yml: Slapos'ify it

Convert gitlab-shell configuration file to slapos:

    - convert to jinja2,
    - connect gitlab-shell to unicorn & redis unix sockets

NOTE

    - http_settings are left to be default (empty) ones - as that works ok.
    - `auth_file` is still configured to point to wont-be-used sshkeys
      file, as without it gitlab-shell check will fail.
    - support for audit_usernames and git_annex is disabled and
      remains not configurable.

/cc @kazuhiko, @jerome

7 years agogitlab/unicorn.rb: Configure preload_app and pre-/post- forking actions
Kirill Smelkov [Thu, 7 Jan 2016 17:47:54 +0000 (20:47 +0300)]
gitlab/unicorn.rb: Configure preload_app and pre-/post- forking actions

Unicorn is a forking server with the idea that master process preloads
heavy Ruby-on-Rails application, and then to handle new request a worker
process is forked with application already loaded in its memory (and
modification being tracked by OS via copy-on-write).

From this point of view the only reasonable value for preload_app is
always "true" and omnibus-gitlab does this:

    https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8eda0933/files/gitlab-cookbooks/gitlab/definitions/unicorn_service.rb#L65

Then unicorn documentation shows what code has to be there in pre-/post-
forking event:

    http://bogomips.org/unicorn.git/tree/examples/unicorn.conf.rb?id=3312aca8#n57

GitLab uses only part of it that "allows a new master process to
incrementally phase out the old master process with SIGTTOU to avoid a
thundering herd":

    https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8eda0933/files/gitlab-cookbooks/gitlab/definitions/unicorn_service.rb#L69
    http://bogomips.org/unicorn.git/tree/examples/unicorn.conf.rb?id=3312aca8#n75

but strangely does not use code parts that are "highly recommended" or
"require" for "Rails + "preload_app true"" case.

For the reference I've added such codes, but kept them being commented
out.

/cc @kazuhiko, @jerome

7 years agogitlab/unicorn.rb: First round of slaposification
Kirill Smelkov [Thu, 7 Jan 2016 17:34:35 +0000 (20:34 +0300)]
gitlab/unicorn.rb: First round of slaposification

Convert unicorn parameters to slapos and configure it to listen on unix
socket only.

( Omnibus configures unicorn to listen on unix socket and
  loopback TCP, mainly because gitlab-shell could not connect to unicorn
  via unix socket until recently:

      https://gitlab.com/gitlab-org/gitlab-shell/commit/184385ac

  But as it can now, there is no point to keep on TCP port open )

To be able to do such configuration we add stub to unicorn service
section (to create needed directories where to keep the socket).

There will be follow-up patch which configures unicorn pre/post-forking
actions, which is not trivial and thus better be done on its own.

/cc @kazuhiko, @jerome

7 years agogitlab/gitlab.yml: Slapos'ify rest of it
Kirill Smelkov [Thu, 7 Jan 2016 16:54:42 +0000 (19:54 +0300)]
gitlab/gitlab.yml: Slapos'ify rest of it

Convert the rest of this configuration file to slapos.

It is straightforward conversion of parameters except:

    - access-via-ssh is disabled (gitlab slapos version does not support
      ssh access and supports HTTP(S) only by design on purpose)

    - we do not support restricting possible projects visibility via
      instance parameter (very low chance this will be needed in
      practice)

    - default issue-closing pattern is just ok for now and not
      configurable

    - support for builds, build artifacts & CI is disabled (we do not
      support CI (yet ?))

    - some internal defaults are just ok (e.g. where to organize
      directory for keeping repositories archives for downloads)

    - reply-by-email is not supported (yet ?)

    - we do not support LFS (yet ?) - just plain git hosting is ok for now.

    - Gravatar defaults are ok for now and not configurable.

    - Support for LDAP is disabled

    - Support for Kerberos is disabled

    - Support for OmniAuth is disabled

    - Satellites path is just /dev/null as we start from version where
      satellites are already non-existent.

    - Uploading backups to somewhere via GitLab's builtin mechanism is
      not supported - we'll use SlapOS native backup and resiliency for
      this.

    - Support for Google analytics is disabled.

    - Support for Piwik is disabled.

    - we are ok (for now) with default rack-attack git settings

/cc @kazuhiko, @jerome

7 years agogitlab: Determine current slapuserX in instance
Kirill Smelkov [Thu, 7 Jan 2016 16:41:10 +0000 (19:41 +0300)]
gitlab: Determine current slapuserX in instance

This user will need to be specified several times in configuration
files, as by default gitlab uses 'git' user and does "sudo" to it if it
is not current.

We will use {{ backend_info.user }} in the upcoming patches.

/cc @kazuhiko, @jerome

7 years agogitlab/gitlab.yml: Handle "external URL"
Kirill Smelkov [Thu, 7 Jan 2016 16:29:18 +0000 (19:29 +0300)]
gitlab/gitlab.yml: Handle "external URL"

GitLab has a notion of "external URL" - the canonical "frontend" URL the
server is reachable through: this URL is used as prefix to show
e.g. git-clone URL for repositories, etc, even if a server can be
reachable via several frontends.

Add external_url handling to slapos instance.

NOTE whether to use https or not is also defined by external_url, in
particular by external_url scheme.

/cc @kazuhiko, @jerome

7 years agogitlab/smtp_settings.rb: Convert/integrate to slapos
Kirill Smelkov [Thu, 7 Jan 2016 16:05:40 +0000 (19:05 +0300)]
gitlab/smtp_settings.rb: Convert/integrate to slapos

Convert to slapos SMTP settings for gitlab:

    - convert to jinja2
    - remove support for gitlab CI (we do not support it (yet ?))
    - add handling of `smtp_enable` parameter directly to that file
      ( omnibus handles this parameter externally and just removes
        smtp_settings.rb if it is true )

NOTE smtp_settings.rb contains SMTP password, so it is mode is set to 0600.

/cc @kazuhiko, @jerome

7 years agogitlab/rack_attack.rb: Convert/integrate to slapos
Kirill Smelkov [Thu, 7 Jan 2016 15:59:50 +0000 (18:59 +0300)]
gitlab/rack_attack.rb: Convert/integrate to slapos

Just another 2 simple parameters (attack detection tunables) conversion
to jinja2/slapos.

/cc @kazuhiko, @jerome

7 years agogitlab/config.ru: Convert/integrate to slapos
Kirill Smelkov [Thu, 7 Jan 2016 15:53:24 +0000 (18:53 +0300)]
gitlab/config.ru: Convert/integrate to slapos

Just convert 2 parameters used in that file to jinja syntax and add
those parameters (unicorn OOM killer tunables) to gitlab-parameters.cfg

/cc @kazuhiko, @jerome

7 years agogitlab/resque.yml: Tweak to integrate gitlab with internal redis
Kirill Smelkov [Thu, 7 Jan 2016 15:47:34 +0000 (18:47 +0300)]
gitlab/resque.yml: Tweak to integrate gitlab with internal redis

A simple change just to point resque to redis unix socket.

/cc @kazuhiko, @jerome

7 years agogitlab/database.yml: Tweak to integrate gitlab with internal postgresql
Kirill Smelkov [Thu, 7 Jan 2016 15:39:11 +0000 (18:39 +0300)]
gitlab/database.yml: Tweak to integrate gitlab with internal postgresql

We tweak database.yml to point to our postgresql unix socket; set
adapter to hardcoded postgresql, encoding to unicode and omit collation
(which according to omnibus-gitlab is used for mysql only).

The only instance parameter imported from omnibus is `db_pool` - how
many connection to a DB to keep open in a RoR thread/process.

XXX we use db's superuser as a user to connect. Is it ok to do even if
    the whole DB is used only for gitlab? (I think it is ok for the
    first iteration, but we'll probably need to refine this later)

/cc @kazuhiko, @jerome

7 years agogitlab: Introduce macro library
Kirill Smelkov [Thu, 7 Jan 2016 15:29:02 +0000 (18:29 +0300)]
gitlab: Introduce macro library

Introduce a library of Jinja2 macros that will be handy to use in
templates. For now we add only 2 macros:

    cfg(name)   - to get instance configuration parameter `name`,   and
    cfg_bool    - to get truth value of ----//----

The reason we introduce cfg() is that we will need to use a lot of
parameters in many places and it is much more handy to write, e.g.

    cfg('email_enabled')

compared to

    instance_parameter:configuration.email_enabled

/cc @kazuhiko, @jerome

7 years agogitlab: Organize place to keep parameters & their default imported from gitlab-omnibus
Kirill Smelkov [Thu, 7 Jan 2016 15:17:01 +0000 (18:17 +0300)]
gitlab: Organize place to keep parameters & their default imported from gitlab-omnibus

We will be using a several dozens of parameters to control gitlab
instance. It makes sense not to deviate in such parameters namings and
defaults from omnibus version.

Thus for such parameters - for clarity - we organize a separate file
where we will be keeping them - gitlab-parameters.cfg.

In this patch series all used parameters will be "imported" from
omnibus-gitlab 8.2.3+ce.0-0-g8eda093.

NOTE it is maybe better to try to autogenerate that file from upstream
    omnibus parameters definitions. If time will tell it becomes hard to
    maintain our copy - we'll consider going that way.

/cc @kazuhiko, @jerome

7 years agogitlab: Hook gitlab- and gitlab-shell- configuration files into the system
Kirill Smelkov [Thu, 7 Jan 2016 14:47:23 +0000 (17:47 +0300)]
gitlab: Hook gitlab- and gitlab-shell- configuration files into the system

- Download them on SR build and pass info to instance
- Instance prepares to process them as jinja2 templates
- Instance hooks the files into configuration location as appropriate

Every file so far is renamed *.erb -> *.in and a header added showing
that this file is autogenerated with links about what was the base
gitlab and/or omnibus version and omnibus reference revision this
template was last updated for.

So far all result configuration files are invalid - because ERB syntax
is there. We will convert the configuration files to proper jinja2
syntax and to using slapos parameters incrementally in the upcoming
patches.

NOTE (again): md5 sums are not yet fixed - we will fix them in the end
    of gitlab patches series after applying all tweaking changes.

/cc @kazuhiko, @jerome

7 years agogitlab: Import gitlab-ce & gitlab-shell configs from omnibus-gitlab
Kirill Smelkov [Thu, 7 Jan 2016 14:17:31 +0000 (17:17 +0300)]
gitlab: Import gitlab-ce & gitlab-shell configs from omnibus-gitlab

Pristine import of template configuration files from omnibus GitLab
package. All files were imported as-is in their ERB form and filenames
from omnibus-gitlab 8.2.3+ce.0-0-g8eda093 from here:

    https://gitlab.com/gitlab-org/omnibus-gitlab/tree/8eda093/files/gitlab-cookbooks/gitlab/templates/default

We will convert the templates to jinja2 and adjust them to slapos
version in the following patches.

Scheme for synchronizing with future upstream changes is envisioned as this:

    - checkout latest commit which updated pristine erb files
    - copy updated files from omnibus-gitlab, and commit the updates
    - checkout slapos master
    - merge commit that updated erb

That should reasonably work with not too-many conflicts and even those
should be not hard to resolve (with `git mergetool` e.g. in kdiff3)

/cc @kazuhiko, @jerome

7 years agogitlab: Organize per-instance gitlab work tree
Kirill Smelkov [Wed, 6 Jan 2016 20:07:20 +0000 (23:07 +0300)]
gitlab: Organize per-instance gitlab work tree

Organize per-instance place for gitlab configuration and work directory.

Unfortunately as GitLab is Ruby-on-Rails application, it is not possible
to keep its code in one place and have multiple separate configuration
sets in different places and start that code for a configuration set -
GitLab and Rails insist to get configuration from relative to source
code tree.

GitLab omnibus "solves" this by having only one configuration set and
having symlinks from code to that only configiration set. In slapos we
can potentially have several instances for one software and thus we
cannot do that.

With such limitations a proper solution would be to bind-mount software
code into instance filesystem namespace close to configuration - that
way the code will be only one and will find proper per-instance config.
Currently we do not have namespaces available on slapos unfortunately,
thus something else is needed.

The workaround I decided to do is this: to clone cloned gitlab
repository from software/ space to instance/ space and adjust it in
instance space. This has the following drawbacks:

    - code is duplicated
    - code becomes read-write, instead of being read-only

but imho it is the most practical thing to do. Another solution could be
to patch GitLab / Rails to remove "config lives in code" assumption, but
the number of places where this needs to be done is really many.

NOTE gems which gitlab uses and which were installed during software
    compilation are not duplicated - they are reused via bundler - via
    pointing BUNDLE_GEMFILE to original location in software.

NOTE2 For instance tasks and also for maintanace convenience we establish
    <instance>/bin/gitlab-* programs, e.g. gitlab-rake, which e.g. for
    gitlab-rake will run rake with correctly loaded gitlab environment -
    like in gitlab-omnibus.

/cc @kazuhiko, @jerome, @jp

7 years agogitlab: Redis service
Kirill Smelkov [Wed, 6 Jan 2016 19:23:51 +0000 (22:23 +0300)]
gitlab: Redis service

Organize internal Redis service, like with PostgreSQL in the previous
patch, with the help of slapos.cookbook:redis.server recipe.

Like with postgresql, and as we planned, redis listens only on
internal-to-partition unix socket.

The recipe establishes both service and promise to check it is alive;
we only need to setup log rotation manually.

/cc @kazuhiko, @jerome

7 years agogitlab: PostgreSQL service
Kirill Smelkov [Wed, 6 Jan 2016 19:00:31 +0000 (22:00 +0300)]
gitlab: PostgreSQL service

Organize internal PostgreSQL database which will be used as DB for
Roby-on-Rails GitLab and listens only on unix socket (for security and
performance reasons - see earlier intro patch).

To do it we use slapos.cookbook:postgres recipe, with disabling
"listen-to-network" via passing empty sets to ipv4 and ipv6 recipe
arguments.

The promise to check whether DB is alive is just `psql -c '\q'` which
will error if failing to connect to DB, but exit silently if connected ok.

Explicit log rotation is not needed - as postgresql logs to
stdout/stderr - not to a file - logs are handled by slapos - put into
.slappartX_postgresql.log and automatically rotated there.

XXX omnibus-gitlab tunes postgresql with shared_buffers and other
parameters, most likely for performance reasons - see e.g.

    https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8-2-stable/files/gitlab-cookbooks/gitlab/templates/default/postgresql.conf.erb#L113

I decided not to fine-tune postgresql for now, and get on-field feedback
first, and then, if needed, we can tune.

/cc @kazuhiko, @jerome

7 years agogolang: v↑ (1.5.3)
Kirill Smelkov [Thu, 14 Jan 2016 13:47:28 +0000 (16:47 +0300)]
golang: v↑  (1.5.3)

This is a security-bugfix release:

From https://golang.org/doc/devel/release.html#go1.5.minor:

    go1.5.3 (released 2016/01/13) includes a security fix to the math/big
    package affecting the crypto/tls package. See the Go 1.5.3 milestone on
    our issue tracker[1] and the release announcement[2] for details.

    [1] https://github.com/golang/go/issues?q=milestone%3AGo1.5.3
    [2] https://golang.org/s/go153announce

I've rebuild helloworld software release and briefly tested helloweb.go
with go 1.5.3 ok.

/reviewed-by: TrustMe
/cc @kazuhiko, !39

7 years agohelloweb/ruby: Abandon usage of slapos.cookbook:wrapper
Kirill Smelkov [Sun, 17 Jan 2016 16:42:31 +0000 (19:42 +0300)]
helloweb/ruby: Abandon usage of slapos.cookbook:wrapper

It turned out we cannot currently use slapos.cookbook in software part
of SR - the reason is slapos.cookbook egg depends on lxml egg, which in
turn needs libxml to be also installed via slapos.

For this reason stack/slapos.cfg has

    [slapos-cookbook]   # NOTE _not_ slapos.cookbook
    recipe = zc.recipe.egg
    eggs =
      ${lxml-python:egg}
    ...

and lxml-python is lxml building recipe to build it together with
libxml:

    [lxml-python]
    recipe = zc.recipe.egg:custom
    egg = lxml

    rpath =
      ${libxml2:location}/lib/
      ${libxslt:location}/lib/
      ${zlib:location}/lib/
    environment = lxml-python-env
    ...

So underlying idea, as I understand it, is: every SR contains
slapos-cookbook in parts and this way lxml-python gets build. Then when
there is slapos.cookbook egg usage, it is already correctly built.

BUT

This works when such slapos.cookbook egg usage happens _only_ in instance
part of an SR: otherwise, if buildout sees slapos.cookbook egg usage in
some recipe, e.g. like it currently is in helloweb-ruby:

    [helloweb-ruby]
    recipe  = slapos.cookbook:wrapper
    ...

it _first_ tries to install slapos.cookbook egg directly - as needed for
recipes eggs are installed as a first step, _before_ further buildout
processing. What happens then is that slapos.cookbook (note not "-") egg
sources and dependencies are downloaded from pypi, including lxml egg,
all are tried to build, and in lxml egg it fails this way:

    ...
    Processing lxml-3.5.0
    Writing /tmp/tmpLGK4xWbuild/lxml-3.5.0/setup.cfg
    Running setup.py -q bdist_egg --dist-dir /tmp/tmpLGK4xWbuild/lxml-3.5.0/egg-dist-tmp-DJvofa
    Building lxml version 3.5.0.
    Building without Cython.
    ERROR: /bin/sh: 1: xslt-config: not found

    ** make sure the development packages of libxml2 and libxslt are installed **

    Using build configuration of libxslt
    In file included from src/lxml/lxml.etree.c:323:0:
    src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory
     #include "libxml/xmlversion.h"
                                   ^
    compilation terminated.
    Compile failed: command 'gcc' failed with exit status 1
    /tmp/tmpLGK4xWbuild/lxml-3.5.0/temp/xmlXPathInitGlEAOF.c:1:26: fatal error: libxml/xpath.h: No such file or directory
     #include "libxml/xpath.h"
                              ^
    compilation terminated.
    *********************************************************************************
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
    *********************************************************************************
    error: Setup script exited with error: command 'gcc' failed with exit status 1
    An error occurred when trying to install lxml 3.5.0. Look above this message for any errors that were output by easy_install.
    Could't load zc.buildout entry point wrapper
    from slapos.cookbook:
    Couldn't install: lxml 3.5.0.
    While:
      Installing.
      Getting section helloweb-ruby.
      Initializing section helloweb-ruby.
      Installing recipe slapos.cookbook.
    Error: Couldn't install: lxml 3.5.0

Previously it probably used to work because we had system libxml
installed, and this way lxml compilation succeeded (but was incorrect
from slapos point of view).

( The problem turned out to be already known somehow - see e.g. c7d00913
  "Initial neoppod commit." and look for "Note on LXML/END LXML" there )

Solution could be: either fix slapos.cookbook installation via e.g.
teaching buildout to take into account pre-dependencies for eggs (for
lxml) or just to avoid using slapos.cookbook:wrapper for executable
generation.

While @kazuhiko is working on the first more-generic solution, here goes
a simpler one to just make helloweb component alive again: like it is
done in a lot of places (e.g. in software/kvm/) let's use
collective.recipe.template to generate a short shell script.

NOTE

previously the command line was

    ${bundler:bundle} exec sh -c 'helloweb.rb "$@"' ${:_buildout_section_name_}

but now it is the same with "$@" appended:

    exec ${bundler:bundle} exec sh -c 'helloweb.rb "$@"' ${:_buildout_section_name_} "$@"

The reason is slapos.cookbook:wrapper uses slapos.recipe.librecipe.execute.generic_exec()
in generated script, which appends sys.argv[1:] to the command-line implicitly:

    def generic_exec(args):
      ...
      os.execve(exec_list[0], exec_list + sys.argv[1:], exec_env)
                                        ^^^^^^^^^^^^^^

    https://lab.nexedi.com/nexedi/slapos/blob/54bbe0a9/slapos/recipe/librecipe/execute.py#L84

that's why last "$@" was not present in original version.

P.S.

Otherwise currently slapos.cookbook is used only in instance parts of
recipes in whole slapos.git

/reviewed-by TrustMe
/debugged-with @kazuhiko
/cc @vpelletier

7 years agonayuos: Modifications:
iv [Fri, 15 Jan 2016 12:48:27 +0000 (12:48 +0000)]
nayuos: Modifications:
  modify bashrc to setup git correctly,
  add some test for verifying image content after build finished,
  remove --noenable_rootfs_verification flag (get some security back!),
  clean a bit,
  update README.

7 years agonayuos: Removing old dead code.
iv [Tue, 29 Dec 2015 10:33:15 +0000 (10:33 +0000)]
nayuos: Removing old dead code.

7 years agopython-magic : do not fail to import the lib erp5
Aurélien Calonne [Thu, 14 Jan 2016 14:29:41 +0000 (15:29 +0100)]
python-magic : do not fail to import the lib

ctypes lib does not read the rpath of the current binary to look after the
desired library, so although it exits the import failed. Pass-by the first
find to make the import work

7 years agoapache-frontend: make trafficserver internal ports configurable.
Rafael Monnerat [Thu, 14 Jan 2016 18:25:43 +0000 (19:25 +0100)]
apache-frontend: make trafficserver internal ports configurable.

7 years agoversion up : libpng 1.6.20, 1.5.26 and 1.2.56, fixing CVE-2015-8126 and CVE-2015...
Kazuhiko Shiozaki [Thu, 14 Jan 2016 09:03:20 +0000 (10:03 +0100)]
version up : libpng 1.6.20, 1.5.26 and 1.2.56, fixing CVE-2015-8126 and CVE-2015-8540.

7 years agoversion up : git 2.7.0.
Kazuhiko Shiozaki [Wed, 13 Jan 2016 12:23:26 +0000 (13:23 +0100)]
version up : git 2.7.0.

7 years agoversion up eggs.
Kazuhiko Shiozaki [Thu, 7 Jan 2016 10:45:49 +0000 (11:45 +0100)]
version up eggs.

7 years agoversion up : groonga 5.1.1 and mroonga 5.11.
Kazuhiko Shiozaki [Tue, 29 Dec 2015 10:36:21 +0000 (11:36 +0100)]
version up : groonga 5.1.1 and mroonga 5.11.

7 years agoversion up: ca-certificates 20160104
Julien Muchembled [Tue, 5 Jan 2016 19:27:47 +0000 (20:27 +0100)]
version up: ca-certificates 20160104

7 years agoMake ca-certificates buildable with Python 2.6, and on Arch with only Python 2.7
Julien Muchembled [Tue, 5 Jan 2016 19:27:19 +0000 (20:27 +0100)]
Make ca-certificates buildable with Python 2.6, and on Arch with only Python 2.7

7 years agopbs: fixed condition of evaluation of rdiff backup status
Sebastien Robin [Mon, 11 Jan 2016 09:36:14 +0000 (10:36 +0100)]
pbs: fixed condition of evaluation of rdiff backup status

Initially, the condition checking rdiff backup status was right
after calling it. But then a condition about CORRUPTED_ARGS has
been inserted, making the result of $? different from initially expected.

Due to this, the cleanup of old versions was never done, making
the backup becoming too fat very quickly.

Thus clearly define variable for rdiff backup status to have expected
condition.

7 years agostack/erp5: fix excludes in resilient data to export for zodb
Nicolas Wavrant [Fri, 8 Jan 2016 10:13:20 +0000 (10:13 +0000)]
stack/erp5: fix excludes in resilient data to export for zodb

7 years agogitlab: Add helper for setting up promises
Kirill Smelkov [Wed, 6 Jan 2016 18:49:43 +0000 (21:49 +0300)]
gitlab: Add helper for setting up promises

A recipe could do

    [promise-<service>]
    <= promise-wrapper
    command-line = ...

and the wrapper will be put automatiaclly into etc/promise/<service>.

( for this to happen !py! magic is used again, like we did for logrotate
  and cron entries before )

/cc @kazuhiko, @jerome

7 years agogitlab: Make a plan to base instance layout on gitlab-omnibus and to interconnect...
Kirill Smelkov [Wed, 6 Jan 2016 18:34:27 +0000 (21:34 +0300)]
gitlab: Make a plan to base instance layout on gitlab-omnibus and to interconnect all internal services via unix sockets

Upcoming changes will follow two points:

- we try to base our gitlab setup on how it is done in
  gitlab-omnibus[1] with the idea to ease tracking upstream changes to
  instance setup.

- we will interconnect all internal services via unix sockets only.

  The reason to do it is twofold:

    1. easier security: currently files on different slapos partitions
       are isolated from each other, but there is no "in-between-partitions"
       networking isolation - thus (potentially evil) programs can
       access internal services on other slapos partition.

       permissions to access unix sockets, on the other hand, are
       managed by filesystem-level permissions, and thus unix sockets in
       one partition will be, by default, isolated from programs on
       another partitions.

    2. It is well known that UNIX sockets are faster than TCP over
       loopback. For example for our std shuttles they have 2 times lower
       latency and ~ 2-3 times more throughput compared to TCP over loopback

    More details on 1 & 2 can be found e.g. here:

    https://lab.nexedi.com/nexedi/slapos/merge_requests/27
    https://gitlab.com/gitlab-org/gitlab-shell/merge_requests/30

/cc @kazuhiko, @jerome

[1] https://gitlab.com/gitlab-org/omnibus-gitlab

7 years agogitlab: Add empty instance
Kirill Smelkov [Wed, 6 Jan 2016 17:58:22 +0000 (20:58 +0300)]
gitlab: Add empty instance

Add stub instance configuration which just establishes a way to have
several software types(*), pass all needed info from software to
instance, organizes base directory and establishes log rotation base for
upcoming services.

Log rotation is done with the help of cron periodicallly calling
logrotate. The rotation is done in "copytruncate" mode - i.e. log file
is not moved away and signal sent for service to reopen it, but instead
log content is just copied to outside and there is no need for a service
to reopen it's log file.

The reason it is done this way, is that there is a chance of not
handling such "reopen-log-file" callbacks correctly on a service side,
and so the net is full of crashing reports, e.g. like this:

    http://serverfault.com/questions/627521/why-is-logrotate-causing-apache-to-seg-fault-each-time

That's why we take a safer approach instead, even if "copytruncate" mode
is risking to loose several log entries(**) on rotation.

NOTE services will organize log rotation with just

    [logrotate-entry-<service>]
    <= logrotate-entry
    log     = path/to/log/files/*.log

For this to work some "!py!" magic (our way to serialize object into
executable python and process it in buildout recipes) is used to process
section names.

The approach trick is also used for cron, e.g. logrotate registers to
cron this way:

    [cron-entry-logrotate]
    <= cron-entry
    time    = daily
    command = ${logrotate:wrapper}

NOTE2 instance md5 are not fixed yet - we'll fix them after applying all
    patches in gitlab series.

(*) for now there is only 1 - "gitlab", but we'll need to have "-export"
    and "-import" for resiliency in the future.

(**) ideally such things should be done with logfs - a filesystem
    specializeing in logging - for client services it will look like as
    they just continue to write to log file, and on log service side, the
    rotation can happen, all transparent to client service.

/cc @kazuhiko, @jerome

7 years agoStart of GitLab Software Release
Kirill Smelkov [Wed, 6 Jan 2016 17:01:15 +0000 (20:01 +0300)]
Start of GitLab Software Release

First step - build all needed software. We build:

- Git
- PostgreSQL 9.2
- Redis 2.8
- Nginx

- gitlab-shell
- gitlab-workhorse
- gitlab-ce 8.2 itself

and everything which is needed to build the above programs.

Git is needed because GitLab is a git-hosting service and uses git
underneath. PostgreSQL is used as DB by gitlab and Redis as a cache.

GitLab-shell is a small project to manage ssh access to the service
(we'll disable ssh though) and to perform all "change a repository"
operations.

GitLab-workhorse is a service which offloads long-running or slow
request from main GitLab service.

GitLab-ce is the main Ruby-on-Rails-based web application.

Ruby- and Go- based programs are built in a way similar to:

    - 31a45a94    (helloworld & helloweb: Ruby version), and
    - 24e82414    (helloworld & helloweb: Go version)

Version of all components, except Git, were picked the same, as used by
gitlab omnibus v8.2 .

/cc @kazuhiko, @jerome

7 years agoversion up: ca-certificates 20151214
Julien Muchembled [Mon, 4 Jan 2016 17:54:56 +0000 (18:54 +0100)]
version up: ca-certificates 20151214

7 years agonayuos: Update README.
iv [Thu, 31 Dec 2015 10:10:21 +0000 (11:10 +0100)]
nayuos: Update README.

7 years agonayuos: Fix final images location + changing checksums + fix keep_cache option.
iv [Mon, 28 Dec 2015 15:47:14 +0000 (15:47 +0000)]
nayuos: Fix final images location + changing checksums + fix keep_cache option.

7 years agonayuos: More doc, add TODO, change checksum.
iv [Mon, 28 Dec 2015 15:10:36 +0000 (15:10 +0000)]
nayuos: More doc, add TODO, change checksum.

7 years agoversion up : MariaDB 10.1.10.
Kazuhiko Shiozaki [Thu, 24 Dec 2015 10:24:18 +0000 (11:24 +0100)]
version up : MariaDB 10.1.10.

7 years agomariadb: enable innodb lzma compression and disable some options explicitly.
Kazuhiko Shiozaki [Thu, 24 Dec 2015 10:06:54 +0000 (11:06 +0100)]
mariadb: enable innodb lzma compression and disable some options explicitly.

7 years agoharfbuzz: build without ICU.
Kazuhiko Shiozaki [Thu, 24 Dec 2015 09:40:16 +0000 (10:40 +0100)]
harfbuzz: build without ICU.

7 years agopython2.7: disable building some modules explicitly.
Kazuhiko Shiozaki [Wed, 23 Dec 2015 20:05:46 +0000 (21:05 +0100)]
python2.7: disable building some modules explicitly.

7 years agoNew component for OBS builds: chrpath
Julien Muchembled [Sat, 26 Dec 2015 21:07:22 +0000 (22:07 +0100)]
New component for OBS builds: chrpath

Some dists like SLE_12 don't seem to have it.

7 years agonayuos: Add logo, hash names in hashes.txt, keep_cache parameter (experimental),...
iv [Thu, 24 Dec 2015 17:08:35 +0000 (17:08 +0000)]
nayuos: Add logo, hash names in hashes.txt, keep_cache parameter (experimental), gzip instead of tar + gzip the final images.

7 years agore6stnet: update and cleanup
Julien Muchembled [Fri, 18 Dec 2015 18:22:14 +0000 (19:22 +0100)]
re6stnet: update and cleanup

../../stack/slapos.cfg is removed from component/*/buildout.cfg
because we normally don't specify it in component/
The OBS package will need to extend it.

7 years agoJupyter: Version up eggs and update erp5_kernel accordingly
Ayush Tiwari [Mon, 14 Dec 2015 17:57:41 +0000 (17:57 +0000)]
Jupyter: Version up eggs and update erp5_kernel accordingly

Pin versions required for ipython==4.0.0 with ipykernel separated
from ipython eggs.
The split was in accordance to : https://blog.jupyter.org/2015/04/15/the-big-split/

/reviewed-by @kirr  (on nexedi/slapos!33)

7 years agoversion up : Python 2.7.11.
Kazuhiko Shiozaki [Fri, 18 Dec 2015 11:05:06 +0000 (12:05 +0100)]
version up : Python 2.7.11.

7 years agoversion up eggs.
Kazuhiko Shiozaki [Thu, 17 Dec 2015 08:50:24 +0000 (09:50 +0100)]
version up eggs.

7 years agohaproxy: explicitly enable USE_DL, that is required at least in Ubuntu 15.10.
Kazuhiko Shiozaki [Thu, 17 Dec 2015 10:42:37 +0000 (11:42 +0100)]
haproxy: explicitly enable USE_DL, that is required at least in Ubuntu 15.10.