UiPath Documentation
automation-suite
2023.10
false
Guia de instalação do Automation Suite no Linux
Importante :
A localização de um conteúdo recém-publicado pode levar de 1 a 2 semanas para ficar disponível.

Como excluir imagens do instalador antigo após a atualização

Exclua as imagens antigas do instalador após uma atualização para resolver problemas de armazenamento e vulnerabilidade no Automation Suite.

Se você tiver problemas com vulnerabilidades de imagem ou consumo de armazenamento após realizar uma atualização, poderá excluir as imagens do instalador antigo.

A partir do Automation Suite 2023.10.5, você pode limpar as imagens da versão anterior após a atualização do registro do Docker no cluster, usando os seguintes comandos:

  • Para excluir as imagens que não são mais necessárias após a atualização:
    cd /opt/UiPathAutomationSuite/<new_version>/installer
    ./bin/uipathctl registry cleanup --manifest versions/docker-images.json
    cd /opt/UiPathAutomationSuite/<new_version>/installer
    ./bin/uipathctl registry cleanup --manifest versions/docker-images.json
    
  • Para excluir as imagens de pacotes sob demanda, é necessário remover especificamente essas imagens:
    ./bin/uipathctl registry cleanup --manifest /versions/docker-images.json --images-list images-list.json
    ./bin/uipathctl registry cleanup --manifest /versions/docker-images.json --images-list images-list.json
    

O seguinte exemplo mostra o formato do arquivo images-list.json :

{
    "cleanup-list": [
        "aicenter/python39:23.10.0-rc4",
        "image2",
        "image3"
    ]
}
{
    "cleanup-list": [
        "aicenter/python39:23.10.0-rc4",
        "image2",
        "image3"
    ]
}

Para versões anteriores do Automation Suite, para realizar essa operação opcional pós-atualização, siga as seguintes etapas:

  1. Atualize IMG, TAG, USER, PASS, registry e latest_image_json de acordo com a configuração do cluster no seguinte script e execute-o:
    #!/bin/bash
    
    ### Please change below variables as required
    IMG=<E.g. dataservice/dataservice-designer>
    TAG=<E.g. v20231116-tag>
    USER=<E.g. "admin">
    PASS=<E.g. "password">
    registry=<E.g. "registry.mycluster.com">
    latest_image_json=<E.g. "/opt/UiPathAutomationSuite/UiPath_Installer/versions/docker-images.json">
    ####
    
    [[ -f "${latest_image_json}" ]] || {
        echo "File "$latest_image_json" doesn't exist"
        exit 1
    }
    
    cat "${latest_image_json}" | tr -d '",' | grep -w "${IMG}:${TAG}" >> /dev/null && {
        echo "Image ${IMG}:${TAG} is being used in cluster. Will skip the deletion."
        exit 0
    }
    
    echo "Deleting image ${IMG}:${TAG}"
    
    cred="-u ${USER}:${PASS}"
    
    for i in `curl -k -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' $cred "https://$registry/v2/$IMG/manifests/$TAG" | jq -r '.layers | .[] | .digest'`; do
        curl -k  -H "Accept: application/vnd.docker.distribution.manifest.v2+json"  $cred -X DELETE "https://$registry/v2/$IMG/manifests/$i"
    done
    
    for i in `curl -k -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' $cred "https://$registry/v2/$IMG/manifests/$TAG" | jq -r '.config.digest'`; do
        curl -k  -H "Accept: application/vnd.docker.distribution.manifest.v2+json"  $cred -X DELETE "https://$registry/v2/$IMG/manifests/$i"
    done
    #!/bin/bash
    
    ### Please change below variables as required
    IMG=<E.g. dataservice/dataservice-designer>
    TAG=<E.g. v20231116-tag>
    USER=<E.g. "admin">
    PASS=<E.g. "password">
    registry=<E.g. "registry.mycluster.com">
    latest_image_json=<E.g. "/opt/UiPathAutomationSuite/UiPath_Installer/versions/docker-images.json">
    ####
    
    [[ -f "${latest_image_json}" ]] || {
        echo "File "$latest_image_json" doesn't exist"
        exit 1
    }
    
    cat "${latest_image_json}" | tr -d '",' | grep -w "${IMG}:${TAG}" >> /dev/null && {
        echo "Image ${IMG}:${TAG} is being used in cluster. Will skip the deletion."
        exit 0
    }
    
    echo "Deleting image ${IMG}:${TAG}"
    
    cred="-u ${USER}:${PASS}"
    
    for i in `curl -k -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' $cred "https://$registry/v2/$IMG/manifests/$TAG" | jq -r '.layers | .[] | .digest'`; do
        curl -k  -H "Accept: application/vnd.docker.distribution.manifest.v2+json"  $cred -X DELETE "https://$registry/v2/$IMG/manifests/$i"
    done
    
    for i in `curl -k -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' $cred "https://$registry/v2/$IMG/manifests/$TAG" | jq -r '.config.digest'`; do
        curl -k  -H "Accept: application/vnd.docker.distribution.manifest.v2+json"  $cred -X DELETE "https://$registry/v2/$IMG/manifests/$i"
    done
    
  2. Reinicie o pod de registro para a execução da coleta de lixo ou execute no pod de registro e execute a coleta de lixo usando o seguinte comando:
    registry garbage-collect /etc/docker/registry/config.yml
    registry garbage-collect /etc/docker/registry/config.yml
    

Esta página foi útil?

Conectar

Precisa de ajuda? Suporte(opens in new window)

Quer aprender? Academia UiPath(opens in new window)

Tem perguntas? Fórum do UiPath(opens in new window)

Fique por dentro das novidades