From 93452a0e80bf02449ea56e4b63f1061e1db1da9e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 21 Sep 2024 19:45:47 -0400 Subject: [PATCH 01/12] tests: run CI on Ubuntu Noble --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64e5c1dcf..91d5a7b01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ env: jobs: check-commit: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 outputs: skip: ${{ steps.check-commit.outputs.skip }} @@ -43,7 +43,7 @@ jobs: build: name: build - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: check-commit if: ${{ needs.check-commit.outputs.skip != 'true' }} outputs: @@ -83,7 +83,7 @@ jobs: build-image-amd64: name: build-image.linux/amd64 needs: build - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 20 steps: @@ -97,7 +97,7 @@ jobs: build-image-arm64: name: build-image.linux/arm64 needs: build - runs-on: buildjet-4vcpu-ubuntu-2204-arm + runs-on: buildjet-4vcpu-ubuntu-2404-arm timeout-minutes: 20 steps: @@ -111,7 +111,7 @@ jobs: unit-tests: name: unit.${{ matrix.index }} needs: build - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: ${{fromJson(needs.build.outputs.matrix)}} @@ -151,7 +151,7 @@ jobs: docker-deploy-tests: name: docker needs: build - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false @@ -181,7 +181,7 @@ jobs: go-tests: name: go.${{ matrix.index }} needs: build - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: @@ -222,7 +222,7 @@ jobs: publish-test-results: name: publish-test-results needs: unit-tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: checks: write # the build-and-test job might be skipped, we don't need to run this job then From a72cb696f63ad73e01bb3ccd1fe72d1660a799b5 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 22 Sep 2024 00:17:14 -0400 Subject: [PATCH 02/12] debug: show output from ssh attempt --- tests.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests.mk b/tests.mk index bee1c5ad1..cc005cd6a 100644 --- a/tests.mk +++ b/tests.mk @@ -116,9 +116,9 @@ endif prime-ssh-known-hosts: @echo "-----> Intitial SSH connection to populate known_hosts..." @echo "=====> SSH $(DOKKU_DOMAIN)" - ssh -o StrictHostKeyChecking=no dokku@$(DOKKU_DOMAIN) help >/dev/null + ssh -o StrictHostKeyChecking=no dokku@$(DOKKU_DOMAIN) help @echo "=====> SSH 127.0.0.1" - ssh -o StrictHostKeyChecking=no dokku@127.0.0.1 help >/dev/null + ssh -o StrictHostKeyChecking=no dokku@127.0.0.1 help lint-setup: @mkdir -p test-results/shellcheck tmp/shellcheck From f72202c40612c599ab451d22a852ace38cd3ac18 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 22 Sep 2024 02:59:49 -0400 Subject: [PATCH 03/12] debug: drop trace mode to make output slightly more readable --- .github/commands/ci-setup | 1 - tests/ci/setup.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/commands/ci-setup b/.github/commands/ci-setup index 4c33bd55e..a6e0cd77c 100755 --- a/.github/commands/ci-setup +++ b/.github/commands/ci-setup @@ -1,6 +1,5 @@ #!/usr/bin/env bash set -eo pipefail -set -x DOKKU_DOMAIN=${DOKKU_DOMAIN:="dokku.me"} diff --git a/tests/ci/setup.sh b/tests/ci/setup.sh index 6a7fd1b34..1cb1d4e80 100755 --- a/tests/ci/setup.sh +++ b/tests/ci/setup.sh @@ -111,7 +111,7 @@ EOF sleep 5 echo "-----> Start install ${ROOT_DIR}/build/package/dokku-${architecture}.deb via dpkg" - sudo TRACE=1 dpkg -i "${ROOT_DIR}/build/package/dokku-${architecture}.deb" + sudo dpkg -i "${ROOT_DIR}/build/package/dokku-${architecture}.deb" echo "-----> End install ${ROOT_DIR}/build/package/dokku-${architecture}.deb via dpkg" } From 46c1e80c198ce40c4c933451161041806e3eb870 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 22 Sep 2024 03:00:39 -0400 Subject: [PATCH 04/12] debug: check on ssh status when setting up ci --- tests.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests.mk b/tests.mk index cc005cd6a..a260ddd56 100644 --- a/tests.mk +++ b/tests.mk @@ -86,7 +86,10 @@ ifneq ($(wildcard /etc/ssh/sshd_config),) ifeq ($(shell grep 22333 /etc/ssh/sshd_config),) sed --in-place "s:^Port 22:Port 22 \\nPort 22333:g" /etc/ssh/sshd_config endif + cat /etc/ssh/sshd_config service ssh restart + service ssh status + journalctl -u ssh -f -n 1000 endif @echo "-----> Installing SSH public key..." From 5bb4de58d711a696c63806947c0fc34692007a4a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 22 Sep 2024 20:04:32 -0400 Subject: [PATCH 05/12] fix: update ssh.socket to listen on port 22333 Newer versions of sshd respect the systemd settings for listening on ports vs just the sshd_config. --- tests.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests.mk b/tests.mk index a260ddd56..2bb3aebcc 100644 --- a/tests.mk +++ b/tests.mk @@ -86,7 +86,12 @@ ifneq ($(wildcard /etc/ssh/sshd_config),) ifeq ($(shell grep 22333 /etc/ssh/sshd_config),) sed --in-place "s:^Port 22:Port 22 \\nPort 22333:g" /etc/ssh/sshd_config endif +ifeq ($(shell grep 22333 /usr/lib/systemd/system/ssh.socket),) + sed --in-place "s:^ListenStream=22:ListenStream=22 \\nListenStream=22333:g" /usr/lib/systemd/system/ssh.socket +endif + cat /usr/lib/systemd/system/ssh.socket cat /etc/ssh/sshd_config + systemctl daemon-reload service ssh restart service ssh status journalctl -u ssh -f -n 1000 From 08f68c663483eb0cad663f891ee9fd725a57134e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 22 Sep 2024 21:07:26 -0400 Subject: [PATCH 06/12] fix: do not wait forever and use systemctl for interacting with services --- tests.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests.mk b/tests.mk index 2bb3aebcc..f70e615b3 100644 --- a/tests.mk +++ b/tests.mk @@ -92,9 +92,11 @@ endif cat /usr/lib/systemd/system/ssh.socket cat /etc/ssh/sshd_config systemctl daemon-reload - service ssh restart - service ssh status - journalctl -u ssh -f -n 1000 + systemctl reload ssh + systemctl restart ssh + systemctl status ssh + sleep 2 + journalctl -u ssh -n 1000 endif @echo "-----> Installing SSH public key..." From 2c4eb67104f298b43889b2d279522ad8f9cde558 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 22 Sep 2024 21:24:59 -0400 Subject: [PATCH 07/12] fix: go back to not using systemd --- tests.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests.mk b/tests.mk index f70e615b3..7eca12806 100644 --- a/tests.mk +++ b/tests.mk @@ -92,9 +92,10 @@ endif cat /usr/lib/systemd/system/ssh.socket cat /etc/ssh/sshd_config systemctl daemon-reload - systemctl reload ssh - systemctl restart ssh - systemctl status ssh + service ssh reload + service ssh restart + service ssh status + cat /etc/init/ssh || true sleep 2 journalctl -u ssh -n 1000 endif From 6a22ae05d23e60c07ae72d912b2fa7dd3387dc59 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 22 Sep 2024 21:25:49 -0400 Subject: [PATCH 08/12] debug: show active systemd services --- tests.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/tests.mk b/tests.mk index 7eca12806..910f4f728 100644 --- a/tests.mk +++ b/tests.mk @@ -92,6 +92,7 @@ endif cat /usr/lib/systemd/system/ssh.socket cat /etc/ssh/sshd_config systemctl daemon-reload + systemctl list-unit-files | sort service ssh reload service ssh restart service ssh status From 47c1b3b2955c1e40ad32c4e1b94e5df20d7170ab Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 22 Sep 2024 21:58:14 -0400 Subject: [PATCH 09/12] fix: restart ssh socket https://discourse.ubuntu.com/t/sshd-now-uses-socket-based-activation-ubuntu-22-10-and-later/30189 --- tests.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests.mk b/tests.mk index 910f4f728..1f34dd801 100644 --- a/tests.mk +++ b/tests.mk @@ -93,10 +93,8 @@ endif cat /etc/ssh/sshd_config systemctl daemon-reload systemctl list-unit-files | sort - service ssh reload - service ssh restart + systemctl restart ssh.socket service ssh status - cat /etc/init/ssh || true sleep 2 journalctl -u ssh -n 1000 endif From 8f18c3d58155bef59668cb386dbb24ce1dfa68e6 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 22 Sep 2024 22:28:34 -0400 Subject: [PATCH 10/12] debug: update logging --- tests.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests.mk b/tests.mk index 1f34dd801..c1e414dbe 100644 --- a/tests.mk +++ b/tests.mk @@ -93,10 +93,11 @@ endif cat /etc/ssh/sshd_config systemctl daemon-reload systemctl list-unit-files | sort + journalctl -u ssh -n 1000 systemctl restart ssh.socket + journalctl -u ssh -n 1000 service ssh status sleep 2 - journalctl -u ssh -n 1000 endif @echo "-----> Installing SSH public key..." From 4c634b6fd0ff9c75eb62d84d91104e82af7200fa Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 22 Sep 2024 23:38:28 -0400 Subject: [PATCH 11/12] debug: why ssh isnt running --- tests.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests.mk b/tests.mk index c1e414dbe..14329d4f9 100644 --- a/tests.mk +++ b/tests.mk @@ -91,13 +91,15 @@ ifeq ($(shell grep 22333 /usr/lib/systemd/system/ssh.socket),) endif cat /usr/lib/systemd/system/ssh.socket cat /etc/ssh/sshd_config + service ssh status systemctl daemon-reload systemctl list-unit-files | sort + service ssh status journalctl -u ssh -n 1000 systemctl restart ssh.socket + sleep 2 journalctl -u ssh -n 1000 service ssh status - sleep 2 endif @echo "-----> Installing SSH public key..." From b996114209fd610b3af9b37334ae5e28c27a535f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 23 Sep 2024 00:00:56 -0400 Subject: [PATCH 12/12] chore: remove debugging --- tests.mk | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests.mk b/tests.mk index 14329d4f9..df4fdeb81 100644 --- a/tests.mk +++ b/tests.mk @@ -89,17 +89,8 @@ endif ifeq ($(shell grep 22333 /usr/lib/systemd/system/ssh.socket),) sed --in-place "s:^ListenStream=22:ListenStream=22 \\nListenStream=22333:g" /usr/lib/systemd/system/ssh.socket endif - cat /usr/lib/systemd/system/ssh.socket - cat /etc/ssh/sshd_config - service ssh status systemctl daemon-reload - systemctl list-unit-files | sort - service ssh status - journalctl -u ssh -n 1000 systemctl restart ssh.socket - sleep 2 - journalctl -u ssh -n 1000 - service ssh status endif @echo "-----> Installing SSH public key..."