Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STORY: Digital twin deployment on ZOS 3.0 #1065

Closed
despiegk opened this issue May 31, 2021 · 3 comments
Closed

STORY: Digital twin deployment on ZOS 3.0 #1065

despiegk opened this issue May 31, 2021 · 3 comments
Assignees
Milestone

Comments

@despiegk
Copy link
Contributor

despiegk commented May 31, 2021

to be further defined

deploy using ZOS primitives & RMB

make script in vlang

implementation

  • VM primitive
  • use flist
  • planetary network only first

related issues

@despiegk despiegk added this to the next milestone May 31, 2021
@xmonader
Copy link
Contributor

xmonader commented May 31, 2021

as we don't allow custom flists for VMs there will be a longer starting time always in that case.

changed, we support flists since today (-:
we need to create a docker builder or so, to build all needed and create the flist (can use publishtools)

@sasha-astiadi sasha-astiadi changed the title deployment twin on ZOS 3.0 (June 15) Digital twin deployment on ZOS 3.0 (June 15) Jun 7, 2021
@xmonader xmonader assigned jdelrue and unassigned xmonader Sep 8, 2021
@despiegk despiegk changed the title Digital twin deployment on ZOS 3.0 (June 15) STORY: Digital twin deployment on ZOS 3.0 (June 15) Feb 3, 2022
@despiegk despiegk changed the title STORY: Digital twin deployment on ZOS 3.0 (June 15) STORY: Digital twin deployment on ZOS 3.0 Feb 3, 2022
@despiegk
Copy link
Contributor Author

despiegk commented Feb 3, 2022

AM NOT SURE SPECS ARE STILL GOOD, FIRST THING TO DO CREATE SPECS,
KRISTOF TO SIGN OFF

@despiegk despiegk modified the milestones: next, 3.8 Nov 15, 2022
@despiegk despiegk added this to 3.9.0 Nov 15, 2022
@despiegk despiegk moved this to Blocked in 3.9.0 Nov 15, 2022
@xmonader xmonader moved this from Blocked to 🏗 In progress in 3.9.0 Nov 17, 2022
@LennertDefauw1
Copy link
Contributor

LennertDefauw1 commented Nov 22, 2022

Current status

Currently, a PR has been made in the Grid Weblets repository (threefoldtecharchive/grid_weblets#1033). The PR contains a weblet which is supporting FreeFlow to be deployed on top of Grid3.

There are a few parameters needed:

  • Virtual Machine name
  • 3bot name: to provide a full dns name: eg: lennertapp2.gent01.grid.tf
  • Virtual machine capacity + specs
  • Gateway node
  • Node to deploy on

We are using a gateway component to make the FreeFlow instance more accessible so we can just visit eg: lennertapp2.gent01.grid.tf. The gateway is communicating with the backend of FreeFlow over IPv6.

We decided to communicate over IPv6 because:

  • Public IPv4 is overkill since this only extra billing
  • The public Yggdrasil IP was not an option: see next section

Gateway communication via Yggdrasil is not possible

Since everything within FreeFlow relies on Yggdrasil locations, gateway communication via Yggdrasil was not an option. All data is stored in a Redis Database instance inside your chat container referenced with a Yggdrasil location (Yggdrasil IPv6 IP)

Eg: I am container A and I want to see the avatar of container B: inside the Redis instance, we keep a list of all contacts.

Important to know is that every chat container exposes its own API; eg: http://[my-yggdrasil-ip]/avatar with a payload of the avatar.

A contact is a key-value pair with the name as the key and a Yggdrasil IP as the value. When we want to retrieve the avatar of container B, we send a curl request to http://[container-b-yggdrasil-ip]/avatar over Yggdrasil to obtain its avatar. In this way, everything within FreeFlow relies on Yggdrasil communication.

Why can't we use the Yggdrasil IP?

Since the location is the most important part of communication. We always want to ensure this location is correct. Therefore, we want to have a static Yggdrasil IP address, since we never want to change a Yggdrasil IP afterward. We use the derivedSeed scope inside the TF Connect Authenticator. This secret key is derived from the main seed inside the ThreeFold Connect app, in combination with the appId of the application: eg demo.freeflow.life.

When the user wants to access its chat container, he has to authenticate first. When the authentication is done, we extract the derivedSeed and create Yggdrasil keys based on that seed. In this way, if the container ever would be deleted, the same Yggdrasil IP will be regenerated since it's based on the derived seed which is always the same for the user. In this way, we can provide a static Yggdrasil location for each user.

But when the Yggdrasil IP got changed based on the derived seed, the gateway is not able to communicate anymore to the backend since it would redirect to the old Yggdrasil IP. That's why we can't use Yggdrasil as communication between the gateway and our FreeFlow backend.

DNS

When deploying a FreeFlow container is deployed, a DNS will be provided based on their 3botname in the following format:

{{3botname}}.{{deployed grid node}}.grid.tf

eg: lennertapp2.gent01.grid.tf

Conclusion

To avoid the cost of a public IPv4 address, and due to the Yggdrasil communication issue: we used IPv6 as the communication protocol. This also requires that the gateway where we want to deploy our container needs to support IPv6. An extra filter is needed.

Deployment

The deployment part contains several parts:

zinit

We are using zinit to launch our startup script, provide OpenSSH with the user their ssh key, ..

qsfs

We will need to mount our data outside the container for updating the environments. eg: a new FreeFlow version is QA validated and is ready to set on production. We don't want the user force to create a new container so we will need to be able to update the existing container. Therefore, we will use zqfs (Still needs to be discussed/implemented)

flist

Since FreeFlow is built with docker, this needs to be converted to a custom flist to deploy the chat container on the grid. Currently, the latest version of the flist is available at my hub.grid.tf profile.

Currently, updating the flist is a manual action by pushing the docker image to docker hub, and converting it to a flist in the UI manually. Maybe this part can still be automated.

Future plans

It would be cool to deploy the 3rd party apps within FreeFlow on your node. Those components would be the following:

  • Only-Office document server (for file manager)
  • Kutana (for conferences)
  • Jimber browser (for safe internetting)

When everything went well in step 1, this could be the next step. (Still has to be discussed)

Extras

When researching the grid client, flists, zinit, etc. I made some scripts deploying FreeFlow containers manually / deleting them which you can find here.

@rkhamis rkhamis removed this from 3.9.0 Feb 23, 2023
@rkhamis rkhamis added this to 3.10.x Feb 23, 2023
@rkhamis rkhamis modified the milestones: 3.8, 3.10 Feb 23, 2023
@rkhamis rkhamis removed this from 3.10.x Mar 13, 2023
@rkhamis rkhamis modified the milestones: 3.10, later Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants