Table of Contents |
---|
For a complete, working app based on these notes, see https://github.com/apache/infrastructure-testapp/
Pipservices is a term Infra uses to refer to single packages of services, or "apps", that are installed and run independently of each other within a larger package, like Gitbox. Pipservices tie into our configuration management system, and Infra can enable, manage and disable a specific pipservice quickly and as demand dictates. Having app components at this level of granularity simplifies day-to-day workflows, allows to much easier assessment of resource consumption, and aids debugging by separating both processes and security environments.
Create a systemd unit file called pipservice-$NAME.service: (e.g., pipservice-testapp.service
)
Code Block | ||||
---|---|---|---|---|
| ||||
[Unit] Description=Test Application [Service] Type=simple WorkingDirectory=/opt/$NAME User=$OWNER Group=$GROUP ExecStart=$RUNCMD Restart=on-failure [Install] WantedBy=multi-user.target |
A valid $RUNCMD for python3 would be
/usr/local/bin/pipenv run python3 testapp.py
See Pipservices-invoking and managing for how to use an existing pipservice.