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

Clarify Update on Docker HA Core install #13542

Merged
merged 6 commits into from
Jun 26, 2020

Conversation

fhoekstra
Copy link
Contributor

@fhoekstra fhoekstra commented May 21, 2020

Proposed change

I could not find any clear instructions in the docs on how to update a Docker install of Home Assistant Core. It seems to be recommended over a virtualenv install, but there are no instructions on how to update your install, and even a conflicting run command between the systemd service file and the install docs.
I want to save others the hassle of figuring this out.
If I put anything in a wrong place, or if what I figured out is incorrect, please tell me. I do believe this information should be in the documentation.

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

  1. I consolidated the docker run command between Docker install and Docker systemd pages. Both now use homeassistant/home-assistant:stable
  2. I added timezone binding (/etc/localtime). I am not sure if this is recommended, but it works for my install. Please confirm?
  3. I added instructions on how to update a Docker install in the Docker installation page. Just like the update information is included in the virtualenv install page. I put it under Linux since I am not sure who this would work on other platforms. Maybe this should be structured differently?
  4. I added the update procedure for HA Core running in a Docker as a systemd service on the same page as well, to demonstrate that whether you are running HA as a service impacts the way you should stop and start it and that the update script is not universal. Do you agree with my placement of the info in the update info instead of in the systemd page?
  • Link to parent pull request in the codebase:
  • Link to parent pull request in the Brands repository:
  • This PR fixes or closes issue:

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

@probot-home-assistant probot-home-assistant bot added the current This PR goes into the current branch label May 21, 2020
@@ -66,7 +66,7 @@ After=docker.service
[Service]
Restart=always
RestartSec=3
ExecStart=/usr/bin/docker run --name=home-assistant-%i -v /home/%i/.homeassistant/:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant
ExecStart=/usr/bin/docker run --name=home-assistant-%i -v /home/%i/.homeassistant/:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant:stable
Copy link
Member

Choose a reason for hiding this comment

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

We should remove them altogether, as the proper way to handle this is using Docker itself, not systemd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Valid point. I didn't know that was built into Docker.

  1. Shall I make an issue for that and still push these for now? This change helped me get my install working.
  2. Shall I add a note that Docker has its own restart policy and this is preferred? Link to the Docker docs maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I say to include --restart=always in the docker run command? With this link: https://docs.docker.com/config/containers/start-containers-automatically/

Copy link
Member

Choose a reason for hiding this comment

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

Yes that is it.

Comment on lines 32 to 36
If you are running your Home Assistant Core Docker as an autostarted service, then you should use the relevant commands to stop it, for example for systemd:
```bash
docker pull homeassistant/home-assistant:stable
systemctl stop home-assistant@USERNAME
systemctl start home-assistant@USERNAME
Copy link
Member

Choose a reason for hiding this comment

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

I don't get the username part?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is the naming convention for systemd services: https://www.home-assistant.io/docs/autostart/systemd/#next-steps

@frenck frenck added the in-progress This PR/Issue is currently being worked on label May 21, 2020
@fhoekstra
Copy link
Contributor Author

Okay, so perhaps it is better to do either or both of the following:

  1. Add a 'HA Core in Docker container' part (either paragraph or page) to the autostart page, and say there how the docker run command should be changed, with a link.
  2. Add this same info to the Docker installation page.

@fhoekstra
Copy link
Contributor Author

I also added some 'Core' to mentions of Home Assistant.

@frenck
Copy link
Member

frenck commented Jun 1, 2020

The autostart documentation has been removed. Please rebase the PR to get rid of the changes made to that (or revert them).

Adding the restart=always to the Docker set up is a good replacement.

@fhoekstra
Copy link
Contributor Author

fhoekstra commented Jun 2, 2020

Oof that was not pretty. I haven't really used git rebase outside a tutorial, but I verified with a git diff against an up-to-date current that I now pushed the proper version to this branch.

So you also agree on the change of mapping /etc/localtime instead of the New York string @frenck ? Only in the Linux instruction so far, haven't been able to test on Raspbian.

@frenck
Copy link
Member

frenck commented Jun 22, 2020

The mapping of local time seems ok. This PR however, has an issue now, with all kinds of unrelated commits. This needs to be cleaned up first 👍

@fhoekstra
Copy link
Contributor Author

@frenck better?

@frenck
Copy link
Member

frenck commented Jun 23, 2020

No, if you look here: https://github.com/home-assistant/home-assistant.io/pull/13542/commits

You'll see all kind of commits that are not yours. You need to rebase it not merge branches.
I think the easiest right now is to create a new branch, cherry-pick your changes force put it onto this branch.

@fhoekstra fhoekstra force-pushed the docker_clearer_update branch from a010daa to 3793de9 Compare June 24, 2020 09:33
@fhoekstra
Copy link
Contributor Author

fhoekstra commented Jun 24, 2020

Thanks for your repeated help, I'm learning advanced git here 😄 . I think I've done what you just said now @frenck .

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @fhoekstra 👍

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Oh noticed one little thing just before I wanted to hit merge:

Our images have a init system onboard, so the --init isn't needed.

source/_docs/installation/docker.markdown Outdated Show resolved Hide resolved
source/_docs/installation/docker.markdown Outdated Show resolved Hide resolved
fhoekstra and others added 2 commits June 24, 2020 19:16
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
@fhoekstra
Copy link
Contributor Author

Accepted, do you like being @'ed @frenck ?

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @fhoekstra! 👍 🎉

@frenck frenck merged commit a7245e3 into home-assistant:current Jun 26, 2020
@probot-home-assistant probot-home-assistant bot removed the in-progress This PR/Issue is currently being worked on label Jun 26, 2020
prystupa pushed a commit to prystupa/home-assistant.io that referenced this pull request Jun 29, 2020
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
current This PR goes into the current branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants