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

Supporting deployments on zos4 nodes #3497

Open
wants to merge 35 commits into
base: development
Choose a base branch
from

Conversation

maayarosama
Copy link
Contributor

@maayarosama maayarosama commented Oct 3, 2024

Description

Supporting deployments on zos4 nodes from grid client and dashboard

Changes

  • Added a network light and machine light workloads
  • Adjusted workload types to contain the two newly added workloads
  • Added unit tests for the two new workload types
  • Added a ZNetworkLight primitive class to handle the creation of network light workload
  • Added a VMLightPrimitive primitive class to handle the creation of zmachine light workload
  • Updated the _createDeployment and create method to support zos4 deployments according to the node's features
  • Updated deployMerge and saveNetworks methods in TwinDeploymentHandler
  • Added getFeaturesFromFilters method in nodes and capacity module to set node's features according to the filters chosen by the user
  • Added extra filters in the FilterOptions class
  • Adjusted automated and manual node selection to consider features in filters
  • Added planetary, mycelium and wireguard filters to all solutions
  • Added a single_vm_zos4.ts script to deploy on a zos4 node
  • Added deployment_flow.md

Related Issues

Tested Scenarios

  1. Node 168 which is a zos3 node
    Screenshot from 2024-11-17 15-27-45

  2. Node 255 which is a zos4 node
    Screenshot from 2024-11-17 15-27-20

  • Go to Dashboard
    1. In the deploy section, select any solution
    2. In the automated node selection:
    3. Adjust your filters to include only the Mycelium network
    4. Reload the nodes.
    5. Observe that both zos4 and zos3 nodes are listed.
    6. Deploy on any node and it will pass (note: zos4 node used is 255)
    7. Observe Deployment list
    8. Navigate to Contracts list

Screenshot from 2024-11-17 15-50-10

Screenshot from 2024-11-17 15-50-58

Screenshot from 2024-11-17 15-52-40

  • Go to Dashboard

    1. In the deploy section, select any solution
    2. In the manual node selection:
    3. Adjust your filters to include only the Mycelium network
    4. Enter any node id
    5. If the node has Mycelium as a feature no validation error will be shown
    6. If the node doesn't have Mycelium as a feature validation error will be shown
  • Go to Dashboard

    1. In the deploy section, select any solution
    2. In the automated node selection:
    3. Adjust your filters to include the Mycelium and wireguard networks
    4. Enter node id == 259 and observe
    5. Validation error will be shown stating the the node doesn't support wireguard

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstrings
  • Screenshots/Video attached (needed for UI changes)

Copy link
Contributor

@0oM4R 0oM4R left a comment

Choose a reason for hiding this comment

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

partial review will continue tmw

packages/playground/src/utils/deploy_vm.ts Show resolved Hide resolved
}

class ZmachineLightNetwork {
//what is ValidateNested
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove this comment

packages/grid_client/src/primitives/nodes.ts Show resolved Hide resolved
packages/grid_client/src/modules/models.ts Show resolved Hide resolved
@@ -142,6 +142,7 @@ class MachineModel {
@Expose() @IsInt() @IsOptional() solutionProviderId?: number;
@Expose() @IsString() @IsOptional() zlogsOutput?: string;
@Expose() @IsString({ each: true }) @IsOptional() gpus?: string[];
@Expose() @IsString({ each: true }) @IsOptional() features?: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes we do as it might be used like this

Copy link
Contributor

Choose a reason for hiding this comment

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

As I mentioned before, I think we should have an enum for the possible values inside the array

Copy link
Contributor

Choose a reason for hiding this comment

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

can we use the feature type here instead of the string ?

…n AddMachine filters and moving getFeatures method to utils
@amiraabouhadid
Copy link
Contributor

amiraabouhadid commented Dec 10, 2024

was able to deploy micro vm with mycelium on node 168 , could not find other zos4 nodes
image
was able to successfully delete contract

@amiraabouhadid
Copy link
Contributor

amiraabouhadid commented Dec 10, 2024

node 259 doesn't always disappear from the node selector when i add wireguard
node 168 is still visible even when i select wireguard
image

@amiraabouhadid
Copy link
Contributor

Description

Supporting deployments on zos4 nodes from grid client and dashboard

Changes

  • Added a network light and machine light workloads
  • Adjusted workload types to contain the two newly added workloads
  • Added unit tests for the two new workload types
  • Added a ZNetworkLight primitive class to handle the creation of network light workload
  • Added a VMLightPrimitive primitive class to handle the creation of zmachine light workload
  • Updated the _createDeployment and create method to support zos4 deployments according to the node's features
  • Updated deployMerge and saveNetworks methods in TwinDeploymentHandler
  • Added getFeaturesFromFilters method in nodes and capacity module to set node's features according to the filters chosen by the user
  • Added extra filters in the FilterOptions class
  • Adjusted automated and manual node selection to consider features in filters
  • Added planetary, mycelium and wireguard filters to all solutions
  • Added a single_vm_zos4.ts script to deploy on a zos4 node
  • Added deployment_flow.md

Related Issues

Tested Scenarios

  1. Node 168 which is a zos3 node
    Screenshot from 2024-11-17 15-27-45
  2. Node 255 which is a zos4 node
    Screenshot from 2024-11-17 15-27-20
  • Go to Dashboard

    1. In the deploy section, select any solution
    2. In the automated node selection:
    3. Adjust your filters to include only the Mycelium network
    4. Reload the nodes.
    5. Observe that both zos4 and zos3 nodes are listed.
    6. Deploy on any node and it will pass (note: zos4 node used is 255)
    7. Observe Deployment list
    8. Navigate to Contracts list

Screenshot from 2024-11-17 15-50-10

Screenshot from 2024-11-17 15-50-58

Screenshot from 2024-11-17 15-52-40

  • Go to Dashboard

    1. In the deploy section, select any solution
    2. In the manual node selection:
    3. Adjust your filters to include only the Mycelium network
    4. Enter any node id and observe
  • Go to Dashboard

    1. In the deploy section, select any solution
    2. In the automated node selection:
    3. Adjust your filters to include the Mycelium and wireguard networks
    4. Enter node id == 259 and observe

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstrings
  • Screenshots/Video attached (needed for UI changes)

observe what ? in the tested scenarios please specify expected result

Copy link
Contributor

@0oM4R 0oM4R left a comment

Choose a reason for hiding this comment

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

partial review will continue reviewing the other files

packages/grid_client/docs/deployment_flow.md Show resolved Hide resolved
packages/grid_client/scripts/single_vm_zos4.ts Outdated Show resolved Hide resolved
packages/grid_client/src/high_level/base.ts Outdated Show resolved Hide resolved
packages/grid_client/src/helpers/types.ts Outdated Show resolved Hide resolved
packages/grid_client/src/high_level/base.ts Outdated Show resolved Hide resolved
packages/grid_client/src/modules/capacity.ts Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

i don't think that we are handling the case if the worker or master has unsupported features; we need to test this case

@@ -142,6 +142,7 @@ class MachineModel {
@Expose() @IsInt() @IsOptional() solutionProviderId?: number;
@Expose() @IsString() @IsOptional() zlogsOutput?: string;
@Expose() @IsString({ each: true }) @IsOptional() gpus?: string[];
@Expose() @IsString({ each: true }) @IsOptional() features?: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

As I mentioned before, I think we should have an enum for the possible values inside the array

packages/grid_client/src/modules/models.ts Show resolved Hide resolved
@maayarosama
Copy link
Contributor Author

node 259 doesn't always disappear from the node selector when i add wireguard node 168 is still visible even when i select wireguard image

  • node 168 isn't a zos4 node and it supports wireguard, please check its features here

  • As for node 259, I couldn't reproduce on automated nor manual filter, please give some more info
    Screenshot from 2024-12-11 13-11-44

  • Find zos4 nodes here

@maayarosama
Copy link
Contributor Author

Description

Supporting deployments on zos4 nodes from grid client and dashboard

Changes

  • Added a network light and machine light workloads
  • Adjusted workload types to contain the two newly added workloads
  • Added unit tests for the two new workload types
  • Added a ZNetworkLight primitive class to handle the creation of network light workload
  • Added a VMLightPrimitive primitive class to handle the creation of zmachine light workload
  • Updated the _createDeployment and create method to support zos4 deployments according to the node's features
  • Updated deployMerge and saveNetworks methods in TwinDeploymentHandler
  • Added getFeaturesFromFilters method in nodes and capacity module to set node's features according to the filters chosen by the user
  • Added extra filters in the FilterOptions class
  • Adjusted automated and manual node selection to consider features in filters
  • Added planetary, mycelium and wireguard filters to all solutions
  • Added a single_vm_zos4.ts script to deploy on a zos4 node
  • Added deployment_flow.md

Related Issues

Tested Scenarios

  1. Node 168 which is a zos3 node
    Screenshot from 2024-11-17 15-27-45
  2. Node 255 which is a zos4 node
    Screenshot from 2024-11-17 15-27-20
  • Go to Dashboard

    1. In the deploy section, select any solution
    2. In the automated node selection:
    3. Adjust your filters to include only the Mycelium network
    4. Reload the nodes.
    5. Observe that both zos4 and zos3 nodes are listed.
    6. Deploy on any node and it will pass (note: zos4 node used is 255)
    7. Observe Deployment list
    8. Navigate to Contracts list

Screenshot from 2024-11-17 15-50-10
Screenshot from 2024-11-17 15-50-58
Screenshot from 2024-11-17 15-52-40

  • Go to Dashboard

    1. In the deploy section, select any solution
    2. In the manual node selection:
    3. Adjust your filters to include only the Mycelium network
    4. Enter any node id and observe
  • Go to Dashboard

    1. In the deploy section, select any solution
    2. In the automated node selection:
    3. Adjust your filters to include the Mycelium and wireguard networks
    4. Enter node id == 259 and observe

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstrings
  • Screenshots/Video attached (needed for UI changes)

observe what ? in the tested scenarios please specify expected result

Adjusted test scenarios with expected result

…zmachine light in one condition to get rid of redundant code
@maayarosama maayarosama requested a review from 0oM4R December 15, 2024 09:42
packages/grid_client/src/primitives/nodes.ts Outdated Show resolved Hide resolved
packages/grid_client/src/primitives/vm.ts Outdated Show resolved Hide resolved
@maayarosama maayarosama requested a review from 0oM4R December 16, 2024 12:16
Copy link
Contributor

@0oM4R 0oM4R left a comment

Choose a reason for hiding this comment

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

node 249 is not listed in the node auto selector but it is valid on manual

image

@maayarosama
Copy link
Contributor Author

node 249 is not listed in the node auto selector but it is valid on manual

image

Node 249 isn't a valid node as it has zero vcores, so the automated selection is right. After some debugging, I figured out that the manual selection doesn't validate cru, mru and sru. For some reason this switch isn't entered. As This's not related to my pr please open a new issue

@maayarosama maayarosama requested a review from 0oM4R December 18, 2024 10:41
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.

4 participants