Distribution Team Infrastructure and Maintenance - dev.gitlab.org

Guidelines for maintaining dev.gitlab.org, including manual package upgrades/downgrades, and GitLab configuration changes.

dev.gitlab.org

This is an internal GitLab instance running GitLab CE. The omnibus-gitlab package on this server is a stock package with required configuration to keep it operational. Regular omnibus-gitlab commands can be used on this node.

Automated tasks

  1. Nightly builds: Every day at 1:30 UTC, a nightly build gets triggered on dev.gitlab.org. The cron trigger times are currently defined at the scheduled pipeline page on dev.gitlab.org.

  2. Deployments: Every day at 7:20 UTC, the nightly CE packages gets automatically deployed on dev.gitlab.org. Any errors in the install process will be logged in Sentry. Slack notifications will appear in #dev-gitlab. The cron task is currently defined in role file.

Maintenance tasks

It is Distribution team’s responsibility to make sure that the GitLab instance on this server is operational.

Requirements:

  • Access to the node

  • Depending on whether the task requires permanent changes to /etc/gitlab/gitlab.rb, access to the Chef repo. If you do not have access to this repository, make sure you create an issue in Infrastructure issue tracker and label it access request.

Manually upgrading/downgrading packages

In case of an issue with the latest deploy, we might need to revert the installation to a previous nightly version and lock the deployment until the fixes are ready. This is done to ensure stability of dev.gitlab.org for others using the instance.

  1. To start, create an issue in a team-tasks [issue-tracker] detailing that you will be downgrading installed version, and adding links to related issues. Assign the issue to yourself.

  2. Next, make an announcement in #announcements slack channel before downgrading the package:

    I will be manually downgrading package on dev.gitlab.org to <version> as latest nightly is not working as expected. <link to issue>
    
  3. Stop sidekiq and unicorn to be sure that data doesn’t get altered during the upgrade.

    1
    2
    
    sudo gitlab-ctl stop sidekiq
    sudo gitlab-ctl stop unicorn
    
  4. Find the previous working version of the package and downgrade to this version:

    1
    
    sudo apt-get install gitlab-ce=<version to be installed>
    

    For example, if the version is 10.4.0+rnightly.75436.44501791-0, you would run:

    1
    
    sudo apt-get install gitlab-ce=10.4.0+rnightly.75436.44501791-0
    

    This will automatically run reconfigure and apply the necessary changes.

  5. Once the reconfigure is done, confirm all the services are up and running.

    1
    
    sudo gitlab-ctl status
    
  6. Confirm the correct version is deployed by visiting https://dev.gitlab.org/help.

  7. Create a package hold to prevent auto-upgrade:

    1
    
    sudo apt-mark hold gitlab-ce
    

    and verify the hold is in place.

    1
    
    sudo apt-mark showhold
    
  8. Back in the #announcements channel, leave a message that the downgrade is completed:

    Downgrade completed. The package has also been put on hold to prevent automatic upgrades. <link to issue>
    

Once the issue has been resolved, unhold the package and upgrade to the latest version.

  1. Start by announcing this in #announcements channel

    I will be removing the package hold and manually upgrading package on dev.gitlab.org to the latest nightly. <link to issue>
    
  2. Next, unhold the package:

    1
    
    sudo apt-mark unhold gitlab-ce
    
  3. Continue with upgrading:

    1
    2
    
    sudo apt-get update
    sudo apt-get install gitlab-ce
    
  4. Once the upgrade is completed, verify that the latest version is installed by visiting https://dev.gitlab.org/help.

  5. Finally, leave a note at the #announcements channel

    Upgrade completed. dev.gitlab.org now runs <version>.
    

Changing GitLab configuration

If, for some reason, you need to apply a change to /etc/gitlab/gitlab.rb, this change needs to be introduced in the dev-gitlab-org role.

If you do not have access to this repository, but you need to do a hot-patch or configuration testing, the following steps can be performed:

  1. Stop chef-client on this node:

    sudo service chef-client stop
    
  2. Make the necessary change to get the instance running again. If that requires change in gitlab.rb file, change it manually and run reconfigure.

  3. Reach out to Production team to get help on getting your gitlab.rb configuration change committed to the Chef server.

  4. After this has been applied, start the chef-client on the node: sudo service chef-client start

  5. Make sure that any change you did is noted in an issue! It is your responsibility to revert the change on this node once the fix is in place in the package!

Last modified December 6, 2023: Move infrastructure files in to place (05571984)