博客 / 詳情

返回

如何在 Kuscia 中升級引擎鏡像?

打開鏈接即可點亮社區Star,照亮技術的前進之路。

Github 地址:https://github.com/secretflow/kuscia

Kuscia 支持在部署後升級引擎版本,本文檔介紹如何在 Kuscia 中升級引擎鏡像。

導入引擎鏡像

Kuscia 提供腳本升級鏡像和手動升級鏡像兩種方式,您可以根據自己的需求選擇合適的方式。

腳本升級鏡像

  1. 獲取工具腳本

    docker cp root-kuscia-autonomy-alice:/home/kuscia/scripts .
  2. 註冊鏡像

    點對點模式

    Autonomy 節點需要同時導入引擎鏡像和註冊 AppImage,下面以 root-kuscia-autonomy-alice 節點為例,其他 Autonomy 節點也需要進行導入

    ./scripts/deploy/register_app_image.sh -c root-kuscia-autonomy-alice -i secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/secretflow-lite-anolis8:latest -f scripts/templates/app_image.secretflow.yaml --import

    中心化模式

    Master 節點註冊 AppImage 即可,下面以 root-kuscia-master 為例

    ./scripts/deploy/register_app_image.sh -c root-kuscia-master -i secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/secretflow-lite-anolis8:latest -f scripts/templates/app_image.secretflow.yaml

    Lite 節點導入引擎鏡像即可,下面以 root-kuscia-lite-alice 節點為例,其他 Lite 節點也需要進行導入

    ./scripts/deploy/register_app_image.sh -c root-kuscia-lite-alice -i secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/secretflow-lite-anolis8:latest --import

手動升級鏡像

kuscia 命令支持在 RunC、RunP 模式中導入引擎鏡像,使用示例如下:

  1. 登錄到 Autonomy、Lite 節點中

    docker exec -it ${USER}-kuscia-autonomy-alice bash
  2. 導入鏡像

    執行 kuscia image 導入鏡像,此處以 sf 鏡像為例

    # Import Image
    kuscia image pull secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/secretflow-lite-anolis8:1.11.0b1

    如果您使用的是私有倉庫,請加上 creds 參數指定賬户密碼,示例如下:

    # Import Image
    kuscia image pull --creds "user:password" private.registry.com/secretflow/secretflow-lite-anolis8:1.11.0b1

    如果您的環境無法訪問鏡像倉庫,您也可以將鏡像打成 tar 包傳到容器裏,然後通過 kuscia image load 導入,示例如下:

    # Import Image
    kuscia image load -i secretflow-lite-anolis8.tar

    驗證鏡像導入成功

    # View Image
    kuscia image list
  3. 註冊 AppImage

    鏡像導入之後需要在 Autonomy 和 Master 節點上修改 AppImage,Lite 節點無需執行,示例如下:

    # Enter the master container
    docker exec -it ${USER}-kuscia-master bash
    
    # The appimage is based on the actual engine name, we use the default name of secretflow as an example.
    kubectl edit appimage secretflow-image
    
    # Modify the name and tag in the image field, then save and exit.
      image:
        name: xxx
        tag: xxx
user avatar
0 位用戶收藏了這個故事!

發佈 評論

Some HTML is okay.