1. 24 Feb, 2017 1 commit
  2. 31 Jan, 2017 1 commit
  3. 26 Jan, 2017 1 commit
  4. 12 Jan, 2017 1 commit
    • gitlab: watcher should take care of sidekiq killed by SIGTERM · d14dc814
      The watcher should also watch for signals like SIGTERM killing sidekiq, which
      are trapped by sidekiq, with sidekiq exiting successfully (with exit code 0).
      
      To achieve this we rework our watcher-sigkill to be a generic watcher -
      that can be given a set of restart exit codes including signal names and
      monitors whether child process terminated with matching for restart exit
      code.
      
      Example usage:
      
      	watcher 0,SIGKILL prog ...
      
      Based on patch by @iv.
      Discussion: https://lab.nexedi.com/lab.nexedi.com/lab.nexedi.com/issues/25#note_22085
      Kirill Smelkov committed
  5. 05 Jan, 2017 1 commit
  6. 30 Dec, 2016 1 commit
  7. 29 Dec, 2016 2 commits
    • gitlab: start automation of gitlab-backup · ae7b4120
        - git-clone and build git-backup sources
        - add a cron job doing `gitlab-backup-pull` every 4 hours by default
        - add instance parameter to change backup frequency
        - add xnice for using less resources while backuping
        - add lock to avoid concurrent calls of backup script
        - add a specific software type `gitlab-export` doing all this instead of in
          `default`; this can be changed in Services > parameters (kirr's changes)
      
      `coreutils`, `grep` and `tar` components are used by `gitlab-backup-pull`
      script, as it is called from a cron and the PATH has to include these
      binaries paths
      iv committed
    • gitlab: use slapos-cookbook-develop + pin slapos cookbook version · 25acc473
      This is needed until the patch regarding `pidfile` in wrapper.py
      (571d6514) is added to released SlapOS cookbook egg.
      iv committed
  8. 20 Oct, 2016 5 commits
  9. 07 Aug, 2016 4 commits
  10. 02 Aug, 2016 7 commits
  11. 19 Jul, 2016 1 commit
    • gitlab: enable parameters-extra options when creating wrapper · 6082d6e9
      @jerome says at 5f5d5102 (comment 17119):
      
      before f4e51f77, we had:
      `~/srv/runner/instance/slappart0/bin/gitlab-rake` containing:
          ```python
          ...
          if __name__ == '__main__':
              sys.exit(slapos.recipe.librecipe.execute.generic_exec((['/srv/slapgrid/slappart16/srv/runner/software/fffb3c99781923d3adb8bc53eb6c027a/bin/bundle', 'exec', 'sh', '-c', 'cd /srv/slapgrid/slappart16/srv/runner/instance/slappart0/gitlab-work && rake "$@"', 'rake'], None, {'BUNDLE_GEMFILE': '/srv/slapgrid/slappart16/srv/runner/software/fffb3c99781923d3adb8bc53eb6c027a/parts/gitlab/Gemfile', 'HOME': '/srv/slapgrid/slappart16/srv/runner/instance/slappart0', 'SIDEKIQ_MEMORY_KILLER_MAX_RSS': '1000000', 'RAILS_ENV': 'production'})))
          ```
      
      after, `~/srv/runner/instance/slappart0/bin/gitlab-rake` contains:
          ```shell
          #!/bin/bash
          COMMAND=/srv/slapgrid/slappart16/srv/runner/instance/slappart0/bin/gitlab-rake.py
      
          # If the wrapped command uses a shebang, execute the referenced
          # executable passing the script path as first argument.
          # This is to workaround the limitation of 127 characters in #!
          if [[ -f $COMMAND && x$(head -c2 "$COMMAND") = x"#!" ]]; then
            SHEBANG=$(head -1 "$COMMAND")
            INTERPRETER=( ${SHEBANG#\#!} )
            COMMAND="${INTERPRETER[@]} $COMMAND"
          fi
      
          exec $COMMAND
          ```
      
      which is a wrapper around `gitlab-rake.py` containing:
          ```python
          ...
          if __name__ == '__main__':
              sys.exit(slapos.recipe.librecipe.execute.generic_exec((['/srv/slapgrid/slappart16/srv/runner/software/fffb3c99781923d3adb8bc53eb6c027a/bin/bundle', 'exec', 'sh', '-c', 'cd /srv/slapgrid/slappart16/srv/runner/instance/slappart0/gitlab-work && rake "$@"', 'rake'], None, {'BUNDLE_GEMFILE': '/srv/slapgrid/slappart16/srv/runner/software/fffb3c99781923d3adb8bc53eb6c027a/parts/gitlab/Gemfile', 'HOME': '/srv/slapgrid/slappart16/srv/runner/instance/slappart0', 'SIDEKIQ_MEMORY_KILLER_MAX_RSS': '1000000', 'RAILS_ENV': 'production'})))
          ```
      
      `gitlab-rake.py` after is same as `gitlab-rake` before.
      
      This [slapos.cookbook:wrapper](https://lab.nexedi.com/nexedi/slapos/blob/cd9faac0/slapos/recipe/wrapper.py#L39) has an argument *parameters-extra* which if set to true, propagate command line arguments to the wrapped script. The default value for this parameter is false.
      
      Before f4e51f77, the generated wrapper was also propagating arguments even when *parameters-extra* was not set, but since this commit, this *parameters-extra* option is now handled as expected.
      
      This is the reason for this regression. In our case, when we see `/srv/slapgrid/slappart16/srv/runner/instance/slappart0/bin/gitlab-rake assets:clean`, it just calls `rake` without arguments.
      
      So a simple patch that fix the problem would be jerome/slapos@d3d05f02 . This way, the generated wrapper becomes:
      
      ```shell
      ...
      exec $COMMAND $@
      ```
      
      and arguments are correctly propagated.
      
      Feel free to cherry-pick that patch for now, but it may be nice to rethink this *parameters-extra* option, after this debugging session, I believe it should be true by default.
      
      /cc @seb for introducing the parameter in 80bb4305 and @vpelletier for touching this code in e7083872
      
      /reviewed-by @kirr
      Jérome Perrin committed
  12. 22 Apr, 2016 2 commits
  13. 14 Mar, 2016 1 commit
  14. 06 Mar, 2016 1 commit
  15. 03 Mar, 2016 1 commit
  16. 02 Mar, 2016 1 commit
  17. 29 Feb, 2016 1 commit
  18. 28 Feb, 2016 5 commits
  19. 17 Feb, 2016 2 commits
  20. 16 Feb, 2016 1 commit