Files
cloudpods/scripts/sync_dify_images.sh
cwz_eikoh 897a6fc61f [OSPP]feature: Auto deploy llm and dify (#23282)
* feat(llm): add llm-create

* fix(llm): fix llm-create, add llm-list & llm-show

* fix(llm): format file names

* fear(llm): add exec stream

* fear(llm): init llm model cache

* fix(llm): move llm model cache to LocalImageCache

* feat(llm): auto clean model cache

* fix(llm): auto clean tmp model cache

* feat(dify): init dify-create

* fix(dify): change dify default registry

* feat: support create model with gguf file

* feat(llm): support more modelfile option for gguf file

* feat(dify): init user customize dify parameters

* feat: update llm as a service in climc

* fix: delete llm from region service

* feat: init llm service (with error)

* fix: resolve errors (task cant callback yet)

* feat: add PerformRequestHostActionByOtherService for container

* fix: make llm service usable

* feat: delete llm and dify after guest deleted

* feat(llm): add llm-image

* feat(llm): add llm-model

* feat: mv old llm to ollama

* feat(llm): init llm-batch-create(can not run)

* fix(llm): make llm-create usable

* fix(llm): add pull-model step

* feat(llm): add list and delete

* fix(llm): ollama pull official model don't rely on host & region's code any more

* feat(llm): add dify-model

* fix: remove llm's code in host & compute

* fix: remove remain code in compute

* feat(llm): Abstract out and reuse the llm_model logic

* feat(llm): abstract llm_base from llm

* fix(llm): make dify usable

* feat(llm): add sync_dify_images.sh

* fix(llm): format import

* feat(llm): support start & stop for llm and dify

* feat(llm): add model-update

* fix(llm): gendocgo
2025-10-24 13:29:31 +08:00

60 lines
1.3 KiB
Bash

#!/bin/bash
# 用法:
# ./sync-images.sh <targetRegistry>
# 示例:
# ./sync-images.sh crpi-nf3abu98o8qf9y2x.cn-beijing.personal.cr.aliyuncs.com/eikoh
set -euo pipefail
if [ $# -ne 1 ]; then
echo "用法: $0 <targetRegistry>"
echo "例如: $0 crpi-nf3abu98o8qf9y2x.cn-beijing.personal.cr.aliyuncs.com/eikoh"
exit 1
fi
TARGET_REGISTRY="$1"
SOURCE_REGISTRY="docker.io"
# ----------------------------
# 要同步的镜像列表
# ----------------------------
IMAGES=(
"nginx:latest"
"redis:6-alpine"
"postgres:15-alpine"
"langgenius/dify-api:1.7.2"
"langgenius/dify-sandbox:0.2.12"
"langgenius/dify-plugin-daemon:0.2.0-local"
"langgenius/dify-web:1.7.2"
"ubuntu/squid:latest"
"semitechnologies/weaviate:1.19.0"
)
for image in "${IMAGES[@]}"; do
# 拆分 name 和 tag
if [[ "$image" == *":"* ]]; then
name="${image%%:*}" # 冒号前
tag="${image##*:}" # 冒号后
else
name="$image"
tag="latest"
fi
short_name="${name##*/}" # 目标镜像只取最后一级名字
SRC="docker://${SOURCE_REGISTRY}/${name}:${tag}"
DST="docker://${TARGET_REGISTRY}/${short_name}:${tag}"
echo
echo "Sync dify image"
echo " Source: ${SRC}"
echo " Target: ${DST}"
echo
skopeo copy "${SRC}" "${DST}"
echo "Completed: ${short_name}:${tag}"
done
echo "All images sync completed"