openstack-ansible-repo_server/templates/pypiserver-systemd-init.j2
Jesse Pretorius 6320c00217 Implement pypiserver and pypi proxy cache
This patch implements nginx as a reverse proxy for python
packages. The initial query will be to a local deployment
of pypiserver in order to serve any locally built packages,
but if the package is not available locally it will retry
the query against pypi and cache the response.

Depends-On: Id20a43fed833d53ca0f147f517deafba6587352d
Change-Id: Ic4fd64f4dc82121a65088f3d7f4ae53f373df608
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2017-11-24 11:58:18 +00:00

33 lines
802 B
Django/Jinja

# {{ ansible_managed }}
[Unit]
Description=pypiserver
After=network.target
[Service]
Type=simple
User={{ repo_service_user_name }}
Group={{ repo_service_group_name }}
ExecStart={{ repo_pypiserver_bin }}/pypi-server {{ repo_pypiserver_start_options }}
ExecStop=/bin/kill -TERM $MAINPID
WorkingDirectory={{ repo_pypiserver_working_dir }}
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=120
TimeoutStartSec=3
Restart=on-failure
RestartSec=2
# This creates a specific slice which all services will operate from
# The accounting options give us the ability to see resource usage through
# the `systemd-cgtop` command.
Slice=pypiserver.slice
CPUAccounting=true
BlockIOAccounting=true
MemoryAccounting=false
TasksAccounting=true
[Install]
WantedBy=multi-user.target