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

draft: convert DeviceShifuBase data structure #594

Closed
wants to merge 1 commit into from

Conversation

SuperAayush
Copy link
Contributor

@SuperAayush SuperAayush commented May 2, 2023

What this PR does / why we need it:

This PR changes the DeviceShifuBase data structure from single EdgeDevice to a list type of EdgeDevice, in the EdgeDevice struct I have changed the Spec to list type.

Line :

Spec EdgeDeviceSpec `json:"spec,omitempty"`

After making this change I am unable to locate the file where I have to make changes in order to make the EdgeDeviceSpec work as a list.

In examples/httpDeviceShifu/deployment/http-edgedevice.yaml I have added a device in the array format.

This PR points to the issue #538

How is this PR tested

  • unit test
  • e2e test
  • other (please specify)

@tomqin93
Copy link
Contributor

tomqin93 commented May 3, 2023

Hi @SuperAayush , Thank you for creating this draft PR!
Here is a list for items that you need to do in order to make the change:

  1. run make tag VERSION=nightly to trigger build and automatically re-generate the go files
  2. update each deviceShifu that uses the EdgeDeviceSpec to read from the 0th element
  3. update example's deployment YAML for edgedevice

Feel free to let us know if you are facing any issues

@SuperAayush
Copy link
Contributor Author

SuperAayush commented Jun 8, 2023

Following up on this:
After visiting every deviceShifu that uses the EdgeDeviceSpec and make it read from 0th element:
There are two ways that are coming to my mind:
For file-

Spec: v1alpha1.EdgeDeviceSpec{

  1. Either we can add CustomMetadata as a field in the Spec object, something like this:
Spec: v1alpha1.EdgeDeviceSpec{
                    Address:  &addr,
                    Protocol: (*v1alpha1.Protocol)(unitest.ToPointer(string(v1alpha1.ProtocolHTTP))),
                    CustomMetadata: [],
                },
  1. Or making it read to the list type, something like this:
Spec: []v1alpha1.EdgeDeviceSpec{
                    Address:  &addr,
                    Protocol: (*v1alpha1.Protocol)(unitest.ToPointer(string(v1alpha1.ProtocolHTTP))),

},

Both of them are showing error 🤔:

  • For the first one error is:
    expected type, found ','

  • For the second one there are multiple errors

cc - @kris21he @BtXin any reviews on this?

@BtXin
Copy link
Contributor

BtXin commented Jun 9, 2023

@SuperAayush No worries. We are going to release a detailed design on this in the following weeks. You can follow the design to make the change.

@SuperAayush
Copy link
Contributor Author

@SuperAayush No worries. We are going to release a detailed design on this in the following weeks. You can follow the design to make the change.

Can I help in structuring the design by any means?

@SuperAayush
Copy link
Contributor Author

Following the conversation with @tomqin93, I am closing this PR and will go for a new one once the design is out!!

@SuperAayush SuperAayush closed this Jun 9, 2023
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