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

update docs for Raspberry Pi Docker instructions #560

Merged
merged 2 commits into from
May 22, 2019

Conversation

tseho
Copy link
Contributor

@tseho tseho commented May 5, 2019

I updated the Raspberry Pi Docker instructions on docs/INSTALL.rst since they were outdated.

The most important change is to use FROM arm32v7/python:3.6-alpine instead of FROM arm32v7/python:3.6 because the image has been changed to alpine in #486.

@Erovia
Copy link

Erovia commented May 6, 2019

Since Docker now supports multi-arch images, separate Dockerfile for ARM builds is no longer necessary.
FROM python:3.7-alpine is perfectly usable for non-x86_64 architectures.

It'd be best, if the project provided official builds for at least arm32v7, too.

@tseho
Copy link
Contributor Author

tseho commented May 6, 2019

@Erovia Thanks for the info, I will look into it tomorrow and if you are right, I will update my PR with the appropriate documentation.

@acockburn
Copy link
Member

@tseho - thanks for this. Is your update still pending or shall I merge as is?

@tseho
Copy link
Contributor Author

tseho commented May 13, 2019

@acockburn I haven't tried yet, the test should be quick, I will launch it tonight and will get back to you asap.

@tseho
Copy link
Contributor Author

tseho commented May 13, 2019

@Erovia was right, there is no need to specify the arm32v7/python:3.7-alpine, python:3.7-alpine is working as it is on arm32v7.
I will update my PR accordingly.

@tseho
Copy link
Contributor Author

tseho commented May 15, 2019

@acockburn I updated it.

@Erovia
Copy link

Erovia commented May 15, 2019

@acockburn, do you think it would be possible the provide armhf builds of AppDaemon on your Docker Hub repo? It can be an automated build, with some extra work: docker/hub-feedback#1261

@acockburn
Copy link
Member

thanks @tseho

@Erovia - yes it would make sense to do this. I'll take a look when I have some spare time.

@acockburn acockburn self-assigned this May 21, 2019
@acockburn acockburn requested a review from Odianosen25 May 21, 2019 17:38
Copy link
Collaborator

@Odianosen25 Odianosen25 left a comment

Choose a reason for hiding this comment

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

It does work fine, though couldn't get mine to start, but the image was build without errors

@Odianosen25 Odianosen25 merged commit 33165a9 into AppDaemon:dev May 22, 2019
@tseho
Copy link
Contributor Author

tseho commented May 22, 2019

@Odianosen25 I'm sorry to hear that. I want to be sure it's working for everyone.

Can you provide more informations so I can try to reproduce the error ?
Which device ? Can you copy the docker build logs and docker logs when trying to start it ?

@Odianosen25
Copy link
Collaborator

Odianosen25 commented May 22, 2019

@tseho,

Well I am not sure where it messed up, as I am not a docker user, but had to check that it works.

So as I said it all built fine, but I think the issue is just my own system as my code needed psutil installed and it came up with

 -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=562 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/usr/local/include/python3.7m -c psutil/_psutil_common.c -o build/temp.linux-armv7l-3.7/psutil/_psutil_common.o
2019-05-22T10:13:05.454637382Z     unable to execute 'gcc': No such file or directory
2019-05-22T10:13:05.454665924Z     error: command 'gcc' failed with exit status 1
2019-05-22T10:13:05.454693319Z     ----------------------------------------
2019-05-22T10:13:05.491134099Z ERROR: Command "/usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-rlsmvt2b/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vjy_gd7w/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-rlsmvt2b/psutil/

This I wouldn't imagine affects others, so based on that didn't think there was any need stopping merging it.

If I was fluent in docker, maybe I can. But unfortunately I am not. So if you can point me in the right direction, that will be great.

I know for psutil to run, I had to run sudo apt-get install python3-dev. So I guess as that is missing in the image, I had this issue.

And its for the Raspberry Pi

Thanks

@tseho
Copy link
Contributor Author

tseho commented May 22, 2019

@Odianosen25,

Assuming the official docker image for appdaemon will support the multi-arch builds in the future, I will not recommend to change the original Dockerfile.

What I would do, if I were in your case, would be the following:

$ git clone https://github.com/home-assistant/appdaemon.git
$ cd appdaemon
$ docker build -t appdaemon .

Once the hack for building the official docker image on the arm32v7 arch is done,

Then, I would create a custom Dockerfile in another directory, eg: odianosen/Dockerfile:

# Here, we are reusing the arm32v7 build of the docker image previously created
FROM appdaemon:latest

RUN apk add python3-dev

Now, you can build/run the custom image like this :

$ docker build -t odianosen/appdaemon .
$ docker run --name=appdaemon -d -p 5050:5050 \
      --restart=always \
      -e HA_URL="<Your HA_URL value>" \
      -e TOKEN="<your TOKEN value>" \
      -e DASH_URL="http://$HOSTNAME:5050" \
      -v <your_conf_folder>:/conf \
      odianosen/appdaemon:latest

This is a specific use case, I don't think we should pollute the documentation with it 😉

@Odianosen25
Copy link
Collaborator

Thanks @tseho,

I agree with that, and that’s why I didn’t bother and merged.

Thanks for the update and kind regards

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.

5 participants