Page MenuHomeSoftware Heritage

rpc_server: Set the configuration file for the gunicorn service
ClosedPublic

Authored by ardumont on Feb 20 2019, 3:45 PM.

Details

Summary

For services that currently read that environment variable (swh-vault
[1]), this will specify explicitely the configuration file to use.

For others, that won't change a thing as they need adaptations to do
so (swh-storage, swh-objstorage, swh-scheduler, swh-indexer-storage).

[1] https://forge.softwareheritage.org/source/swh-vault/browse/master/swh/vault/api/server.py$230
Related T1533

Test Plan
bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details --to update_worker_configuration orangerie
Found host orangerie.internal.softwareheritage.org
Cloning into '/tmp/swh-ocd.X3bQxYnF/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.X3bQxYnF/environments/update_worker_configuration/data/private'...
done.
*** Running octocatalog-diff on host orangerie.internal.softwareheritage.org
I, [2019-02-20T15:41:43.647763 #26706]  INFO -- : Catalogs compiled for orangerie.internal.softwareheritage.org
I, [2019-02-20T15:41:44.524214 #26706]  INFO -- : Diffs computed for orangerie.internal.softwareheritage.org
diff origin/production/orangerie.internal.softwareheritage.org current/orangerie.internal.softwareheritage.org
*******************************************
  File[/etc/systemd/system/gunicorn-swh-objstorage.service] =>
   parameters =>
     content =>
      @@ -14,4 +14,5 @@
       RuntimeDirectory=/run/gunicorn/swh-objstorage
       WorkingDirectory=/run/gunicorn/swh-objstorage
      +Environment=SWH_CONFIG_FILENAME=/etc/softwareheritage/objstorage/server.yml
       ExecStart=/usr/bin/gunicorn3 -p /run/gunicorn/swh-objstorage/pidfile -c /etc/gunicorn/instances/swh-objstorage.cfg swh.objstorage.api.server:app
       ExecStop=/bin/kill -TERM $MAINPID
*******************************************
  File[/etc/systemd/system/gunicorn-swh-vault.service] =>
   parameters =>
     content =>
      @@ -14,4 +14,5 @@
       RuntimeDirectory=/run/gunicorn/swh-vault
       WorkingDirectory=/run/gunicorn/swh-vault
      +Environment=SWH_CONFIG_FILENAME=/etc/softwareheritage/vault/server.yml
       ExecStart=/usr/bin/gunicorn3 -p /run/gunicorn/swh-vault/pidfile -c /etc/gunicorn/instances/swh-vault.cfg swh.vault.api.wsgi:app
       ExecStop=/bin/kill -TERM $MAINPID
*******************************************
  Gunicorn::Instance[swh-objstorage] =>
   parameters =>
     environment =>
       SWH_CONFIG_FILENAME =>
        + /etc/softwareheritage/objstorage/server.yml
*******************************************
  Gunicorn::Instance[swh-vault] =>
   parameters =>
     environment =>
       SWH_CONFIG_FILENAME =>
        + /etc/softwareheritage/vault/server.yml
*******************************************
  Systemd::Unit_file[gunicorn-swh-objstorage.service] =>
   parameters =>
     content =>
      @@ -14,4 +14,5 @@
       RuntimeDirectory=/run/gunicorn/swh-objstorage
       WorkingDirectory=/run/gunicorn/swh-objstorage
      +Environment=SWH_CONFIG_FILENAME=/etc/softwareheritage/objstorage/server.yml
       ExecStart=/usr/bin/gunicorn3 -p /run/gunicorn/swh-objstorage/pidfile -c /etc/gunicorn/instances/swh-objstorage.cfg swh.objstorage.api.server:app
       ExecStop=/bin/kill -TERM $MAINPID
*******************************************
  Systemd::Unit_file[gunicorn-swh-vault.service] =>
   parameters =>
     content =>
      @@ -14,4 +14,5 @@
       RuntimeDirectory=/run/gunicorn/swh-vault
       WorkingDirectory=/run/gunicorn/swh-vault
      +Environment=SWH_CONFIG_FILENAME=/etc/softwareheritage/vault/server.yml
       ExecStart=/usr/bin/gunicorn3 -p /run/gunicorn/swh-vault/pidfile -c /etc/gunicorn/instances/swh-vault.cfg swh.vault.api.wsgi:app
       ExecStop=/bin/kill -TERM $MAINPID
*******************************************
*** End octocatalog-diff on orangerie.internal.softwareheritage.org

Diff Detail

Repository
rSPSITE puppet-swh-site
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

olasd added a subscriber: olasd.

(god I hate how noisy the puppet coding style makes diffs)

This revision is now accepted and ready to land.Feb 20 2019, 5:31 PM
This revision was automatically updated to reflect the committed changes.