Skip to content

Updating a Docker installation

This section outlines the steps to update your SmartScope installation with Podman/Docker

Warning

The database is no backwards compatible between versions. Please back up the database before updating to have a fallback.

  1. Backup database

    ./smartscope.sh run backup_db

  2. Stop smartscope

    ./smartscope.sh stop

  3. Download the new smartscope.sh.

    wget https://raw.githubusercontent.com/smartscope-org/SmartScope/stable/Docker/SmartScope/smartscope.sh

  4. mv smartscope.sh.1 smartscope.sh

  5. chmod +x smartscope.sh

  6. Create the new scratch dir

    mkdir scratch Note. This doesn't have to be created if the scratch dir is to be customized. This will create its default location

  7. Download the new docker-compose.yml

    ./smartscope.sh update stable Note. No need to back up the db since it's already done. Also no need to restart the application yet.

  8. Edit your smartscope.yml to add the following two services to the file:

    smartscope_ai:
        user: ${UID}:${GID} 
    smartscope_worker:
        extends:
            service: smartscope
    
  9. Restart smartscope

    ./smartscope.sh start

There are 2 new containers started to handle the workflow:

  • smartscope_ai: All the AI algorithms were moved there. There is a GPU version also but CPU works quite well for now.
  • smartscope_worker: Copy of the smartscope container which runs a process which handles long commands asynchronously such as regrouping the holes on all square or square image processing.

Note

Since the github repository changed from the NIEHS organization to smartscope.org, the smartscope.sh script needs to be updated.

  1. Re-download the new version of the smartscope.sh script

    wget https://raw.githubusercontent.com/smartscope-org/SmartScope/latest/Docker/SmartScope/smartscope.sh
    chmod +x smartscope.sh
    
  2. Run the update command as normal.

    #Choose with version you want to update to: latest or stable
    #Replace VERSION with your choice
    
    ./smartscope.sh update latest
    
  3. Restart SmartScope

    ./smartscope.sh restart    
    

Note

If you initially installed a version older than 0.9.2, first download the new smartscope.sh script as described here

  1. Run the smartscope update command.

    #Choose with version you want to update to: latest or stable
    #Replace VERSION with your choice
    
    ./smartscope.sh update VERSION
    
  2. Restart SmartScope

    ./smartscope.sh restart    
    
  1. (Optional) Back up your database

    Warning

    This step is to protect your data in case the update fails.

    ## REPLACE YYYYMMDD by the current date ##
    sudo podman exec smartscope-db /bin/bash -c 'mysqldump --user=$MYSQL_USER --password=$MYSQL_ROOT_PASSWORD $MYSQL_DATABASE > /var/lib/mysql/YYYYMMDD_dump.sql'
    
  2. Stop SmartScope

    cd /to/Smartscope/directory/
    ./smartscope.sh stop
    
  3. Change version in smartscope.yml

    To update your docker installation open the smartscope.yml file

    vim smartscope.yml
    
    Edit the image line to a new version available in GitHub container repository
    version: "3"
    services:
    smartscope:
    image: ghcr.io/niehs/smartscope:CHANGE_VERSION_NUMBER
    user: ${UID}:${GID}
    volumes: 
        ...
    

  4. Restart smartscope

    ./smartscope.sh start
    

    The login screen should show the new version number