Adds cloud-init systemd HOWTO for lbrycrd on DigitalOcean #45
No reviewers
Labels
No labels
Accepted
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
Epic
good first issue
hacktoberfest
help wanted
icebox
In Review
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-docker#45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cloud-init"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi there!
I wanted to have an automated and self-contained script for deploying lbrycrd to docker on DigitalOcean, so I created this little howto.
I utilized the main Dockerfile in this repo as a base, but I have made several changes (mostly removed all of the TODOs as they were not necessary for this use-case.) Instead of replacing the original Dockerfile I chose to just create another directory for mine, as it's a different strategy for deployment.
If this gets merged, there is some cleanup that needs to occur afterward. The README links to my own docker-hub image, but this can be setup under an lbry account so it has a more official home. The Dockerfile included is the exact same one used to create the current image on docker-hub.
Without having reviewed the container yet can you explain the reason you can't just go with a docker library official image as your base? We really try to avoid adding technical debt/complexity as much as possible which keeps maintainability high.
Okay after reviewing your commit, I like the direction that you're taking with the addition of the README.md for a recipe for deploying this on DigitalOcean but I disagree with how the Dockerfile seems to regress from the intended functionality of the main Dockerfile and would want to know the benefits of switching to a less stateless form factor.
I'm looking forward to more commits and replies, but I'm not sure we need another Dockerfile for the same function. I think that the TODO's need removed and converted into real GitHub issues that can get organized into the project management board if I haven't done so already.
To give some perspective on some of the design choices that I'd made at the time, the start.sh's goal is intended to offer the user the ability to set defaults with an externally injected config if they desire as well as allow them just to use environment variables and volumes. Ultimately this thing should function by default with zero user interaction aside from just copying and pasting commands because we want a liquid smooth deployment experience so that people can get testing their ideas immediately.
Thanks for the quick detailed response.
I'll see if I can rework what I have with your existing container. Does an image exist on the docker hub? I couldn't find it, if it does.
Some of the design changes to my Dockerfile were:
I'll see if I can rework what I have with your current container. Does an image exist on the docker hub? I couldn't find it if it does.
It's not been added to Docker hub, and I do however have access to put it there. Unfortunately, we ended up at a few blocking points the last time I had a moment to post the containers mainly that they won't build automatically without having to modify the Travis-CI.yml files for the upstream repositories. I was attempting to get the Dockerfiles accepted into the upstream repositories themselves so that when a new version is pushed it would build in the Travis-CI
I am aware of the number of layers being a bit high this was the initial 1.0 we're eventually going to optimize significantly. My priority was stateless and maintainability. Then I was going to re-double down on making certain security is top notch etc and expand on examples.
There's a good number of priorities laid out in the boards but I'm flexible and 100% interested in any other contributors its great having external interest.
I realize now your first question was in regards to the docker host image, not the container image. So I'll explain a bit my thoughts.
I think that the "container distros" like CoreOS, Fedora Atomic, Rancher are great, and if you're using Kubernetes, even better. However, they are quite difficult to work with if you are a novice user. Ubuntu is much more well understood. If a user needs to edit the config file, they need a real OS, that has a package manager, so they can install Emacs. It needs state. This is the exact opposite of what you want in the enterprise worlds, where you treat every thing as "cattle". But in this case I think we want to grow a decentralized network of users running lbrycrd. That means a lot of users running single nodes. The extra hurdles needed to learn about container OSes is an extra burden to users.
Systemd is great at configuring single nodes. It's baked into every linux distro out there (pretty much). It has a really consistent interface and good automation support. One of the nice things about containers is it frees people up to deploy them however they want. So systemd isn't for everyone. That's why I seperated this from the other directory, as I didn't care to use docker-compose. Perhaps this README should just live on a wiki? That way we can focus this repository just on the image itself.
Great first PR and welcoming more in the future but ideally use the mainline container as there's no sense in maintaining multiple containers that attempt to achieve the same objectives.
@ -0,0 +57,4 @@
--mount type=volume,source=lbrycrd-data,target=/data \
--mount type=bind,source=/etc/lbry/lbrycrd.conf,target=/etc/lbry/lbrycrd.conf \
--hostname lbrycrd \
-e RUN_MODE=default \
This won't work if you don't include the start.sh which was included in the main Dockerfile
I'll leave it up to @EnigmaCurry as to whether or not you wish to modify this PR or submit a new one.
I would need to modify start.sh to not create the config file, in order to be compatible with what I have. I think it is more configurable to allow the user to specify the whole config file rather than use individial environment variables for each of the items. So I can't use your container as is. Also it's weird that the config file lives in the data volume, but is overwritten each time. So it may appear that you can edit the config in the data directory, but if you do, it will just be overwritten the next time start.sh runs.
@ -0,0 +57,4 @@
--mount type=volume,source=lbrycrd-data,target=/data \
--mount type=bind,source=/etc/lbry/lbrycrd.conf,target=/etc/lbry/lbrycrd.conf \
--hostname lbrycrd \
-e RUN_MODE=default \
oh yes I mistakenly left the RUN_MODE environment variable there, from before I ripped out start.sh. It does work though, just the variable is not used.
So to follow up on this last comment @EnigmaCurry the
start.sh
file should only edit if there's an alternative setting. You could use sed, grep, and awk to achieve these goals. It's okay albeit not ideal to miss a few config settings; however ideally you want to set some defaults that work.My original goal was to abstract a few default settings to a
RUN_MODE
env-var which would pre-set a few things to function in various modes like Regtest and so on.Pull request closed