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

Adding container testing #1085

Merged
merged 10 commits into from
Jan 21, 2021
Merged

Adding container testing #1085

merged 10 commits into from
Jan 21, 2021

Conversation

angelnu
Copy link
Contributor

@angelnu angelnu commented Jan 20, 2021

Description

This container adds support to test the deployment and start of the RaspberryMatic container. Currently is just testing that the container comes up but in future this might be extended with any additional testcases.

Related Issue

#786

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Alternate Designs

Manual test

Possible Drawbacks

Add a few minutes to the CI

Verification Process

CI working sucesfuly

Release Notes

NA - this is quality assurance item, not a visible feature.

Contributing checklist

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING and LICENSE document.
  • I fully agree to distribute my changes under Apache 2.0 license.

@angelnu
Copy link
Contributor Author

angelnu commented Jan 20, 2021

@jens-maus - sorry for the previous noise in the old PR while I was (slowly) working on this.

I had to ensure that forks would build and push containers again (in case the secret for upload is present) so I could test on my own. Now it should work for you and forks.

Since PRs do not have access to the secret you will not be able to see the regression result until you merge: please check my fork actions to see the result there.

Should we have a wiki page or a document in git to describing how to set your dev environment including enabling github actions? I could also contribute a Dockerfile.dev for https://code.visualstudio.com/docs/remote/containers so contributors would have a ready to use container with exportroot and any other build dependencies: see https://developers.home-assistant.io/docs/development_environment/

@angelnu
Copy link
Contributor Author

angelnu commented Jan 21, 2021

@jens-maus
Copy link
Owner

Thanks @angelnu for this PR. I am, however, not quite sure if a straight integration of this PR is really a good thing ATM. While I like the general idea of extending the CI with automated tests, I am not sure if the general CI workflow is the right place for it. You know that this workflow (and the nightly snapshot one) already takes quite a few hours until it is finished and I am still happy that they don't timeout in the GitHub runners (which have a max 6 hours timeout).

Wouldn't it be better to put this additional CI testing in a separate workflow just for this purpose? At least as long as we have nothing more than a simple "it's up and running" test, this should IMHO suffice for the time being. And as soon as we have more automated tests integrated (e.g. device learning, webui testing, rega script testing, etc.) we could then think about moving these tests back to the general "CI" workflow which is run with every push.

Or what is your opinion?

Should we have a wiki page or a document in git to describing how to set your dev environment including enabling github actions? I could also contribute a Dockerfile.dev for https://code.visualstudio.com/docs/remote/containers so contributors would have a ready to use container with exportroot and any other build dependencies: see https://developers.home-assistant.io/docs/development_environment/

Yes, more documentation and especially development documentation is highly appreciated! And as you are the "Docker specialist" here, I would say: Go ahead!

I am, btw, especially interested in getting a "RapsberryMatic" homeassitant addon implemented, but simply lacked the time yet to work on that topic. But if we could - now that we have the docker in general - work together on such a homeassistant addon of RaspberryMatic, that would be great! Would you be interested?

@angelnu
Copy link
Contributor Author

angelnu commented Jan 21, 2021

you are right that the the CI is already painful long enough... Other CIs I am familiar with allow to trigger a workflow from another so we could split in more managable smaller chunks. I do not know how much GitHub actions has in this regard but I can investigate.

My proposal is we keep a quick test that runs on each PR/commit so we know it is not breaking the basics (something that does not add more than 5 minutes) and a long full test testing each latest snapshot during the night. If you agree then I would propose merging and I would add a cronjob workflow skeleton for the full regression in a following CI.

Yes, more documentation and especially development documentation is highly appreciated! And as you are the "Docker specialist" here, I would say: Go ahead!

Ok, will add :-) I tend to prefer keeping dev documentation in git (instead of wiki) so it is aligned with the actual code. Ok?

I am, btw, especially interested in getting a "RapsberryMatic" homeassitant addon implemented, but simply lacked the time yet to work on that topic. But if we could - now that we have the docker in general - work together on such a homeassistant addon of RaspberryMatic, that would be great! Would you be interested?

I have experiences writing Home Assistant Core addons but not fo the underlying OS. So which type of addon did you have in mind? Most likely you mind running the new Raspberrymatic OCI in Home Assistant OS, right?

@jens-maus
Copy link
Owner

jens-maus commented Jan 21, 2021

My proposal is we keep a quick test that runs on each PR/commit so we know it is not breaking the basics (something that does not add more than 5 minutes) and a long full test testing each latest snapshot during the night. If you agree then I would propose merging and I would add a cronjob workflow skeleton for the full regression in a following CI.

That's fine with me.

Yes, more documentation and especially development documentation is highly appreciated! And as you are the "Docker specialist" here, I would say: Go ahead!

Ok, will add :-) I tend to prefer keeping dev documentation in git (instead of wiki) so it is aligned with the actual code. Ok?

Also good. Potentially you could simply reuse the DEVELOPMENT.md in the top-level dir of the repo and add your information there.

I am, btw, especially interested in getting a "RapsberryMatic" homeassitant addon implemented, but simply lacked the time yet to work on that topic. But if we could - now that we have the docker in general - work together on such a homeassistant addon of RaspberryMatic, that would be great! Would you be interested?

I have experiences writing Home Assistant Core addons but not fo the underlying OS. So which type of addon did you have in mind? Most likely you mind running the new Raspberrymatic OCI in Home Assistant OS, right?

Exactly. My plan/idea is to have a home assistant addon that is similar to the current/limited "HomeMatic OCCU Addon" they have created themselves (https://github.com/home-assistant/addons/tree/master/homematic). And then use this "RaspberryMatic Addon" in their home assistant OS (https://github.com/home-assistant/operating-system) which is also based on buildroot, like RaspberryMatic. There we could then integrate the kernel module loading and hopefully the homeassistant developers accept the PR then...

So if you could take care of the first basics for a home assistant addon, this would be great (best would be IMHO to create this addon as another RaspberryMatic "platform" as part of this github project). And I could then prepare the PR for the home assistant operating system. That would be again a great teamwork IMHO :) What do you think?

@angelnu
Copy link
Contributor Author

angelnu commented Jan 21, 2021

Good, will add to DEVELOPMENT.md

On Home Assistant - I only use the Home Assistant Core as Helm (https://artifacthub.io/packages/helm/k8s-at-home/home-assistant). There I added a couple of features and could propose the Raspberrymatic but IMO there is no advantage compared to deploying in 2 Helm charts.

I have no experience with the Home Assistant OS (beyond having deployed to a friend) but I could take a look what it would take. Do you have an issue to document this feature where I can add what I find.

@jens-maus
Copy link
Owner

On Home Assistant - I only use the Home Assistant Core as Helm (https://artifacthub.io/packages/helm/k8s-at-home/home-assistant). There I added a couple of features and could propose the Raspberrymatic but IMO there is no advantage compared to deploying in 2 Helm charts.

I understand that there is no real advantage if you can start RaspberryMatic as a docker aside a Home Assistant Docker and just interconnect between them. That's of course not what I am looking for.

I have no experience with the Home Assistant OS (beyond having deployed to a friend) but I could take a look what it would take. Do you have an issue to document this feature where I can add what I find.

Well, the idea is to prepare a PR for the Home Assistant OS (https://github.com/home-assistant/operating-system) proposing an integration of the necessary kernel drivers (eq3_char_loop, raw_uart, hb-rf-usb/hb-rf-eth) and then also work on a "RaspberryMatic Home Assistant Addon" which more or less works like existing "OCCU Addon" (https://github.com/home-assistant/addons/tree/master/homematic) but then use the RaspberryMatic docker image instead of trying to replicate what the OCCU HomeAssistant Addon tries to achieve by doing the same like RaspberryMatic internally does already...

@angelnu
Copy link
Contributor Author

angelnu commented Jan 21, 2021

OCCU HomeAssistant Addon tries to achieve by doing the same like RaspberryMatic internally does already...

As I was trying to use the OCCU directly myself I know how hard it to stay current with all you do in Raspberrymatic. So yes, it makes sense and the HA OS is the easiest way to use HA compared to advanced (and complex) K8S.

I do not have use of it myself but I want to see the two projects I use improving so I will see if I can prepare the PR.

BTW: another area I keep in my backburner to contribute to is the Homematic adapter in HA to adopt the new design (no config files) approach. And maybe get some of Rasoberrymatic features such Dutty-Cycle or signal strength reported to Homematic.

EDIT:
What about we merge this and move into dedicated features. I have:

  • extend development instruction
  • create workflow for long running test
  • document K8S usage
    • add official Helm chart
  • PR to integrate into HA OS

@jens-maus
Copy link
Owner

OCCU HomeAssistant Addon tries to achieve by doing the same like RaspberryMatic internally does already...

As I was trying to use the OCCU directly myself I know how hard it to stay current with all you do in Raspberrymatic. So yes, it makes sense and the HA OS is the easiest way to use HA compared to advanced (and complex) K8S.

Indeed! That's why I think it would be great to have the kernel drivers integrated in HA OS and also a RaspberryMatic Addon for it which will then utilize the kernel drivers and start the dockerized RaspberryMatic on HA OS.

I do not have use of it myself but I want to see the two projects I use improving so I will see if I can prepare the PR.

That would really be appreciated! 👍

BTW: another area I keep in my backburner to contribute to is the Homematic adapter in HA to adopt the new design (no config files) approach. And maybe get some of Rasoberrymatic features such Dutty-Cycle or signal strength reported to Homematic.

That also sounds great and should be quite easily doable! If possible, I can assist of course.

EDIT:
What about we merge this and move into dedicated features. I have:

  • extend development instruction
  • create workflow for long running test
  • document K8S usage
    • add official Helm chart
  • PR to integrate into HA OS

That sounds't great for a starter. So, ok. I will the merge this PR and see how good it performs. Then I will see if I can work on preparing a PR for integrating the kernel drivers in HA OS while you prepare the template/start for a HA OS Addon integration that starts the dockerized RaspberryMatic as a Addon.

@jens-maus jens-maus merged commit 542520f into jens-maus:master Jan 21, 2021
@angelnu
Copy link
Contributor Author

angelnu commented Jan 22, 2021

there seems to give some delay between uploading the container until it can be downloaded - if you retry it works. We would need to add some delay I expect

@jens-maus
Copy link
Owner

Or use the artifact tgz together with docker load

@angelnu
Copy link
Contributor Author

angelnu commented Jan 22, 2021

Good idea... That will also work for PRs or devs not setting the secret. Will add this evening.

@angelnu angelnu deleted the ci_test branch January 22, 2021 10:34
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