automation-suite
2023.4
false
- 概述
- 要求
- 安装
- 安装后
- 集群管理
- 监控和警示
- 迁移和升级
- 特定于产品的配置
- 最佳实践和维护
- 故障排除
如何在升级后从旧安装程序中删除映像
重要 :
请注意此内容已使用机器翻译进行了部分本地化。
Linux 版 Automation Suite 安装指南
Last updated 2024年11月4日
如何在升级后从旧安装程序中删除映像
如果在执行升级后遇到映像漏洞或存储消耗问题,可以从旧的安装程序中删除映像。
从 Automation Suite 2023.4.8 开始,您可以在升级后使用以下命令从集群内 Docker 注册表清理以前的版本映像:
-
要删除升级后不再需要的映像,请执行以下操作:
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 -
要删除按需捆绑包映像,您需要专门删除以下映像:
以下示例显示了./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.jsonimages-list.json
文件的格式:{ "cleanup-list": [ "aicenter/python39:23.10.0-rc4", "image2", "image3" ] }
{ "cleanup-list": [ "aicenter/python39:23.10.0-rc4", "image2", "image3" ] }
对于以前的 Automation Suite 版本,要执行此可选的升级后操作,请执行以下步骤:
-
根据以下脚本中的集群配置更新
IMG
、TAG
、USER
、PASS
、registry
和latest_image_json
,然后运行该脚本:#!/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 -
重新启动注册表 Pod 以执行垃圾收集,或在注册表 Pod 中执行并使用以下命令运行垃圾收集:
registry garbage-collect /etc/docker/registry/config.yml
registry garbage-collect /etc/docker/registry/config.yml