threefoldtech / web3gw

Proxy for the web3 world
Apache License 2.0
1 stars 1 forks source link

Tfgrid: Add example that deploys VMs on the same network #70

Closed brandonpille closed 1 year ago

brandonpille commented 1 year ago

This will complete the issue https://circles.threefold.me/project/tf_engineering_coordination/task/14: "I can create 2 VM, attach to same network and user webgateway to access webserver as running in VM"

We should create an example in the examples folder (maybe in a new folder tfgrid) which should do this:

Maybe we should think about passing this configuration through a configuration file (maybe through markdown docs actions). This example below is the content of a markdown file that contains the configuration of 2 VMs (1 with 2 cpus, the other with 4 and both 4GB ram). This is only a minimal configuration. All required configuration should be able to be defined in this markdown action.

!!3bot.tfgrid.vm.deploy
    cpu:2
    memory:4GB
!!3bot.tfgrid.vm.deploy
    cpu:4
    memory:4GB

See markdown docs on how to use the markdown docs. Come to @brandonpille for any questions.

MarioBassem commented 1 year ago

the markdown suggestion is really nice, but i kind of think its redundant here.

when a user writes an action, they specify two things: the action (deploy, update, get, delete), and the needed specs... if these are the only actions provided, then we could just prepare an example v file that uses the rpc client out of the box for each action and the user would only need to update the specs inside, these specs would not be any different from the ones the user would provide in a markdown file.

if these are not the only actions provided, and we wanted to provide some easy-to-use solutions like, deploying a vm and linking it to some gateawy, then we could also provide an example file to do just that...

so basically, instead of the user having to write an action name in a markdown file, they would just run the right example, the specs are provided in both approaches without any differences. they are basically the same thing, except that in the markdown approach, we would have an extra step of parsing the user's files.

brandonpille commented 1 year ago

the markdown suggestion is really nice, but i kind of think its redundant here.

when a user writes an action, they specify two things: the action (deploy, update, get, delete), and the needed specs... if these are the only actions provided, then we could just prepare an example v file that uses the rpc client out of the box for each action and the user would only need to update the specs inside, these specs would not be any different from the ones the user would provide in a markdown file.

if these are not the only actions provided, and we wanted to provide some easy-to-use solutions like, deploying a vm and linking it to some gateawy, then we could also provide an example file to do just that...

so basically, instead of the user having to write an action name in a markdown file, they would just run the right example, the specs are provided in both approaches without any differences. they are basically the same thing, except that in the markdown approach, we would have an extra step of parsing the user's files.

As discussed during our call. We want to make it as clean as possible. Having the users modify the V code to then run it themselves is not clean enough.

MarioBassem commented 1 year ago

as we were adding examples, we encountered this issue with the tfgrid-sdk: https://github.com/threefoldtech/tfgrid-sdk-go/issues/149

DylanVerstraete commented 1 year ago

@MarioBassem what is the status of this one? Are we still adding this in the near future or will this be postponed?

MarioBassem commented 1 year ago

this issue consisted of two parts:

the first part is done, the second part is now 3lang i guess :)

so i believe we can close it as 3lang has its own issue now, no?

brandonpille commented 1 year ago

Yes the second part is being done in the 3lang. Maybe we should block this issue until the 3lang is merged.

MarioBassem commented 1 year ago

this is done in #95 you can now deploy multiple vms on the same network using 3lang or cli. 3lang docs could be found here cli docs could be found here