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

Workload & Mongodb Schema #51

Closed
wants to merge 48 commits into from
Closed

Workload & Mongodb Schema #51

wants to merge 48 commits into from

Conversation

zeeshan595
Copy link
Contributor

No description provided.

@JettTech JettTech mentioned this pull request Jan 16, 2025
Base automatically changed from nats-crates to main January 17, 2025 17:39
Copy link
Contributor

@JettTech JettTech left a comment

Choose a reason for hiding this comment

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

I noticed that the delete fn is still unimplemented, so some of the feedback may be a bit premature. That said, I went ahead and finished the review since we discussed it via DM. Also, I do think that this is a great start! 💪

I really appreciate the clean up of the mongodb id type and the addition of the updated_at and deleted_at fields. I also responded to some of the questions re: the User collection and left some feedback on the update method; let me know if you have any Qs you'd like to sync on.

Copy link
Contributor

@JettTech JettTech left a comment

Choose a reason for hiding this comment

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

Clean additions and changes! 💪 I'm liking the direction this is taking. I left some feedback on the mongodb schema and left a request to add some additional logic to the handle_db_update flow. I also proposed automating the metadata changes by moving them over the mongodb struct itself. (...and I love that new metadata structure, btw. :))

Let me know if you have any Qs. Happy to talk through any/all of this too.

@@ -0,0 +1,17 @@
use actix_web::{get, HttpResponse, Responder};
Copy link
Contributor

Choose a reason for hiding this comment

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

Sync to async: we acknowledged that this is just a placeholder dir and will likely be replaced in the subsequent PR. That said, I am interested in seeing if we could use the actix code as the baseline for the orchestrator's external facing api.

}

async fn db() -> mongodb::error::Result<()> {
let connection_uri = env::var("DB_CONNECTION_STRING").unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

Nudge... I know this code was just copied over from the holo-orchestrator repo and is subject to change, but while it lives in this repo and condition, I'd like to avoid adding any overlapping env vars. :)

What do you think about the suggestion above?

pub enum Role {
Developer(DeveloperJWT), // jwt string
Host(HosterPubKey), // host pubkey
pub enum UserPermission {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a fine pattern, but I'm not sure of the use case. What are you envisioning the Permissions being used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

User's will generally require permissions. For example hosters should be able to access their own hosts and information about it. Developers should be able to access workloads they have deployed e.t.c.

This should be done through assigning permissions to them

Copy link
Contributor

Choose a reason for hiding this comment

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

I see an overlap between this and the nats permissions use case. I understand that, prior to nats, we used to manage permissions in this way, but I think we no longer need to in our new architecture. That said, I'm open to being persuaded otherwise. :)

@zeeshan595 zeeshan595 requested a review from a team as a code owner February 4, 2025 16:12
Zeeshan and others added 7 commits February 4, 2025 16:13
Signed-off-by: Zeeshan Abid <[email protected]>
Signed-off-by: Zeeshan Abid <[email protected]>
Signed-off-by: Zeeshan Abid <[email protected]>
Signed-off-by: Zeeshan Abid <[email protected]>
Signed-off-by: Zeeshan Abid <[email protected]>
Copy link
Contributor

@JettTech JettTech left a comment

Choose a reason for hiding this comment

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

I approve... with the small reminder/acknowledgement that the orchestrator code here is a placeholder and there are a few code debt items we expect to resolve in later prs. Also, let's make sure the CI passes prior to merging. 👍

Overall, I'm excited to see this move into main, this includes some updates to the mongodb interface and handling! Thanks for the hard work. 💪

@JettTech
Copy link
Contributor

JettTech commented Feb 10, 2025

@steveej - can you take a look at the above CI failure. It is failing with the error: aarch64-linux.pkgs-rust-workspace-doc was failed because it has failed previously and its failure has been cached.
https://buildbot-nix-0.infra.holochain.org/#/builders/414/builds/206

this avoids the build-time download requirement.
@steveej
Copy link
Contributor

steveej commented Feb 10, 2025

@steveej - can you take a look at the above CI failure. It is failing with the error: aarch64-linux.pkgs-rust-workspace-doc was failed because it has failed previously and its failure has been cached. https://buildbot-nix-0.infra.holochain.org/#/builders/414/builds/206

i pushed d96abc1 to avoid the build-time download requirement entirely.

@zeeshan595
Copy link
Contributor Author

Moved to #63

@zeeshan595 zeeshan595 closed this Feb 14, 2025
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.

3 participants