<commit_before># SDC (Incremental) Upgrade Scripts

These scripts can be used to drive incremental upgrades of SDC 7 (as opposed
to usb-headnode.git/bin/upgrade.sh which is about the major SDC 6.5 -> 7 upgrade).
See HEAD-1795 for intended improvements to this process.

## To run an upgrade

    # Get the latest 'incr-upgrade' package
    wget https://bits.joyent.us/builds/incr-upgrade/master-latest/incr-upgrade/incr-upgrade-VERSION.tgz --no-check-certificate --user=guest --password=XXX
    tar xf incr-upgrade-VERSION.tgz
    cd incr-upgrade-VERSION

    # become root
    p su -

    ./version-list.sh > rollback-images

    # Either get a list of the latest versions of all roles via
    #       ./get-latest.sh > upgrade-images
    # or manually create such a list with relevant roles and specific
    # image UUIDs in the format:
    #       export ${ROLE}_IMAGE=$UUID
    #       ...
    # e.g.:<commit_msg>incr-upgrade: tweak readme for new place from which to get the latest incr-upgrade package<commit_after># SDC (Incremental) Upgrade Scripts

These scripts can be used to drive incremental upgrades of SDC 7 (as opposed
to usb-headnode.git/bin/upgrade.sh which is about the major SDC 6.5 -> 7 upgrade).
See HEAD-1795 for intended improvements to this process.

## To run an upgrade

    # Get the latest 'incr-upgrade' package
    # 1. Where you have the node-manta client tools:
    latest=$(mls /Joyent_Dev/stor/builds/incr-upgrade | grep 'master-2' | sort | tail -1)
    pkg=$(mls /Joyent_Dev/stor/builds/incr-upgrade/$latest/incr-upgrade | grep tgz)
    mget -O /Joyent_Dev/stor/builds/incr-upgrade/$latest/incr-upgrade/$pkg
    scp $pkg us-beta-4:/var/tmp
    # 2. Then crack it in the your working dir on the GZ:
    ssh us-beta-4
    cd /var/tmp
    tar xf incr-upgrade-VERSION.tgz
    cd incr-upgrade-VERSION

    # become root
    p su -

    # Capture current image versions in case we need to rollback.
    ./version-list.sh > rollback-images

    # Either get a list of the latest versions of all roles via
    #       ./get-latest.sh > upgrade-images
    # or manually create such a list with relevant roles and specific
    # image UUIDs in the format:
    #       export ${ROLE}_IMAGE=$UUID
    #       ...
    # e.g.:
{'fraction_non_alphanumeric': 0.09608540925266904, 'fraction_numerical': 0.009786476868327402, 'mean_word_length': 2.7173553719008265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5753932', 'n_tokens_mistral': 758, 'n_tokens_neox': 700, 'n_words': 250}