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

Al/new redis graph modeling #125

Draft
wants to merge 39 commits into
base: main
Choose a base branch
from
Draft

Conversation

adrianLIrobotics
Copy link
Contributor

No description provided.

adrianLIrobotics and others added 30 commits March 3, 2023 13:24
@Artonus Artonus self-requested a review March 28, 2023 08:16

public override Dto.Dto ToDto()
{
var domain = this;
Copy link
Member

Choose a reason for hiding this comment

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

Running action has to store its placement

[RedisIdField]
public override string Id { get; set; } = default!;
[Indexed]
public string ActionParentId { get; init; } = default!; // This is the ID in which the actionRunning us based from the normal Action
Copy link
Member

Choose a reason for hiding this comment

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

comment typo

return new ActionRunningModel()
{
Id = Guid.Parse(dto.Id.Replace(Prefix, "")),
ActionParentId = Guid.Parse(dto.ActionParentId.Replace(Prefix, "")),
Copy link
Member

Choose a reason for hiding this comment

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

We don't have to replace prefixes in these fields

//Add the actionRunning to redis
foreach (ActionModel action in task.ActionSequence)
{
ActionRunningModel actionRunningTemp = new ActionRunningModel();
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be extracted into a separate method

@@ -292,6 +351,79 @@ public V1Service CreateService(string serviceImageName, K8SServiceKindEnum kind,
/// <inheritdoc/>
public async Task<bool> DeletePlanAsync(ActionPlanModel actionPlan)
{
// Delete OWNS relationship between robot and actionPlan
Copy link
Member

Choose a reason for hiding this comment

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

Extract to the separate methods

@@ -236,6 +236,56 @@ public async Task<bool> ActionPlanDeleteAsync(Guid id, CancellationToken token)
return await ContainerImageGetForInstanceAsync(id, CancellationToken.None);
}

public async Task<bool> ActionRunningAddAsync(ActionRunningModel actionRunning)
Copy link
Member

Choose a reason for hiding this comment

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

The functions have to be implemented

@@ -77,7 +77,7 @@ public class PlanController : ControllerBase
if (dryRun)
return Ok(resourcePlan);

await _redisInterfaceClient.AddRelationAsync(robot2, resourcePlan, "OWNS");
await _redisInterfaceClient.AddRelationAsync(robot2, resourcePlan, "WANTS_TO_RUN");
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't a robot still OWN an action plan?

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