Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eriksjolund/user-systemd-service-actions-workflow
GitHub Actions workflow that runs a socket-activated echo server with Podman in a user systemd service
https://github.com/eriksjolund/user-systemd-service-actions-workflow
demo echo-server github-actions podman socket-activation systemd systemd-service
Last synced: 3 months ago
JSON representation
GitHub Actions workflow that runs a socket-activated echo server with Podman in a user systemd service
- Host: GitHub
- URL: https://github.com/eriksjolund/user-systemd-service-actions-workflow
- Owner: eriksjolund
- License: mit
- Created: 2021-01-10T16:51:59.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-21T09:28:29.000Z (over 2 years ago)
- Last Synced: 2023-02-28T23:22:26.018Z (almost 2 years ago)
- Topics: demo, echo-server, github-actions, podman, socket-activation, systemd, systemd-service
- Homepage:
- Size: 7.81 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### GitHub Actions workflow to demonstrate how to run a user systemd service
The tested echo server container [__ghcr.io/eriksjolund/socket-activate-echo__](https://github.com/eriksjolund/socket-activate-echo/pkgs/container/socket-activate-echo
) supports _socket activation_.Using [socket activation](https://github.com/containers/podman/blob/main/docs/tutorials/socket_activation.md) has
the advantage that there is no need for the client to use _/usr/bin/sleep_ combined with a while-loop to check if the server is online.The file [.github/workflows/demo.yml](.github/workflows/demo.yml) contains:
```
name: Echo server demo with podman and systemd
on:
push:
branch:
- main
jobs:
systemd_podman_echo_server_demo:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Run actions/checkout for this repo
uses: actions/checkout@v4
with:
path: checkout
persist-credentials: false
- name: Run an echo server with podman in a user systemd service
run: |
sudo apt-get update
sudo apt-get install -y socat
podman pull ghcr.io/eriksjolund/socket-activate-echo:latest
mkdir -p ~/.config/containers/systemd
mkdir -p ~/.config/systemd/user
cp checkout/echo.container ~/.config/containers/systemd
cp checkout/echo.socket ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user start echo.socket
echo hello | socat - tcp4:127.0.0.1:3000
echo hello | socat - tcp6:[::1]:3000
echo hello | socat - udp4:127.0.0.1:3000
echo hello | socat - udp6:[::1]:3000
echo hello | socat - unix:$HOME/echo_stream_sock
echo hello | socat - VSOCK-CONNECT:1:3000
```