golemfactory / yapapi

Python high-level API for Golem.
https://yapapi.readthedocs.io/en/stable/
GNU Lesser General Public License v3.0
48 stars 23 forks source link

ssh example, but `-slim` instead of `-alpine` #1105

Open johny-b opened 1 year ago

johny-b commented 1 year ago
  1. examples/ssh is a nice place to start with the VPN
  2. Many things don't work on -alpine images - e.g. pip3 install ray in my case, but this seems more general (from this article (...) some teams are moving away from alpine because these images can cause compatibility issues that are hard to debug. Specifically, if using python images, some wheels are built to be compatible with Debian and will need to be recompiled to work with an Apline-based image.
  3. Running the same example on a -slim image requires some non-trivial (... for me) changes.

I think these non-trivial changes include:

RUN apt-get update
RUN apt-get install -y openssh-server iproute2 tcpdump net-tools screen

instead of

RUN apk add --no-cache --update bash openssh iproute2 tcpdump net-tools screen

and

script.run("/bin/bash", "-c", "ssh-keygen -A")
script.run("/bin/bash", "-c", f'echo -e "{password}\n{password}" | passwd')
script.run("/bin/bash", "-c", "service ssh start")

instead of

script.run("/bin/bash", "-c", "syslogd")
script.run("/bin/bash", "-c", "ssh-keygen -A")
script.run("/bin/bash", "-c", f'echo -e "{password}\n{password}" | passwd')
script.run("/bin/bash", "-c", "/usr/sbin/sshd")