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

Feature: Synchronize filesystem with cloud proxy #977

Merged
merged 16 commits into from
Jan 30, 2024
Merged

Conversation

hobinjk-ptc
Copy link
Contributor

@hobinjk-ptc hobinjk-ptc commented Jan 29, 2024

Pretty large feature at the core of the "run clones when the real server is offline" strategy. Corresponding API implementation is in the vuforia-spatial-cloud-proxy repo. Main idea is to run both the fs function and the cloud proxy's fetch-based implementation to keep the local and cloud mostly in sync. If local and cloud differs, then the server runs a big "checksum everything and upload/download what has differences"

@hobinjk-ptc hobinjk-ptc force-pushed the offline-clone branch 2 times, most recently from 3222934 to c8de544 Compare January 29, 2024 19:26
Copy link
Contributor

@dangond-ptc dangond-ptc left a comment

Choose a reason for hiding this comment

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

I don't see anything obviously wrong here, though it feels very weird to me for this to be part of the edge-server instead of the edge-agent plugin (or rather, it feels strange that the edge-agent plugin isn't a native feature of the edge-server). Also feels wrong to store files directly in a DB, but from what I could tell, that's actually fine with Mongo?

The one real concern I have is the write_file and read_file endpoint, which, if not carefully protected, can allow for some nasty security vulnerabilities.

This code LGTM though, so approving.

@hobinjk-ptc
Copy link
Contributor Author

Oh, for clarification I've removed all the MongoDB code. It was an approach I used in the earlier stages of this project but didn't really scale since each edge server would need credentials for our db. The API on the cloud-proxy is currently backed by the filesystem but could use the same mongodb backend that used to be in this code.

read_file and write_file both have some amount of sanitation applied in the cloud-proxy.

Ideally edge-agent would be part of the server for sure, the tendrils of its responsibilities snake into every nook and cranny

@hobinjk-ptc hobinjk-ptc marked this pull request as ready for review January 30, 2024 16:17
@hobinjk-ptc hobinjk-ptc merged commit 19adb01 into main Jan 30, 2024
2 checks passed
@hobinjk-ptc hobinjk-ptc deleted the offline-clone branch January 30, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants