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 #103

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Docker support #103

wants to merge 17 commits into from

Conversation

faircopy
Copy link
Contributor

@faircopy faircopy commented Nov 5, 2017

Some things can possibly be improved, but it's a start.

  • Including Nginx may be redundant, since uWSGI can function as an HTTP server.
  • There's a patch included in this commit to modify some WhatManager commands that handle torrent clients, I could incorporate that into WhatManager and make this behavior an option.

I can make the Docker stuff a separate GitHub repo as well, let me know what you think.

@karamanolev
Copy link
Owner

@faircopy Docker support makes me very happy. Since I don't have the time to test this ATM, can you have some other people test it as well? Maybe people will see this here or you can recruit them in the forums. Another point - will you be able to make a Wiki page that's a guide for how to run this and how management becomes different?

@faircopy
Copy link
Contributor Author

faircopy commented Nov 5, 2017

@karamanolev Sure, I can ask people to give it a go. There's a detailed README included, which is where I thought to keep all the related information. I can move or copy that to the Wiki so people are able to edit it.

@karamanolev
Copy link
Owner

@faircopy If you think this is ready to go I can merge it now.

@casedefault
Copy link
Contributor

@karamanolev @faircopy I've just done a quick smoke test of this. Newly installed Docker for Mac, followed the instructions in the README to set it up. I've tested that the transmission instance is up and running and I can connect to it (using Transmission Remote GUI) and that the WM2 web interface is available and appears to work. But it's not connected to a RED user and I'm not going to download any torrents as this is just a quick test.

But I see no reason why I shouldn't try and migrate my 'production' set up over to this as it seems well thought out. I just need the time!

@faircopy
Copy link
Contributor Author

faircopy commented Nov 6, 2017

@karamanolev, I'd like to modify some of the Compose file based on @casedefault's recommendations and test it some more, so please don't merge yet.

@karamanolev
Copy link
Owner

@faircopy Just keep this thread updated and I'll merge it when you are.

This is done so that multiple stacks can be run in parallel on the same
host, e.g.:

- Production stack:

    docker-compose up -d

- Development stack:

    COMPOSE_PROJECT_NAME=dev docker-compose \
    -f docker-compose.yaml \
    -f docker-compose.dev.yaml \
    up -d

Port numbers would be defined in docker-compose.override.yaml and
docker-compose.dev.yaml to avoid conflict between the two stacks.
@LennyPenny
Copy link

Any update on its stability? Would love to switch to this

@faircopy
Copy link
Contributor Author

faircopy commented Mar 29, 2018

@LennyPenny I'll try and finish up over the weekend, this project's been haunting me for a long time now. 👻

I wouldn't recommend using it yet, there's redundancy in the configuration as well as the setup process. I've been refactoring the Compose definition according to the DRY principle, that part works fine.

The main obstacle is that I wanted to be able to scale Transmission using either docker-compose scale or docker service scale, as opposed to copy-pasting sections in the Compose definitions. The former doesn't seem to be possible, lacking a way to use persistent data volumes. The latter (Docker Swarm) would only work when used on a single node, volumes don't move across swarm nodes.

Todo

  • Come to a conclusion on the Transmission data volume issue.
    • If there isn't a sensible solution, include a script that generates a Compose file for Transmission stacks from a template, to avoid manual copy-paste.
  • Create separate base and configuration Compose files for WM2 and Transmission stacks, so the services can be used independently of each other.
    Done: WhatManager has its own Compose file, and so does each Transmission group.
  • Remove redundancies in Compose file and WM2 config files.
  • Automate the setup process, if it doesn't add too much complexity.
    Done: A lot of it is automated, these steps remain manual:
    • Create superuser
    • Add download location
    • Add Transmission instances
  • Fix app's Dockerfile to add application code as late as possible, to speed up development build times.
  • Move backup scripts to their own files from the README.
  • Update documentation.

@karamanolev
Copy link
Owner

@faircopy You're doing an amazing job. Please keep it up!

@faircopy
Copy link
Contributor Author

faircopy commented Apr 1, 2018

Sadly, Transmission instances can only be defined by having the actual service definitions repeated in the Compose file. I've hacked together a script in POSIX Shell to automate this.

Sharing configuration settings between Compose files is not possible. Compose extension fields work by using YAML anchors, and those don't work across files.

So it'll have to be a single monolithic Compose file, if we want to have settings like timezone defined only once. There'll be a separate configuration section at the beginning of the file. Transmission service definitions are generated by a script, and will need to be pasted manually into the Compose file, whenever instance count needs changing.

I'll try and make it so that no other files need manual editing.

The most automatic thing would be a program that takes a single config file as an input, and outputs a single Compose file. Maybe later (probably never), for now I'll complete the rest of the todo list so we can have a usable setup. 🙂

@LennyPenny
Copy link

@faircopy is this in a usable state now? I'm very excited

@LennyPenny
Copy link

I will just try it out and provide some feedback :)

@LennyPenny
Copy link

Okay I got it running, its working perfectly!
I don't think the transcoder is working though, is that out of scope for this PR?

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