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

Add opcua mapper #4

Merged
merged 5 commits into from
Feb 8, 2021
Merged

Add opcua mapper #4

merged 5 commits into from
Feb 8, 2021

Conversation

sailorvii
Copy link
Collaborator

The issue is at kubeedge/kubeedge#2461.

This mapper uses open source code github.com/gopcua/opcua as the driver.
The code framework refers to the modbus mapper.
It has been tested with simulated opcua server & device: https://python-opcua.readthedocs.io/en/latest/.

@kubeedge-bot kubeedge-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 8, 2021
@sailorvii
Copy link
Collaborator Author

@fisherxu @luogangyi
Please help to review, thanks.


COPY ./opcua kubeedge/
COPY ./config.yaml kubeedge/
COPY ./ca /ca
Copy link
Member

Choose a reason for hiding this comment

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

It could be better if provide a tool to generate certs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for your comment. The cert is a demo. It depends on the external opcua server.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should provide a tool to generate them although it is a demo.

Copy link
Member

Choose a reason for hiding this comment

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

We can remove it from dockerfile/image, and mount into contaier if needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The customer could package it without any file or with the files for them own. It depends on the authentication method the opcua server requires. This folder is an example that the customer could refer to.

Copy link
Member

@fisherxu fisherxu left a comment

Choose a reason for hiding this comment

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

Thanks for the new Mapper, and please remove the binary :)

Makefile Outdated
sudo docker build -t opcuamapper:v1.0 ./pkg/opcua

clean:
rm -f ./pkg/modbus/modbus ./pkg/opcua/modbus
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
rm -f ./pkg/modbus/modbus ./pkg/opcua/modbus
rm -f ./pkg/modbus/modbus ./pkg/opcua/opcua

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.


COPY ./opcua kubeedge/
COPY ./config.yaml kubeedge/
COPY ./ca /ca
Copy link
Member

Choose a reason for hiding this comment

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

We can remove it from dockerfile/image, and mount into contaier if needed

@@ -0,0 +1 @@
testpass
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's the password file. The original design is that: define the username & password in the device instance yaml and pass it by the configmap. I think it's dangerous and change to use the password file which is in local directory.

Certfile: "/home/wei/ca/clientcert.pem",
Keyfile: "/home/wei/ca/clientkey.pem",
RemoteCertfile: "/home/wei/ca/servercert.pem",
*/
Copy link
Member

Choose a reason for hiding this comment

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

We can remove it if unnecessary

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry, I'll refine the test. There're several test cases in one test function.

@fisherxu
Copy link
Member

fisherxu commented Feb 8, 2021

/lgtm
/approve

@kubeedge-bot kubeedge-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 8, 2021
@kubeedge-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fisherxu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot kubeedge-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 8, 2021
@fisherxu
Copy link
Member

fisherxu commented Feb 8, 2021

@sailorvii Let's fix any issues in follow-up PRs.

@kubeedge-bot kubeedge-bot merged commit 810b19a into kubeedge:main Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants