Skip to content

rpc_server: Set the configuration file for the gunicorn service

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).

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

Migrated from D1162 (view on Phabricator)

Merge request reports