gdcc / dataverse-ansible

Ansible role for installing Dataverse
GNU General Public License v3.0
16 stars 19 forks source link

Docker mode (container mode) #268

Open pdurbin opened 1 year ago

pdurbin commented 1 year ago

I've been talking to @TanayKarve about how ignorant I am about running Docker on servers.

We have a crazy idea! 🎉 😄

What if dataverse-ansible had a "Docker mode" where instead of installing Payara, PostgreSQL, Solr, and all the rest directly on the EC2 instance, the spin up script installs Docker on the EC2 instance so that we're ready to run containers, such as the ones in the dataverse-docker repo.

@TanayKarve says he can supply the 4-5 commands to install Docker on Rocky 8. Thanks!

-d is taken by "destroy" so we'll use -c for "container mode" (rather than "Docker mode").

TanayKarve commented 1 year ago

Sounds good. Here's the list of commands:

sudo dnf check-update
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo systemctl enable docker

Optional: Run docker without the sudo keyword everytime

sudo usermod -aG docker $(whoami)
donsizemore commented 1 year ago

A few thoughts:

1) On RHEL-based systems I consider podman to be far preferable over Docker for several reasons, but that's a small matter.

2) The utility of Ansible in launching Dataverse in Docker might primarily involve populating docker-compose.yml and other env files via templates and running docker-compose, which is frankly over-kill. @pdurbin references the flags used in EC2-create, but we don't need Ansible for this - as @TanayKarve notes only a few commands are necessary to install Docker. It sounds like you're asking for ec2-create for dataverse-docker, which sounds great, but one bit of information is needed:

3) We've had a number of Docker-based solutions over the years, each significantly different from one another, each developed by their respective organization rather than for general use. Oliver and Patrick's work looks like a step in this direction, so once there is a general, "recommended" Docker-based solution for Dataverse, we can pretty easily point EC2-create (or a GitHub workflow, or the next container-based CI service) at that?

Don

pdurbin commented 8 months ago

(Many months later) @donsizemore thanks for the thoughts above. I think we have (or are close to having) a config that works for a narrow use case at least: developers or people working on metadata blocks.

I bring this up because today @jggautier let me know that he was able to successfully use our docker quick start ( https://guides.dataverse.org/en/6.0/developers/dev-environment.html#quickstart ) to spin up our containers on his laptop so he could test a metadata block.

The main downside is that docker is running locally on his laptop rather than on an EC2 instance that he can share with others. ("Please play with the new metadata block and let me know if it looks ok.") It's looking like we've fixed (#331) our EC3 spin up scripts, so Julian will probably simply go back to using them, but it reminded me to circle back to this issue and explain a possible use case for running our Docker images on an EC2 instance.