Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Feature/freeflow #1033

Open
wants to merge 21 commits into
base: development
Choose a base branch
from
Open

Feature/freeflow #1033

wants to merge 21 commits into from

Conversation

LennertDefauw1
Copy link

@LennertDefauw1 LennertDefauw1 commented Oct 3, 2022

Description

In this PR, support of FreeFlow (https://github.com/threefoldtech/twin_aydo) on Gridv3 will be available through UI.

Changes

  • Added new tab for FreeFlow
  • Provide functionalities + classes + layout to deploy FreeFlow containers through UI

Related Issues

threefoldtech/tfgrid-sdk-ts#129

@Omarabdul3ziz
Copy link
Contributor

After I deployed an instance I tried to access it with the IP listed. and after a redirection, I got a bad gateway error.
image

When I combine the solution_name.selected_gateway_domain and tried to access the solution after a redirection to TF Auth i got an error that it can't find my name.
2022-10-11_13-59

The same 3bot name working with other solutions as example here with hub.grid.tf
image

Copy link
Contributor

@Omarabdul3ziz Omarabdul3ziz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some additional comments due to

Deployment process

  • the placeholder for the name filed said Your 3bot Name and looking into the code it is not used for any special envars just the name of the machine(s) models. so it it required to be the 3bot name? if the 3bot username is needed we can add another field than Name since this should be unique for each deployment.
  • Can you please use the SelectCapacity component to be able to choose a flavor for capacity or set it manually?
  • it looks that the server on the machine bind on both ipv6/ipv4 so the gateway can have the backend as planetary IP and make the solution doesn't require a public IP. since it has higher cost
    image
  • the modal box did not work after the instance is deployed.

Deployment list

  • there is should be an actions column in the deployments table that does (show the details, go to the domain created, others if needed ) but there is none. please check the deployment list for other weblets
    image

Flist

  • can you use zinit as the PID 1 service for the solution? it will make it easier to trace the logs back if something goes wrong.
  • all flists should be promoted to be at the official-apps repo on flists hub. https://hub.grid.tf/tf-official-apps/freeflow.flist

@Omarabdul3ziz
Copy link
Contributor

almost all the code base follows the formatting form extensions

  • Prettier - Code formatter for typesctipt files
  • Svelte for VS Code for svelte files

@LennertDefauw1
Copy link
Author

Some remarks:

Deployment process

First of all, the reason why your 3bot name is not recognized is because the FList is deployed with the staging ThreeFold Connect Authenticator. I will change this to production enviroment.

Furthermore, the ThreeFold Connect 3bot name is necessary (not just a random chosen name), because a login attempt will be setup specific for the 3bot name. If the user will log in with another account, the authentication process will throw an error. This is intended, otherwise you could impersonate yourself as someone else.

Eg; I am trying to login in a FreeFlow container of Lennert00. So I am just changing the name in the login screen from Lennert00 to Lennert11. I am accepting the login attempt inside the app with Lennert11. This wont work since the login attempt is created for Lennert00 and is accepted by Lennert11.

Conclusion: the right 3botname is needed to authenticate to your FreeFlow.

Good remark with adding SelectCapacity to the form + agreed with binding IPV6 to the backend.

Deployment list

I will add some more details such as the DNS name in the deployment table, so users easily can navigate to their own FreeFlow container.

Flist

I will change the startup process to zinit.

Am I able to push an flist to push content on the official-apps repo? If yes, how can I do this?

Other remark

The reason why I made a seperate validateThreeBotName is since a 3bot name can container more than 15 characters. So indeed, using the 3bot name as name for the VM is not the right method. I'll fix this by adding a unique name for each deployment, but a function which validates the 3bot name is still necessary.

@Omarabdul3ziz
Copy link
Contributor

since the 3bot name and the deployment name will be different fields it is okay to have different validations for both.

and for pushing the flist to the official repo. after you finish all the updates and test it we can ask Maxime to push it.

@LennertDefauw1
Copy link
Author

Updated PR:

Deployment process

  • Added Capacity Selector Field
  • Redirect to login.threefold.me instead of staging environment
  • DIvided VM name into 3bot name and VM name
  • Removed Public IPV4 and linked IPV6 IP to backend

Deployment list

  • Added actions with JSON details and visit website

Flist stuff

  • Used zinit as entrypoint

Todo:

  • Can you specify "the modal box did not work after the instance is deployed"?
  • Ask Maxime to add freeflow to officlal TF apps

Copy link
Contributor

@Omarabdul3ziz Omarabdul3ziz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

however, it said there is a deployment with the same name. there is none listed in the deployment list
Untitled (1)

vm.env = createEnvs(envs);

const vms = new MachinesModel();
vms.name = threeBotUserId;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the 3bot name is still used as the deployment name. i got this error, is it supposed to be only one instance for each user?

Untitled
note: omarabdulaziz is my 3bot name not the name i entered in the deployment name field

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, forgot to change that name too ^^

Yeah, noticed this problem too, even if I deleted all of my contracts on devnet, a new NamedGateway with a previous created name (which is already) deleted, cant be deployed.

See: https://github.com/threefoldtech/test_feedback/issues/299

@Omarabdul3ziz
Copy link
Contributor

  • The Modal box is the component used to show the deployment data. it should appear after the deployment is successful. try to deploy any weblet instance to see how it works.

  • After we can test the flist and make sure it is stable will ask Maxime to push it to the official app repo

@LennertDefauw1
Copy link
Author

Updated PR:

  • Added modal when deployment is completed
  • Changed VM name to actual VM name and not 3botname

Todo:

@Omarabdul3ziz
Copy link
Contributor

@LennertDefauw1
Copy link
Author

Updated PR with unique networkname + merged back again with development. Also added the new capacity selector component

Added a comment to the issue of the DNS gateways, had no named contracts in the contract list, so still stuck on this issue => but cant really help on that I think

@LennertDefauw1
Copy link
Author

Update:

added checkGW before deploying the gateway to invalidate cache

Now all issues should be resolved

@Omarabdul3ziz
Copy link
Contributor

Weblets

  • The freeflow solution deploys two workloads (machine and gateway) and it waits for the machine deployment to be ready then you deploy the gateway. grid_client should handle the error if something happens in either two workloads deployment process. so it rollback and delete all the related created contracts.
    So if the gateway deployment failed it will roll back, but we will have a machine workload that still exists (not working actually since there is no live domain). most of the weblets use the destroy() method to delete the machine if the gateway failed.

  • Also, the gw.node_d takes the value of vm.nodeId and this is not necessary. the machine can be deployed on any node but the gateway must be deployed on a public node. so if you choose Node(11) a non-public node for example. the machine will be deployed successfully but the gateway not.

please check the code in peertube/funkwhale/owncloud or any solution that deploys a gateway for help on these two comments, And it will be easier to follow the code structure on them it will make it easier to debug after.

Image.

  • after i successfully manage to deploy an instance and click he visit button it give me 404 error code.
    Untitled

    and when i ssh. it looks there is no services started with zinit
    image

@LennertDefauw1
Copy link
Author

PR is updated

@Omarabdul3ziz
Copy link
Contributor

can't log in with tfconnect. after I get the notification on the app and select the emoji it did nothing on the authenticator page. keep printing this
image

tried different threebot ids

@LennertDefauw1
Copy link
Author

LennertDefauw1 commented Nov 8, 2022

PR has been updated, since inside update of freeflow, yggdrasil process got respawned with new keys which required us to communicate over ipv6 from gateway to backend instead of yggdrasil

@LennertDefauw1
Copy link
Author

LennertDefauw1 commented Dec 8, 2022

Any updates on the IPV6 filter for gateways? for communication over IPv6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants