Configure Systemd Socket Activation
as new way for Poseidon to accept connections. This should reduce our issues caused by deployments.
This commit is contained in:
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@ -208,9 +208,20 @@ jobs:
|
||||
./poseidon | tee poseidon.log &
|
||||
until curl -s --fail http://localhost:7200/api/v1/health ; do sleep 1; done
|
||||
make e2e-test
|
||||
- name: Run e2e recovery tests
|
||||
- name: Setup Poseidon Socket
|
||||
run: |
|
||||
killall poseidon
|
||||
mkdir -p ~/.config/systemd/user
|
||||
cp ./.github/workflows/resources/poseidon-minimal.socket ~/.config/systemd/user/poseidon.socket
|
||||
cat ./.github/workflows/resources/poseidon-minimal.service | envsubst > ~/.config/systemd/user/poseidon.service
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user start poseidon.socket
|
||||
- name: Print Poseidon Failure logs
|
||||
if: failure()
|
||||
run: journalctl -xen --no-pager
|
||||
- name: Run e2e recovery tests
|
||||
run: |
|
||||
tail -f /var/log/syslog &
|
||||
make e2e-test-recovery
|
||||
if: ${{ success() || failure() }}
|
||||
- name: Convert coverage reports
|
||||
|
12
.github/workflows/resources/poseidon-minimal.service
vendored
Normal file
12
.github/workflows/resources/poseidon-minimal.service
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# This is a minimal service definition to make use of the systemd socket activation in the e2e tests.
|
||||
# With Systemd socket activation, systemd sets up a listening socket on behalf of a service.
|
||||
# This is useful for zero downtime deployments as the systemd sockets hold up the connections while the service is restarting.
|
||||
|
||||
[Unit]
|
||||
Requires=poseidon.socket
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=${GITHUB_WORKSPACE}
|
||||
ExecStart=${GITHUB_WORKSPACE}/poseidon
|
||||
Restart=always
|
||||
Environment="POSEIDON_SERVER_SYSTEMDSOCKETACTIVATION=TRUE"
|
4
.github/workflows/resources/poseidon-minimal.socket
vendored
Normal file
4
.github/workflows/resources/poseidon-minimal.socket
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# This is a minimal socket definition to provide a systemd socket for the Poseidon e2e tests.
|
||||
|
||||
[Socket]
|
||||
ListenStream = 7200
|
Reference in New Issue
Block a user