Code Monkey home page Code Monkey logo

Comments (4)

BeaCox avatar BeaCox commented on June 26, 2024 2

BeaCox Give it to me

from kuscia.

santiago-wjq avatar santiago-wjq commented on June 26, 2024 1

1、如果有其他容器在使用kuscia- exchange的话,那使用docker network rm kuscia-exchange会返回报错。
2、考虑到后续如果用户要在节点上要使用其他的容器,比如要部署一个mysql,此时mysql也是要加入kuscia- exchange的,但是脚本不应该清除mysql,因此kuscia- exchange也无法清除。

基于以上两点,可以认为kuscia-exchange不删除也不是很严重的问题。我建议只要尝试删除一下,并不需要关心是否成功。


其中网络比较特殊——两种模式共用同一个kuscia-exchange网络,那么只有在两种模式的容器都将被移除时,才应该删除这个网络。因此在删除某一模式的容器的最后一步——删除网络之前需要先检查另一种模式的容器是否存在。如果传入all,删除全部则不需要考虑此种情况,全部删除即可。

from kuscia.

BeaCox avatar BeaCox commented on June 26, 2024

方案:

  • stop

    接受4种参数:

    • center

      停止中心化组网模式部署的容器

    • p2p

      停止点对点组网模式部署的容器

    • all

      停止所有kuscia容器

    • -h

      展示帮助信息

    其他参数将会展示帮助信息。

    具体方法:

    参考start_standalone.sh中如果已有容器则需用户确认是否重新创建容器的逻辑,可知用户的所有kuscia容器的名称都是在已知范围内的,可以通过以下方式进行筛选kuscia容器:

    • center

      docker ps --format '{{.Names}}' -f name=^${P2P_PREFIX}
    • p2p

      docker ps --format '{{.Names}}' -f name=^${CTR_PREFIX} | grep -v ^${P2P_PREFIX}
    • all

      docker ps --format '{{.Names}}' -f name=^${CTR_PREFIX}
  • uninstall

    接受4种参数:

    • center

      移除中心化组网模式部署的容器、卷和网络(如果没有 p2p 容器,包括未运行的)

    • p2p

      移除点对点组网模式部署的容器、卷和网络(如果没有 center 容器,包括未运行的)

    • all

      移除所有kuscia容器、volume、network

    • -h

      展示帮助信息

    其他参数将会展示帮助信息。

    uninstall脚本在筛选容器、volume时与stop脚本逻辑一致。

    其中网络比较特殊——两种模式共用同一个kuscia-exchange网络,那么只有在两种模式的容器都将被移除时,才应该删除这个网络。因此在删除某一模式的容器的最后一步——删除网络之前需要先检查另一种模式的容器是否存在。如果传入all,删除全部则不需要考虑此种情况,全部删除即可。

  • 正确性要求

    在函数remove_container的开头调用check_running_containers函数

    check_running_containers接受一个网络模式类型参数,查找是否有正在运行的该类容器。如果有,提示用户并退出脚本;如果没有,该函数正常返回,remove_container得以继续执行。

from kuscia.

BeaCox avatar BeaCox commented on June 26, 2024

哦哦,收到,这点确实没有考虑清楚。感谢建议

from kuscia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.