Giter Club home page Giter Club logo

Comments (17)

dlespiau avatar dlespiau commented on May 24, 2024 1

Maybe we could name --machine-name --hostname instead so we can keep the shorter --name for clusters?

I'm a bit hesitant changing flags, maybe we could add --cluster-name as an alias of --name so the old command still works but we can change the documentation to refer to the new flag.

from footloose.

dlespiau avatar dlespiau commented on May 24, 2024 1

Give that the machine name is really a template for several machines names, maybe we can add an s at the end to convey that: --hostnames

from footloose.

najeal avatar najeal commented on May 24, 2024

Should we verify that machines are not existing before to apply changes? Then return an error if it exists or restart them with the new config?

from footloose.

dlespiau avatar dlespiau commented on May 24, 2024

I was thing thinking the set command would actually mutate the config file.

The config create one is a bit special because it should be careful when overriding an existing file. With set the user wants to modify something in an existing config file so we modify an existing one (add probably error if trying to set a field that doesn't exist.

I'm not sure how we would add a Machine to an already existing config file. Maybe the whole config file editing needs to be thought through a bit more :)

We need to be able to:

  • Modify fields of an already existing config file
  • Add new Machine

from footloose.

najeal avatar najeal commented on May 24, 2024

Yes :)
But I think some config fields are more complex. Admitting the file is already created and the machines are already launched. For example, if we change the machine name from "node%d" to "nodes%d". We should take care to firstly remove docker containers, otherwise, we lose the access to "node%d" from Footloose and we have to "Docker stop" manually the machines. No?

from footloose.

dlespiau avatar dlespiau commented on May 24, 2024

For the case you mention:

  • We shouldn't stop the containers for a config change, the user will lose state (changes made to the filesystem, programs running, ...)
  • We could error when the user is trying to change the configured hostname while machines are running, telling them machines should be removed before editing that field.

from footloose.

najeal avatar najeal commented on May 24, 2024

It makes sense

from footloose.

najeal avatar najeal commented on May 24, 2024

We need to be able to:

  • Modify fields of an already existing config file
  • Add new Machine

What do you think of splitting theses two needs in two different sub-commands?
footloose config set for modifying cluster config and machines
footloose config add for adding new machines to the config

from footloose.

dlespiau avatar dlespiau commented on May 24, 2024

I was thinking something similar to you, yes :)

We have a decision to make: right now config create creates both the cluster and the fist machine. add would have similar commands for the remaining machines. We could have orthogonal commands (one to create the cluster, one to add machines) at the price of having to type two commands when creating a brand new cluster. But it may make more sense:

footloose config create [cluster] --name cluster-name
footooose config add [machine] --replicas 2 --image quay.io/footloose/fedora29

That said, we could still have create create the first machine template because creating a cluster without machines isn't very useful. Not too sure what is the best option here, any opinion?

from footloose.

najeal avatar najeal commented on May 24, 2024
footloose config create [cluster] --name cluster-name
footooose config add [machine] --replicas 2 --image quay.io/footloose/fedora29

It is more clear about what happens behind. However, it can really be boring to type two commands.

I like the idea to have the footloose create config still creating the first machine, then use add to create the second one.

from footloose.

dlespiau avatar dlespiau commented on May 24, 2024

sounds good to me then :)

from footloose.

najeal avatar najeal commented on May 24, 2024

I will work on :)
I just would like to have the PR #151 merged to avoid conflict because I need some of the work from it

from footloose.

najeal avatar najeal commented on May 24, 2024

We are maybe talking too much about add command in the set subject but one problem I see is:

footloose create config does not have a flag for the machine names, it only has for the cluster name.
Giving the possibility to give machine names for the add command seems to break logic.
In my opinion, it could be useful to add the possibility to give machine name to footloose create config and have a logical link in the flag names through commands.
Example:

  • footloose create config renaming --name to --cluster-name flag + --machine-name flag
  • add having --machine-name flag

Does it make sense?

from footloose.

dlespiau avatar dlespiau commented on May 24, 2024

oh, and also when adding a new machine, we have to check the name/hostname doesn't conflict with previous machine specs. If two specs have the same, say node%d it'll confuse footloose (can't start all the machines).

We could also choose to remove that restriction by encoding the index of the spec into the docker container name: $cluster-$i-$hostname, eg. cluster-0-node0,

from footloose.

najeal avatar najeal commented on May 24, 2024

oh, and also when adding a new machine, we have to check the name/hostname doesn't conflict with previous machine specs. If two specs have the same, say node%d it'll confuse footloose (can't start all the machines).

Or we could accept changes even if there is conflict, then add this check in our config validation when we footloose start, footloose stop footloose create , ... But I prefer your option 😛

We could also choose to remove that restriction by encoding the index of the spec into the docker container name: $cluster-$i-$hostname, eg. cluster-0-node0,

I suspect that it stills have a conflict for the footloose ssh root@node0 ?

Concerning the set command

cluster:
  name: clu2
  privatekey: ""
machines:
- spec:
    name: node%d
    image: quay.io/footloose/fedora29
    privileged: false
    volumes: []
    portmappings: []
    cmd: ""
  count: 3

I can correctly set for string, int and bool values with a generic solution. But volumes and portmappings are arrays. It seems difficult to set an array. Should I avoid these two fields?

from footloose.

dlespiau avatar dlespiau commented on May 24, 2024

We could also choose to remove that restriction by encoding the index of the spec into the docker container name: $cluster-$i-$hostname, eg. cluster-0-node0,

I suspect that it stills have a conflict for the footloose ssh root@node0 ?

Yes indeed, ssh has a problem with it too, oh well, seems like we need to enforce every machine spec has a different hostname.

Concerning the set command

cluster:
  name: clu2
  privatekey: ""
machines:
- spec:
    name: node%d
    image: quay.io/footloose/fedora29
    privileged: false
    volumes: []
    portmappings: []
    cmd: ""
  count: 3

I can correctly set for string, int and bool values with a generic solution. But volumes and portmappings are arrays. It seems difficult to set an array. Should I avoid these two fields?

Hum, I hadn't thought about volumes and port mappings :)

For them we could add CLI parameters that look like what docker run does. For instance #80. So you could specify them with add at least.

Maybe we could have add sub-commands:

footloose config add machines --hostname worker%d --replicas 3
footloose config add portmapping cluster.spec[0]  8080:80
footloose config add volume cluster.spec[0] ...

from footloose.

unicomp21 avatar unicomp21 commented on May 24, 2024

Is this dead?

from footloose.

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.