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

Docker Support #71

Merged
merged 6 commits into from
Feb 14, 2019
Merged

Docker Support #71

merged 6 commits into from
Feb 14, 2019

Conversation

alrs
Copy link
Contributor

@alrs alrs commented Feb 14, 2019

I took a look at removing the PEP 576 type annotations from the codebase so that it could run on Debian Stable or on a Raspberry Pi, and saw that that it is used extensively. Type annotations require Python 3.6, both Debian and Raspbian in their stable releases only support Python 3.5.

This PR adds a docker Makefile recipe to build a Docker container for upload-scripts that runs Python 3.7.2, as provided by not-yet-stable Debian Buster.

@bogdans-telenav
Copy link

@alrs, thanks you saved me a couple of hours of reaserch. I was planning to add Docker support again to the scripts but first I would have had to learn how to do that.

@bogdans-telenav bogdans-telenav merged commit 4ef39a2 into kartaview:master Feb 14, 2019
@ToeBee
Copy link
Contributor

ToeBee commented Feb 19, 2019

So the make docker command works for me but when I try to run the next command it blows up. I am not (yet) very familiar with Docker so I'm having trouble figuring out the problem.

$ docker run -Pit osc-up osc_tools.py
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"osc_tools.py\": executable file not found in $PATH".```

Since it is complaining about $PATH, I tried adding the cloned repo location to my PATH environment variable before running this command but that didn't change anything. I am running docker 17.03.2. I'm wondering if there is some version difference in how to call it or something?

@ToeBee
Copy link
Contributor

ToeBee commented Feb 19, 2019

Well with the help of @iandees and @ianmcorvidae on the OSM US Slack channel I got it working. That first command does not seem to be necessary. The existing command also seems to require the images you want to upload to be placed in the images subdirectory of this repo which is not ideal since I have a couple terabytes of photos on a separate partition. I ended up using this command:

docker run -Pit --mount type=bind,source="$(pwd)",target=/opt/osc -v /path/to/my/images/:opt/osc/images/ osc-up /opt/osc/osc_tools.py upload -p /opt/osc/images/

It seems like it would be better to bundle the scripts into the docker image instead of mounting them at runtime. Instead the location of the photos to upload could be mounted at runtime. I guess that would mean building a new docker image any time the scripts are updated. That doesn't seem like the end of the world though. I will try to play with this later. Might be a good excuse to get my feet wet with docker.

@ianmcorvidae
Copy link

An option that might be worth considering is Docker Hub's automated builds. Since those can trigger on every push, it'd make keeping a public image up to date very easy.

@alrs alrs deleted the docker branch February 20, 2019 17:08
@alrs
Copy link
Contributor Author

alrs commented Feb 20, 2019

@ToeBee For development use, you really don't want to bake the script into the container. @ianmcorvidae Docker Hub is, unfortunately, a somewhat terrible way to distribute software, unless you're rebuilding the images daily.

We're stuck using Docker just to run these scripts, because of the decision to develop against the latest version of Python 3 that isn't yet widely available. Hopefully no one will change the Dockerfile to use something other than Debian, and as Buster becomes stable the default Python in the container will eventually be a lot more conservative than it is right now. Once the world catches up and upload-scripts is using a more common version of Python, it will be no problem to use pip. Once that happens the Docker complexity won't be necessary anymore.

I'm not interested in running Slack, but I will start hanging out in the #osm-dev channel on irc.oftc.net. Even better: is there an email list for Openstreetcam development?

@mds08011 mds08011 mentioned this pull request Apr 23, 2019
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.

4 participants