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 Image #5590

Closed
mrcruz opened this issue Sep 28, 2020 · 3 comments
Closed

Docker Image #5590

mrcruz opened this issue Sep 28, 2020 · 3 comments

Comments

@mrcruz
Copy link
Contributor

mrcruz commented Sep 28, 2020

#4846 already make a very good case in about how important is to provide portability. I believe that docker is the way to achieve this portability, improve automation pipelines as a side benefit and even distribute docker to another type of power users.

The use case that I see myself using tribler would be in my headless server (#5303 ) . I would like to run tribler core and interact with it remotely through its REST API. Docker is a standard in self hosting communities. These communities (like r/selfhosted) usually have users with powerful machines and excellent internet links. These power users could become super seeders for the whole network. Right now, It is too difficult to deploy safely to a headless server.

So, running tribler core on a headless server, how do I interact with? I believe that if the team provides the core functionality with a REST API, it would be much simpler for a third party like me to contribute and build an UI. I was planning to do that and my research led to some references like icetime and stremio that could be used as a starting point.

As an example, this a docker command to deploy a qbittorrent instance that would listen to port 8080 in a docker enabled server:
docker create -p 8080:8080 -v /appdata/config:/config linuxserver/qbittorrent
If we make that easy to install tribler on a server, I believe it would bring a lot of power users.

This post is a bit weird but I would like to document my research from last month since I just switched jobs and I will have to halt for a while my work on a headless server version of tribler. Also, I would like to understand the teams perspective about this.

@devos50
Copy link
Contributor

devos50 commented Sep 28, 2020

I agree that having an approach that makes it easy to deploy Tribler in several environments is the way to go, and that Docker is an adequate solution for this. As such, it is very helpful to provide a Dockerfile that allows anyone to run Tribler headless on their remote servers.

Note that we already have a Docker image, which can be found here. I think though that we should move this docker file to the main repository, to make it easier for users to find. Any improvement to this Dockerfile is highly appreciated 👍

So, running tribler core on a headless server, how do I interact with?

Indeed, we provide a RESTful API, which documentation can be found here. We should add a direct link to this documentation to our README.md though.

These power users could become super seeders for the whole network.

This goal aligns well with our scientific objectives, which is to incentivise users to contribute to the network (through providing services/their bandwidth). We have some ideas about that written here and here.

Please let us know if you have other questions!

@hbiyik
Copy link

hbiyik commented Oct 3, 2020

Hello @mrcruz
I think this discussion was also initated with the work on https://github.com/hbiyik/triblerd-buildsys

In this case:
Get your tribler src from cloning to a dir
Get your buildsys to another dir and cd to buildsys dir.

Execute atuomated scripts as below

python3 configure.py
python3 makedocker.py linux-amd64
python3 maketriblerd.py --target=linux-amd64 --srcdir=../triblersrcdirpath --debugrun

you will have headless running in the docker and you can visit the rest api on
http://127.0.01:8085

For further reference how this works: basically tribler source dirs are mapped to docker dirs, when docker is run, python path is updated accordingly and and docker runs with --netowrk host option. How docker is called is also written to stdout when running maketriblerd.py. But i think you dont need any of those, above pythons scripts should be enough.

docker run -ti --network host  -v /home/boogie/src/tribler:/work/tribler boogiepy/triblerd-linux-amd64 /bin/bash -c "export PYTHONPATH=$PYTHONPATH:/work/tribler/src/anydex:/work/tribler/src/tribler-common:/work/tribler/src/tribler-core:/work/tribler/src/pyipv8 && python3 /work/tribler/src/tribler-core/run_tribler_headless.py -p 8085"

@drew2a
Copy link
Contributor

drew2a commented Jun 6, 2024

The docker support has been added in

@drew2a drew2a closed this as completed Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants