-
Notifications
You must be signed in to change notification settings - Fork 947
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 Docker and container registry support #1132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without having actually tried it but only reviewed it, it looks good.
However you need to add documentation, so that users know it exist.
If I looked right you need me to add a user/password to secrets (if my powers allow it) anything else?
Added DOCKER_USERNAME / DOCKER_PASSWORD to secrets. Username is janiversen (which you need for documentation). Can you make the action so I e.g. can create docker images with some of the examples ? |
@janiversen the only thing required was the creation of those credentials. Thank you for adding them to the secrets. Nothing else is required on your end. WRT documentation, one thing is updating the readme, which I'm happy to do.
I'm not sure what you mean here. Do you mean adding comments to the YML files where those values are used?
I don't understand what you mean. Can you please clarify. Thanks |
You need to document in the README that there are a docker image available, where and how to use it. |
I was thinking of having e.g, docker images with: a standard server, a repl server and a forwarder. However I am unsure how a user could effectively configure these images. |
Users can create a The example I showed is this: pymodbus-server:
container_name: pymodbus-server
image: serroba/pymodbus:v3.0.0dev5
command: ["./examples/server_sync.py"] in this case, the container is spin up and we run the sync server. A different person could add the REPL in place instead. |
your example of compose is good, but that is what needs to be documented. |
CI does not like your text:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you @janiversen |
What?
This PR adds support to create docker images locally against the current working environment
Additionally, this PR is adding the required scripts to automatically create docker images and publish them to public repositories -Docker Hub and GitHub Container Registry (ghcr), as a package.
When publishing to Docker Hub, in this PR, we are publishing images built for
linux/amd64
andlinux/arm64
. Additional platform can be easily expanded if there is more need for that.Why?
This can greatly accelerate the exploration of this library. As an external user, the ability to interact with the library and potentially spin up servers and play with the clients can drastically reduce the need to learn the more lower level aspects of the library. This also makes very easy the ability to import the library in a larger project using
docker-compose
.Additionally, this is a continuation of the conversation I had with @janiversen a few weeks ago: 4b57def#r86307726
Testing/Proof
I tested this against my own fork. I tried several times until I got it working.
The GH actions can be seen here:
https://github.com/serroba/pymodbus/actions
Of particular interest:
Container Images Registries
Docker Hub
To test proper integration with Docker Hub, I created my own repository with the equivalent of this project. The images can be seen on: https://hub.docker.com/repository/docker/serroba/pymodbus
GitHub Container Registry
To test this, the integration is native, so no need to do anything outside this PR here: https://github.com/serroba/pymodbus/pkgs/container/pymodbus
Examples and usage with Docker Compose:
I have forked an existent public repository https://github.com/huntabyte/tig-stack and the now created image using this PR
Example:
Things are working as expected:
Also, we can just things directly in the container:
Or enter the REPL using the images: