mikeizbicki / cmc-csci143

big data course materials
40 stars 76 forks source link

Extra Credit: More Docker #453

Open mikeizbicki opened 9 months ago

mikeizbicki commented 9 months ago

Docker Swarm is a tool for deploying containers defined in a docker-compose.yml file to a cloud provider.

This tutorial shows how to use docker swarm to deploy to the digital ocean cloud service. To follow it, you'll need to claim your $200 student account credits.

If you do, you'll receive +2 points of extra credit. If you deploy to another cloud provider as well (e.g. AWS, Azure, Google Cloud), then you'll receive an additional +2 points of extra credit.


Kubernetes (k8s) is another "orchestration tool" for deploying containers to the cloud. It was developed by google, and much of google's infrastructure runs on kubernetes.

This tutorial uses kubernetes to build an amazon clone. If you complete the tutorial, you will earn +2 points extra credit. If you deploy your service to a cloud provider, you can earn +2 points of extra credit.

danzhechen commented 8 months ago

Hi Mike,

I have a question when I tried to work on Docker Swarm. I am at the stage of pulling images from Docker Hub. When I typed

docker login

I got the following error message.

Error saving credentials: error storing credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY`

I tried to search it online and the solution seems to involve sudo command. https://forums.docker.com/t/docker-login-fails-with-error-message-error-saving-credentials-cannot-autolaunch-d-bus-without-x11-display/77789/4

And since we do not have that access on lambda server. I wonder whether you would have some suggestions regarding the situation if I do not want to temporarily working it around using

echo "yourpassword" | docker login --username yourusername --password-stdin
mikeizbicki commented 8 months ago

@danzhechen I don't have a better suggestion than the docker incantation that you proposed. If that's letting you login, then you should be good to keep going through the tutorial.

danzhechen commented 8 months ago

Hey Mike,

Sorry I tried the docker incantation and it still not work. Same issue there. I tried to look for other solutions but it seems that I still have to run as the most easiest solution

sudo apt install gnupg2 pass

https://stackoverflow.com/questions/50151833/cannot-login-to-docker-account Is there anything I can do that on the lambda server?

danzhechen commented 7 months ago

Hi Mike @mikeizbicki ,

I was working on this part

$ for i in 1 2 3 4; do
    docker-machine create \
      --driver digitalocean \
      --digitalocean-access-token $DIGITAL_OCEAN_ACCESS_TOKEN \
      --digitalocean-region "nyc1" \
      --digitalocean-image "debian-10-x64" \
      --digitalocean-size "s-4vcpu-8gb" \
      --engine-install-url "https://releases.rancher.com/install-docker/19.03.9.sh" \
      node-$i;
  done

and I encountered the issue of docker-machine: command not found. Could you help add this part for lambda?

$ curl -L https://github.com/docker/machine/releases/download/v0.16.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine &&
chmod +x /tmp/docker-machine &&
sudo cp /tmp/docker-machine /usr/local/bin/docker-machine
mikeizbicki commented 7 months ago

@danzhechen docker-machine shouldn't need to be installed globally in /usr/local/bin. Instead of trying to install it there, you should be able to just download it to someplace in your homefolder (e.g. $HOME/bin) and run from there.

danzhechen commented 6 months ago

@mikeizbicki Hey Mike, I almost finish the swarm task. How should I submit it to get the extra credit?

mikeizbicki commented 6 months ago

This one is complicated enough that there won't be a way to email me. You'll have to demo it in person in one of the office hours timeslots. It should only take a minute.