Search Results for ""

Updating a Server Installation

Update Steps

  1. Take a snapshot of your installation so you can rollback later if necessary (optional but recommended) - steps below

  2. Check you are running Docker v17.12.1 and update if necessary

  3. Update Replicated to install the new version of CircleCI Server - steps below

Snapshot for Rollback

To take a snapshot of your installation:

  1. Go to the Management Console (e.g. your-circleci-hostname.com:8800) and click Stop Now to stop the CircleCI Services machine from running

  2. Ensure no jobs are running on the nomad clients – check by running nomad status

  3. Navigate to the AWS EC2 management console and select your Services machine instance

  4. Select Actions > Image > Create Image – Select the No Reboot option if you want to avoid downtime at this point. This image creation step creates an AMI that can be readily launched as a new EC2 instance to restore your installation.

It is also possible to automate this process with the AWS API. Subsequent AMIs/snapshots are only as large as the difference (changed blocks) since the last snapshot, such that storage costs are not necessarily larger for more frequent snapshots, see Amazon’s EBS snapshot billing document for details. Once you have the snapshot you are free to make changes on the Services machine.

If you do need to rollback at any point, see our guide to restoring from a backup.

Updating Replicated

Prerequisites

  • Your installation is Ubuntu 14.04 or 16.04 based.

  • You are running replicated version 2.10.3⇐ on your services machine. Check by running the following:

    replicated --version
  • Your installation is not airgapped and you can access the internet from it

  • All steps are completed on the Services machine

Preparations

Remember to take a snapshot (described above) before starting the Replicated update process
  1. Stop the CircleCI application:

    replicatedctl app stop

    Application shutdown takes a few minutes. Please check the administration dashboard and wait for the status to become “Stopped” before continuing. You can also run the following command to view the app status:

    replicatedctl app status inspect

    Example Output:

    [
        {
            "AppID": "edd9471be0bc4ea04dfca94718ddf621",
            "Sequence": 2439,
            "State": "stopped",
            "DesiredState": "stopped",
            "Error": "",
            "IsCancellable": false,
            "IsTransitioning": false,
            "LastModifiedAt": "2018-10-23T22:00:21.314987894Z"
        }
    ]
  2. For the replicated update to succeed, it is necessary to update docker to the recommended version, 17.12.1:

    sudo apt-get install docker-ce=17.12.1~ce-0~ubuntu
  3. Pin the Docker version using the following command:

    sudo apt-mark hold docker-ce

Perform Update

  1. Perform the Replicated update by executing the update script as follows:

    curl -sSL "https://get.replicated.com/docker?replicated_tag=2.34.1" | sudo bash

    Double-check your replicated and docker versions:

    replicatedctl version    # 2.34.1
    docker -v                # 17.12.1
  2. Restart the app with

    replicatedctl app start

    The application will take a few minutes to spin up. You can check the progress in the administration dashboard or by executing;

    replicatedctl app status inspect

    Example output:

    [
        {
            "AppID": "edd9471be0bc4ea04dfca94718ddf621",
            "Sequence": 2439,
            "State": "started",
            "DesiredState": "started",
            "Error": "",
            "IsCancellable": true,
            "IsTransitioning": true,
            "LastModifiedAt": "2018-10-23T22:04:05.00374451Z"
        }
    ]

    You will now be running the latest version of CircleCI Server.