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

refactor: replace supervisord with s6 #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ version: 2.1
executors:
testbuild-executor:
machine:
image: ubuntu-2004:202201-02
image: default
jobs:
test:
executor: testbuild-executor
Expand Down
42 changes: 25 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
FROM ubuntu:24.04
LABEL maintainer="LanCache.Net Team <[email protected]>"
ARG DEBIAN_FRONTEND=noninteractive

RUN \
apt-get -y update && apt-get -y upgrade && \
apt-get -y install supervisor curl wget bzip2 locales tzdata --no-install-recommends && \
locale-gen en_GB.utf8 && \
update-locale LANG=en_GB.utf8 && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
ARG DEBIAN_FRONTEND=noninteractive
ARG ARCH="amd64"
ARG ARCH_ALT="x86_64"
ARG OVERLAY_VERSION="3.2.0.0"

ENV \
SUPERVISORD_EXIT_ON_FATAL=1 \
LC_ALL=en_GB.UTF-8 \
LANG=en_GB.UTF-8 \
LANGUAGE=en_GB.UTF-8 \
TZ=Europe/London \
SUPERVISORD_LOGLEVEL=WARN
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_VERBOSITY=1 \
LC_ALL=en_GB.UTF-8 \
LANG=en_GB.UTF-8 \
LANGUAGE=en_GB.UTF-8 \
TZ=Europe/London

COPY overlay/ /
RUN chmod -R 755 /init /hooks
ENTRYPOINT ["/bin/bash", "-e", "/init/entrypoint"]
CMD ["/init/supervisord"]

RUN \
apt-get -y update && apt-get -y upgrade && \
apt-get -y install ca-certificates curl locales tzdata wget xz-utils --no-install-recommends && \
locale-gen en_GB.utf8 && \
update-locale LANG=en_GB.utf8 \
cd /tmp && \
curl -sSfL -o s6-overlay-noarch.tar.xz "https://github.com/just-containers/s6-overlay/releases/download/v${OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" && \
curl -sSfL -o s6-overlay.tar.xz "https://github.com/just-containers/s6-overlay/releases/download/v${OVERLAY_VERSION}/s6-overlay-${ARCH_ALT}.tar.xz" && \
tar -C / -Jpxf s6-overlay-noarch.tar.xz && \
tar -C / -Jpxf s6-overlay.tar.xz && \
apt-get -y clean && \
rm -rf /tmp/* /var/lib/apt/lists/*

ENTRYPOINT ["/init"]
4 changes: 1 addition & 3 deletions goss.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package:
bzip2:
installed: true
curl:
installed: true
wget:
installed: true
process:
supervisord:
s6-svscan:
running: true
1 change: 1 addition & 0 deletions overlay/etc/s6-overlay/s6-rc.d/asciilogo/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
1 change: 1 addition & 0 deletions overlay/etc/s6-overlay/s6-rc.d/asciilogo/up
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/scripts/asciilogo
File renamed without changes.
12 changes: 12 additions & 0 deletions overlay/etc/s6-overlay/scripts/asciilogo
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/command/with-contenv bash

cat <<EOF
_ _____ _ _
| | / ____| | | | |
| | __ _ _ __ | | __ _ ___| |__ ___ _ __ ___| |_
| | / _\` | '_ \| | / _\` |/ __| '_ \ / _ \ | '_ \ / _ \ __|
| |___| (_| | | | | |___| (_| | (__| | | | __/_| | | | __/ |_
|______\__,_|_| |_|\_____\__,_|\___|_| |_|\___(_)_| |_|\___|\__|


EOF
18 changes: 0 additions & 18 deletions overlay/etc/supervisor/supervisord.conf

This file was deleted.

Empty file.
9 changes: 0 additions & 9 deletions overlay/hooks/entrypoint-pre.d/00_asciilogo.sh

This file was deleted.

Empty file.
68 changes: 0 additions & 68 deletions overlay/init/entrypoint

This file was deleted.

31 changes: 0 additions & 31 deletions overlay/init/supervisord

This file was deleted.

8 changes: 1 addition & 7 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#!/bin/bash

if [[ "$@" == *" -- "* ]]; then
SD_LOGLEVEL="-e SUPERVISORD_LOGLEVEL=INFO"
else
SD_LOGLEVEL="-- -e SUPERVISORD_LOGLEVEL=INFO"
fi

curl -fsSL https://raw.githubusercontent.com/lancachenet/test-suite/master/dgoss-tests.sh | bash -s -- --imagename="lancachenet/ubuntu:goss-test" $@ $SD_LOGLEVEL
curl -fsSL https://raw.githubusercontent.com/lancachenet/test-suite/master/dgoss-tests.sh | bash -s -- --imagename="lancachenet/ubuntu:goss-test" $@