Giter Site home page Giter Site logo

Comments (5)

HaraldGustafsson avatar HaraldGustafsson commented on May 16, 2024

This seems to be a bug, we will try to reproduce it. Likely the app delete is broken.

from calvin-base.

HaraldGustafsson avatar HaraldGustafsson commented on May 16, 2024

I created 3 local runtimes, deployed a simple calvinscript with 3 actors, migrated manually the 3 actors to one of the other runtimes. Then followed your screenshot. My result is that the actors were deleted.

$ cscontrol http://127.0.0.1:5001 actor list
[]
$ cscontrol http://127.0.0.1:5005 actor list
[]
$ cscontrol http://127.0.0.1:5003 actor list
[
  "0f78e7cb-5bfd-490f-8013-08df5bdde910", 
  "3ea3fd2e-98c6-4df7-9a12-6d96a1bd949b", 
  "46ae313c-d8bd-43be-8117-3481976092df"
]
$ cscontrol http://127.0.0.1:5001 applications list
[
  "12df9014-ee09-4b5a-9db3-b88ae5407fa2"
]
$ cscontrol http://127.0.0.1:5003 applications list
[]
$ cscontrol http://127.0.0.1:5005 applications list
[]
$ cscontrol http://127.0.0.1:5001 applications delete 12df9014-ee09-4b5a-9db3-b88ae5407fa2
""
$ cscontrol http://127.0.0.1:5001 actor list
[]
$ cscontrol http://127.0.0.1:5003 actor list
[]
$ cscontrol http://127.0.0.1:5005 actor list
[]

So it must be some difference in what you did before what is shown in the image. Could you share more details on which calvinscript, what migrations, etc that you did?

By the way, even if only one of the runtimes provide the application id (due to that the control interface only looks locally instead of in the registry), you should be able to delete the application from any of the nodes.

from calvin-base.

alain-ryser avatar alain-ryser commented on May 16, 2024

Hmm I actually did almost the same thing. The only difference is that instead of starting up the application and then migrating it manually, I used
$ cscontrol http://<ip>:5001 deploy --req depl.deployjson app.calvin
Where I used depl.deployjson and app.calvin as in the example on Application Deployment. So depl.deployjson was

{
    "groups": {"firstgroup": ["src", "sum"]},
    "requirements": {
        "src": [{"op": "union_group", 
                 "requirements": [{"op": "node_attr_match", 
                                   "kwargs": {"index": ["node_name", {"organization": "org.testexample", "name": "testNode1"}]}
                                   }, 
                                  {"op": "node_attr_match", 
                                   "kwargs": {"index": ["node_name", {"organization": "org.testexample", "name": "testNode2"}]}
                                   }],
                 "type": "+"
                }, 
                {"op": "current_node", 
                 "kwargs": {},
                 "type": "-"
                }], 
        "sum": [{"op": "node_attr_match", 
                 "kwargs": {"index": ["node_name", {"organization": "org.testexample", "name": "testNode2"}]},
                 "type": "+"
                }], 
        "snk": [{"op": "node_attr_match", 
                 "kwargs": {"index": ["node_name", {"organization": "org.testexample", "name": "testNode3"}]},
                 "type": "+"
                }, 
                {"op": "current_node", 
                 "kwargs": {},
                 "type": "-"
                }]
            }

and app.calvin

src : std.CountTimer()
sum : std.Sum()
snk : io.StandardOut()

src.integer > sum.integer
sum.integer > snk.token

I started up the runtimes as in the example using

csruntime -n <ip-addr> -p 5000 -c 5001 -w 0 --attr '{"indexed_public": {"node_name": {"organization": "org.testexample", "name": "testNode1"}}}' &
csruntime -n <ip-addr> -p 5002 -c 5003 -w 0 --attr '{"indexed_public": {"node_name": {"organization": "org.testexample", "name": "testNode2"}}}' &
csruntime -n <ip-addr> -p 5004 -c 5005 -w 0 --attr '{"indexed_public": {"node_name": {"organization": "org.testexample", "name": "testNode3"}}}' &

Which is the only thing that is not on the screenshot..
Maybe it has to do when deploying applications using requirements?

from calvin-base.

persquare avatar persquare commented on May 16, 2024

Unrelated to the issue you have with buggy application clean-up, I'd just like to point out that the example code dealing with explicit .deployjson files dates to before we had a way of expressing deployment requirements in CalvinScript. In your case above, you could instead add something along the following lines to the .calvin file (untested):

rule node1 : node_attr_match(index=["node_name", {"organization": "org.testexample", "name": "testNode1"}])
rule node2 : node_attr_match(index=["node_name", {"organization": "org.testexample", "name": "testNode2"}])
rule node3 : node_attr_match(index=["node_name", {"organization": "org.testexample", "name": "testNode3"}])
rule node1or2 : node1 | node2

apply src : node1or2 & ~current_node()
apply sum : node2
apply snk : node3

Have a look at the files in calvin/tests/codegen, in particular test_deploy3.calvin and test_deploy3.deployjson.

While it does not solve your problem, it does make your life easier if you are going to play around with deployment requirements.

from calvin-base.

alain-ryser avatar alain-ryser commented on May 16, 2024

Oh wow thank you for the hint this is actually really helpful!

from calvin-base.

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.