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

s6-overlay v3 #337

Open
eitsupi opened this issue Jan 20, 2022 · 4 comments
Open

s6-overlay v3 #337

eitsupi opened this issue Jan 20, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@eitsupi
Copy link
Member

eitsupi commented Jan 20, 2022

Related to #332 (cc @kforner)

s6-overlay Version 3 seems to be close to being released (binaries have not been uploaded, but tags have been created).
https://github.com/just-containers/s6-overlay/releases/tag/v3.0.0.0

Since most of the source code seems to have been rewritten, I think it is necessary to do sufficient testing before upgrading.

@cboettig How can I help with testing?

@mcanouil
Copy link
Contributor

mcanouil commented Mar 29, 2022

The following resource might help to upgrade to v3: https://github.com/just-containers/s6-overlay/blob/master/MOVING-TO-V3.md

Version 3 is still compatible with the use of /etc/services.d, although for the future, services definition should be rewritten using s6-rc format (https://skarnet.org/software/s6-rc/).

Most of the changes rely on the install process which requires two tarball.

S6_VERSION=${S6_VERSION:-v3.1.0.1}
S6_BEHAVIOUR_IF_STAGE2_FAILS=2

ARCH=$(uname -m)

apt-get update && apt-get -y install wget xz-utils

DOWNLOAD_FILE=s6-overlay-noarch.tar.xz
wget -P /tmp/ https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/$DOWNLOAD_FILE
tar -C / -Jxpf /tmp/$DOWNLOAD_FILE

DOWNLOAD_FILE=s6-overlay-${ARCH}.tar.xz
wget -P /tmp/ https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/$DOWNLOAD_FILE
tar -C / -Jxpf /tmp/$DOWNLOAD_FILE

Note: I am currently testing it in a similar framework as rocker.

@eitsupi eitsupi added the enhancement New feature or request label Apr 2, 2022
@salim-b
Copy link
Contributor

salim-b commented Nov 27, 2023

Just a note: s6-overlay v3.x (in contrast to v2.x) seems to require being PID 1, i.e. refuses to start if it's not. This (without additional workarounds) makes s6-overlay incompatible with hosting environments like Fly.io where container images are transformed into Firecracker VMs.

I haven't tested this myself but the information linked above seems consistent to me. I currently use the rocker/r-ver container image as a basis for a custom RStudio Server setup hosted on Fly.io that automatically scales to zero after the last user quits their session.

@benz0li
Copy link
Contributor

benz0li commented Nov 28, 2023

@salim-b FYI

[...] s6-overlay was always meant to run as pid 1. In v2, it appeared to run as another pid, but it was just more subtly broken; any case where it worked was purely accidental. In v3, we purposefully prevent the boot if /init isn't running as pid 1, in order to avoid silent breakage.

Container managers that force you to run a pid 1 of their choice are going out of their lane and breaking the convention for containers. They do not qualify as container managers; they may be useful for other purposes, but you cannot expect projects meant to run with containers to properly interact with them.

just-containers/s6-overlay#358 (comment)

@salim-b
Copy link
Contributor

salim-b commented Nov 28, 2023

@benz0li Thanks for the highlight.

Fly.io is in fact not a "container manager" but runs Docker images without Docker. The containers are converted to KVM-based Firecracker VMs which have stronger isolation guarantees than containers. That's why they can claim "User code is fraught with peril. Fly Machines run it safely - even the most awful, buggy, and downright hostile user code."

Furthermore, Fly machines start up in about 300ms (any supported region). And they offer a generous free tier (not enough for a usable RStudio Server, though).

Anyways, I don't wana promote them. I just think there is value in keeping the Rocker container images compatible with such non-PID1 setups (aka "microVMs").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants