Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running the server with Podman #40

Open
Thulium-Drake opened this issue Aug 13, 2021 · 2 comments
Open

Running the server with Podman #40

Thulium-Drake opened this issue Aug 13, 2021 · 2 comments

Comments

@Thulium-Drake
Copy link
Contributor

This issue is to investigate if any issues exist to run the ARA server on Podman.

@dmsimard
Copy link
Contributor

There is "prior art" for this that we can heavily draw inspiration from -- first, instructions from the quay.io/dockerhub readme:

podman run --name ara --detach --tty \
  --volume ~/.ara/server:/opt/ara:z -p 8000:8000 \
  quay.io/recordsansible/ara-api:latest

and then for an eventual systemd unit file for the podman container, @mscherer recently shared this piece (thanks!):

[Unit]
Wants=network.target
After=network-online.target

[Service]
{% for e in env %}
Environment={{ e }}={{ env[e] }}
{% endfor %}
Restart=on-failure
ExecStartPre=-/usr/bin/podman create --conmon-pidfile=%t/%N.pid  --name=%N {% if network is defined %}--net={{ network }}{% endif %} {% for v in volumes %}-v {{ v.src }}:{{ v.dest }} {% endfor %} --env-host=true --rm {% for p in ports %}-p {{ p.external }}:{{ p.internal }} {% endfor %}{{ image }} {{ command }}
ExecStart=/usr/bin/podman start %N
ExecStop=/usr/bin/podman stop %N
ExecStopPost=/usr/bin/podman rm %N
Type=forking
PIDFile=%t/%N.pid
{% if exit_code is defined %}
SuccessExitStatus={{ exit_code }}
{% endif %}
[Install]
WantedBy=multi-user.target

As to how this might work in practice, considering how ara_api/tasks/main.yaml is structured:

- name: Include installation of ARA
  include_tasks: "install/{{ ara_api_install_method }}.yaml"  <--- podman should be an install method

- name: Include configuration of the ARA API
  include_tasks: config.yaml               <--- nothing to do here I think
                                           we still need to template a settings.yaml and mount it to the container

- name: Include configuration of the database engine
  include_tasks: "database_engine/{{ ara_api_database_engine }}.yaml"  <--- This is handled by the container automatically

- name: Include installation of the WSGI backend server
  include_tasks: "wsgi_server/{{ ara_api_wsgi_server }}.yaml"  <--- podman would probably be the wsgi_server since gunicorn ships in the image ?
  when: ara_api_wsgi_server is not none                        it's where we would pull the image and set up a systemd unit

- name: Include installation of the frontend server
  include_role:
    name: "ara_frontend_{{ ara_api_frontend_server }}"   <--- this should not change that much ?
                                                         we're still reverse proxying to 127.0.0.1:8000
  when: ara_api_frontend_server is not none

@Thulium-Drake
Copy link
Contributor Author

Being worked on in #69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants