Skip to content

Commit

Permalink
Update deployment to v2.0.2 (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
clementbiron authored Sep 12, 2024
1 parent 950eb6a commit a33be6d
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 56 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ jobs:
known_hosts: ${{ steps.get_hostname.outputs.result }} ssh-ed25519 ${{ steps.get_fingerprint.outputs.result }}
- run: echo "${{ secrets.ANSIBLE_VAULT_KEY }}" > deployment/vault.key
- run: pip install --upgrade setuptools
- run: pip install 'ansible ~= 2.9'
- run: pip install 'ansible ~= 9.4.0'
- name: Install dependencies
working-directory: ./deployment
run: ansible-galaxy collection install -p ./ -r requirements.yml --force
- name: Deploy
working-directory: ./deployment
run: ansible-playbook ./ansible_collections/opentermsarchive/deployment/playbooks/engine/all.yml


run: ansible-playbook ./ansible_collections/opentermsarchive/deployment/playbooks/deploy.yml
17 changes: 17 additions & 0 deletions deployment/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$ANSIBLE_VAULT;1.1;AES256
65356533346235306166623535626363373731396236306161643130643836636165346630356561
6636323862383062373135313734343530623232663130360a616666626432303033383731326265
65343935653061356534336333323064623063343065633134313839343137303062313631363865
3935363164316336300a353938616435386632613535643162666164393961656631623836313762
32393663613034623566663266323261373066313066656634633832323533356335333465343431
37323363323264613339646266616237343065636338303165386637393035376437653638383537
66373630333136373766303438656639336639376132633134626666343636626432303037626139
62333637303064383766363862633263333962303633343738363663643837393762326262303133
65313563373461383866653036653631356331343630373562343831623536643438633838383839
39366466636337323832346430316431343036663162376537633538613861633363363538326464
34633038366432316534363335626165313631303463373266666665383934656236396635346331
65316664636562386332346163386364626530636430636364666264633033356239656361666564
61366639376235363530323338663036656661396262633437376363666637363134663764643963
33643330343363333962653662383332633937356361663664643163646166373061663937303463
37353039373534613839363464643964336330316164363136653034353564376138363764666365
64393962363062373330
26 changes: 26 additions & 0 deletions deployment/github-bot-private-key
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
$ANSIBLE_VAULT;1.1;AES256
62303636653439396135376462623133643365306632653931636139376335613763363662636631
6665343134353438346363346438396131363535303130380a383166623063623133386332353464
38646234636464636336663562656666313634396633323966343961333264623965356139303066
6563646435356237640a363435316164323363383539356138363235633836636639373666623866
66666565663238373066333237386636326130626362656363353031646165313030313865383432
66346334623437376435393366353835643331313630346631646464353763626132666165353534
63336661643732353330363665376433633332613831336334613430653339303438303666316262
32633138316232393338663633363338383635373038323934323735313561306366393930396333
30663134393563313766376630623438333833623565656439316362303436623631613163613761
65653233623031383066656534393263353964363634653137646234316464393735333630656530
66623866336235393534323735326231373632663235383736343736393534616362343663323264
65313132393435336664636333346631363132303766376562303165623864383137646164343766
63316134363362323538376631323330373630313233323830393234656534363362643039326436
64393836393865303932343265643334323337356637656266363864313435656635323362313438
39333839646530633733326463613032316134643536346138313230636330303531653237363738
33326336653263643334633135323766616263373730306163303530343964353865646239643466
36313865633533663162623438616633323331323630633233356566353330326439316237353137
63646264386334323066633562373236643361653538376436353636363063383338306337643737
30663530306633366337376365636431356534366130653535323237613039623833383266343561
64373063656430326332336434353931383662636335336338363936653736356531313135623232
64386530353464313838396534333366623038376163663236663332633037356532326162666131
34393965663234323863646533633861646534303031623862393932373065646336643063643430
34303833343162313165626462633837623465353430393235313463626138616666393662356433
61366433316363656232343732363634363163333061316165626535346235633566326233363663
37323430613838366264633136663865306666626137323334313931393539663466
54 changes: 3 additions & 51 deletions deployment/inventory.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,6 @@
all:
hosts:
102.68.86.97:
102.68.86.60:
ansible_user: debian
ed25519_fingerprint: AAAAC3NzaC1lZDI1NTE5AAAAIOeCl8kNJyh3e+a7msAw7hKbpXDoZs1D2GhvdvnmGi1q
ota_engine_github_bot_private_key: !vault |
$ANSIBLE_VAULT;1.1;AES256
36613863663531613731303538393562623364356365386662623263373130666664373739356462
3239653031623633363531373132653365626365626634620a303931613431356137323830373163
63393565373931316564616163316236613135336136353033373332333965303536343837313934
6432343833613739660a396364396334343661626161363838353831303865656430623833623036
31656564636135356463646634653966666432386363303439626263623233363437356139336534
65613032643030393361663635383632343661623763386263626566626332303837646135646631
38626161303538323639626432666133623031653734396430366334666564356434666464393430
65333333616530646266363733363864353538323739356565366138313936653539623639363664
66653930633131633037613966353932633836613465343635363631396535306463663233356137
38396366346630313135613330666435366433393366643633666338323735346565653165313462
65663962373465636634633732343133353561363663613036656338383965353834636331643830
61333661376663643131653732636231643962333831636336373037616665346536663061653665
35336636333233333665353934373032616237363463616162333331613038666664646463356561
30643861383236373866356262623466353066376530626233616339303738373738633636656464
64373430643334303531636136326666346464306533356131326635303033323963353231663430
62376532333533396430383239646635303035316162636532376466356637333961316233373533
32626336303531663262303734303439643836616161633936383333393839633032343938386532
33376234613836313731633236643430333737633238316466666430386234633463613634313831
37633566373865316331393733303861633766356166336263393464636561633635396333653330
31616234326563666437313736373738373266626364306634383535626336353833336262666137
61613731636161616337363639303130333164663437613537376133333832643433393565353162
35353162316561643235326137323835363731666232376264303130383761336437643334303337
36373135313639323738303237383934636662373338316162666235663332356234336164363534
37616131653632623235666438663939353430383030626466323739323963633338633061373261
64323165393838383232393833376365623930666533653361643962313535663230
ota_engine_github_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
35636536396231623536323632613738623936343535396631613764653361663062396163393034
6335326163323937666131383563313561613035313537340a323931313061366339623163373966
62376532643231303537383032663439323930353238333234373264666630306366636430373332
6162396336316331630a616135613362656666613961613138373339663565373163653966393734
30313034366139323436623764623939656361643034616534653765303164386332666636653834
36363766346238353335383831333566313430333838333666626235333131666566313634333333
37663739636263666661303435666261313630653366316236346136313130363462303532323930
39633231626461353833633637616161616430363264656332633430383166613939643863643362
3638
ota_engine_smtp_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
39333238353666653635376431313832616431336263343133316530633864643964343061316161
3534323136653565653236393762643036656237643765630a373934613361666633393832653038
37343464633735333964313563393336623834326565346331656533636539333966626662333064
3533353532643264300a373637383566623432643430663132616166373962653832366533343466
64316239373862316530616433316665653963383138303036303730613338633233326335323864
38346463323631623336366638326461646233623565643764303137393265313938373437363166
39643138316664333664396561373963636464323936343762383730303963346565353566373137
61333966653830396663623537626134363837383637336432366165346238636162353036366563
6535
ed25519_fingerprint: AAAAC3NzaC1lZDI1NTE5AAAAINnSDBBNBbvx6kDqFkn9o/oRMcIe1R5i0JNN+2TwQwlj
ota_source_repository: https://github.com/OpenTermsArchive/kenya-declarations.git
30 changes: 30 additions & 0 deletions deployment/pm2.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
apps: [
{
name: 'ota',
script: 'npm',
args: 'run start:schedule',
max_restarts: 2,
min_uptime: '1h', // Set a relatively high duration (more than the longest run) so that restarts that occur before this duration has elapsed are considered unstable.
restart_delay: 3 * 60 * 60 * 1000, // likely related to a connectivity problem that will take some time to be fixed
},
{
name: 'ota-collection-api',
script: 'npm',
args: 'run start:collection-api',
min_uptime: '10s',
max_restarts: 10,
restart_delay: 1000,
exponential_backoff_restart_delay: true
},
{
name: 'ota-release',
script: 'npm',
args: 'run dataset:schedule',
min_uptime: '10s',
max_restarts: 10,
restart_delay: 60 * 60 * 1000, // likely related to a GitHub availability problem that will take some time to be fixed
exponential_backoff_restart_delay: true
}
],
};
2 changes: 1 addition & 1 deletion deployment/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
collections:
- name: opentermsarchive.deployment
version: 1.1.1
version: 2.0.2

0 comments on commit a33be6d

Please sign in to comment.