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

The sync service #4

Open
9 of 11 tasks
hacdias opened this issue Mar 2, 2021 · 3 comments
Open
9 of 11 tasks

The sync service #4

hacdias opened this issue Mar 2, 2021 · 3 comments

Comments

@hacdias
Copy link
Member

hacdias commented Mar 2, 2021

Hey y'all,

In the current state of Testground, the SDKs are connecting directly to Redis. We want to build an SDK for JavaScript that also works on the browser. However, we cannot connect to Redis directly from the browser as it does not provide a native HTTP interface. Thus, works on sdk-js are paused until this issue here is closed.

The goal is to create a sync service that can be used by Testground. The sync service provides an HTTP interface and it is a bridge to Redis - or virtually any other backend that we might want to use in the future. Due to the dimension of Testground, this needs to be well tested and we must make sure everything works flawlessly during the transition.

Required

Work on after

A few months after release

@hacdias hacdias changed the title Sync service working The sync service Mar 2, 2021
@hacdias
Copy link
Member Author

hacdias commented Apr 13, 2021

I have been working on this feature since January and I feel like I have lost hold on it. Thus, I'm leaving a quick recap of everything that was developed and the current state.

Why is thing being built? When I started building the JavaScript, I quickly realized we couldn't use it in the browser mainly because we were connecting to Redis from the test instances directly. Redis does not provide a native HTTP interface and it is not recommended to use from a browser.

Thus, we decided to create a sync service: a service to which all test instances would connect and do the necessary sync requests: barrier, publish, subscription and entry signaling. I decided on using WebSockets because they are easy to use and allow for versatility as well as performance.

The sync service is implemented on this repository. The code must be reviewed by at least one other person. There are tests, but they are not extensive.

Both SDKs have ongoing implementations for connecting to the new sync service:

  • The Go SDK is mostly finalized and only requires a bug fixing.
  • The JS SDK I actually started a few days ago and is not working properly so needs to be investigated.

On the main side of Testground the PR is finalized and we just need to finish the other PRs in order to merge everything.

There will be the need to adapt the infra repository to the new sync service, which means that there will need to be a Pod running the image iptestground/sync-service, connected to a Redis instance, that will be accessible by the test cases.

/cc @jacobheun @nonsense

@raulk
Copy link

raulk commented Apr 13, 2021

@hacdias thanks for the summary. Could you elaborate on the alternatives considered before deciding to go in the direction of introducing a new architectural layer? Concretely, did we evaluate https://webd.is? What made us build our own? Is there a technical design document or spec that I can read to understand the endeavour better? Thanks!

@hacdias
Copy link
Member Author

hacdias commented Apr 14, 2021

Hey @raulk!

The initial idea was to test webd.is. However, we decided to build a new layer mostly because: (1) the official Redis advice is not to use it on the web, (2) in case we decide to replace Redis in the future - unlikely for now - we would need to rewrite all the SDKs; and (3) there was already an issue (or conversations) regarding separating the sync service into a different layer. However, I can't find the issue right now. /cc @nonsense

There is no technical design document, nor spec. If you want, we can have a call for me to explain better what happened so far and what is built.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

2 participants