mirror of
https://github.com/0x1d/drift-keeper.git
synced 2025-12-14 18:35:20 +01:00
Minimize cloud-init config
This commit is contained in:
56
cloud-init/cloud-config-small.yaml
Normal file
56
cloud-init/cloud-config-small.yaml
Normal file
@@ -0,0 +1,56 @@
|
||||
#cloud-config
|
||||
groups:
|
||||
- ubuntu: [root,sys]
|
||||
- docker
|
||||
- bot
|
||||
|
||||
users:
|
||||
- default
|
||||
- name: keeper
|
||||
gecos: keeper
|
||||
shell: /bin/bash
|
||||
primary_group: bot
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
groups: users, admin, docker
|
||||
lock_passwd: false
|
||||
|
||||
packages:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg-agent
|
||||
- software-properties-common
|
||||
- chrony
|
||||
- docker.io
|
||||
- docker-compose
|
||||
|
||||
ntp:
|
||||
enabled: true
|
||||
ntp_client: chrony
|
||||
servers:
|
||||
- ${ntp_server}
|
||||
|
||||
runcmd:
|
||||
- systemctl stop snapd && systemctl disable snapd
|
||||
- git clone https://github.com/0x1d/drift-keeper /app/bot
|
||||
- cp -rT /transfer /app/bot && rm -rf /transfer
|
||||
- chown -R keeper:bot /app/bot
|
||||
- cd /app/bot && sudo -u keeper -g bot -- docker-compose up -d
|
||||
|
||||
write_files:
|
||||
- path: /transfer/.env
|
||||
encoding: b64
|
||||
owner: root:root
|
||||
permissions: '0750'
|
||||
content: ${env_file}
|
||||
- path: /transfer/config.yaml
|
||||
encoding: b64
|
||||
owner: root:root
|
||||
permissions: '0750'
|
||||
content: ${config_file}
|
||||
- path: /transfer/docker-compose.yaml
|
||||
encoding: b64
|
||||
owner: root:root
|
||||
permissions: '0750'
|
||||
content: ${docker_compose_file}
|
||||
|
||||
@@ -32,7 +32,7 @@ ntp:
|
||||
|
||||
runcmd:
|
||||
- systemctl stop snapd && systemctl disable snapd
|
||||
- git clone -b feature/scaling https://github.com/0x1d/drift-keeper /app/bot
|
||||
- git clone https://github.com/0x1d/drift-keeper /app/bot
|
||||
- cp -rT /transfer /app/bot && rm -rf /transfer
|
||||
- chown -R keeper:bot /app/bot
|
||||
- cd /app/bot && sudo -u keeper -g bot -- docker-compose up -d
|
||||
|
||||
7
main.tf
7
main.tf
@@ -1,4 +1,9 @@
|
||||
terraform {
|
||||
backend "consul" {
|
||||
address = "sophon:8500"
|
||||
scheme = "http"
|
||||
path = "terraform/drift-keeper"
|
||||
}
|
||||
required_providers {
|
||||
linode = {
|
||||
source = "linode/linode"
|
||||
@@ -29,7 +34,7 @@ locals {
|
||||
prometheus_password_bcrypt = bcrypt(var.monitoring.prometheus_password)
|
||||
}))
|
||||
}
|
||||
cloud_config = { for s in concat(var.linode_instances, var.digitalocean_instances) : s.label => templatefile("cloud-init/cloud-config.yaml", {
|
||||
cloud_config = { for s in concat(var.linode_instances, var.digitalocean_instances) : s.label => templatefile("cloud-init/cloud-config-small.yaml", {
|
||||
ntp_server = s.ntp_server
|
||||
env_file = base64encode(templatefile("templates/bot/env.tpl", merge(var.bot, {
|
||||
jito_block_engine_url = s.jito_block_engine_url
|
||||
|
||||
@@ -43,7 +43,7 @@ global:
|
||||
# end after the deposit transaction is sent
|
||||
#forceDeposit: 1000
|
||||
|
||||
websocket: false # use websocket for account loading and events (limited support)
|
||||
websocket: true # use websocket for account loading and events (limited support)
|
||||
eventSubscriber: false # disables event subscriber (heavy RPC demand), this is primary used for counting fills
|
||||
runOnce: false # Set true to run once and exit, useful for testing or one off bot runs
|
||||
debug: false # Enable debug logging
|
||||
|
||||
Reference in New Issue
Block a user