Operations grimoire/Odderon: Difference between revisions

From Nasqueron Agora
(Created page with "Odderon is hosted on Eglide, runs as <code>odderon</code>. == Deployment == Deployment is managed by Salt, with code update from Git. # Commit code generic change to master,...")
 
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:


== Deployment ==
== Deployment ==
Deployment is managed by Salt, with code update from Git.
Deployment is managed by SaltStack, with code update from Git.


# Commit code generic change to master, code specific to Odderon to production
# Commit code generic change to master, code specific to Odderon to production
Line 9: Line 9:


The darkbot is in written in C, so it must be compiled.
The darkbot is in written in C, so it must be compiled.
== Upgrade code ==
# Forward the production branch against the desired commit.
## For example to rebase against the <code>master</code> branch: <code>git fetch && git checkout production && git rebase origin/master</code>
## Push to DevCentral: <code>git push origin production</code>
# Deploy and restart the bot:
## Deploy with <code>salt eglide state.apply roles/shellserver/odderon/code</code>
## When happy, you can restart the bot through <code>%restart</code> on IRC or through <code>sudo service restart odderon</code>
Ensure /opt/odderon/LOCKED doesn't exist during the upgrade process: it blocks the states to run


== Allow user access top code ==
== Allow user access top code ==
Line 20: Line 30:


To resume update: <code>rm /opt/odderon/LOCKED</code>
To resume update: <code>rm /opt/odderon/LOCKED</code>
== Reference ==
A walkthrough to prepare this SaltStack role has been documented:
* https://www.dereckson.be/blog/2017/01/25/deploy-a-darkbot-or-a-simple-generic-service-with-saltstack-part-1/
* https://www.dereckson.be/blog/2017/02/09/deploy-a-darkbot-or-a-simple-generic-service-with-saltstack-part-2/

Latest revision as of 17:37, 29 May 2023

Odderon is hosted on Eglide, runs as odderon.

Deployment

Deployment is managed by SaltStack, with code update from Git.

  1. Commit code generic change to master, code specific to Odderon to production
  2. If needed, rebase production against master
  3. To update the repository against production branch: salt eglide state.apply roles/shellserver/odderon/

The darkbot is in written in C, so it must be compiled.

Upgrade code

  1. Forward the production branch against the desired commit.
    1. For example to rebase against the master branch: git fetch && git checkout production && git rebase origin/master
    2. Push to DevCentral: git push origin production
  2. Deploy and restart the bot:
    1. Deploy with salt eglide state.apply roles/shellserver/odderon/code
    2. When happy, you can restart the bot through %restart on IRC or through sudo service restart odderon

Ensure /opt/odderon/LOCKED doesn't exist during the upgrade process: it blocks the states to run

Allow user access top code

Users in nasqueron-irc group can sudo -u odderon. This group is managed at pillar/users/shellgroups.sls.

Block deployment

Code update doesn't occur if a LOCKED file exists.

So to block update from Git: touch /opt/odderon/LOCKED

To resume update: rm /opt/odderon/LOCKED

Reference

A walkthrough to prepare this SaltStack role has been documented: