-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
store: setting retention policy in size for test stage #30
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Alexis Pentori <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it be difficult to have % of actual volume size on host?
Would be great to have the same for infra-waku
!
@@ -44,7 +44,7 @@ nim_waku_store_message_db_name: 'nim-waku' | |||
nim_waku_store_message_db_user: 'nim-waku' | |||
nim_waku_store_message_db_pass: '{{lookup("bitwarden", "fleets/shards/"+stage+"/db/nim-waku")}}' | |||
nim_waku_store_message_db_url: 'postgres://{{ nim_waku_store_message_db_user}}:{{ nim_waku_store_message_db_pass}}@store-db-01.{{ ansible_domain }}.wg:5432/{{nim_waku_store_message_db_name}}' | |||
nim_waku_store_message_retention_policy: 'time:2592000' # 30 days | |||
nim_waku_store_message_retention_policy: '{{ "size:80GB" if stage == "test" else "time:2592000" }}' # 30 days for staging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anton is right, we can get actual volume size from ansible_mounts
, you can access it by mount point or device path and then use size_available
. Here's some example data:
ok: [store-01.gc-us-central1-a.shards.staging] => {
"ansible_mounts": [
{
"block_available": 1309037,
"block_size": 4096,
"block_total": 3763585,
"block_used": 2454548,
"device": "/dev/root",
"fstype": "ext4",
"inode_available": 1788632,
"inode_total": 1935360,
"inode_used": 146728,
"mount": "/",
"options": "rw,relatime,discard,errors=remount-ro",
"size_available": 5361815552,
"size_total": 15415644160,
"uuid": "f1be01a0-d90a-4f70-b85c-02f77635760d"
},
{
"block_available": 201292,
"block_size": 512,
"block_total": 213663,
"block_used": 12371,
"device": "/dev/sda15",
"fstype": "vfat",
"inode_available": 0,
"inode_total": 0,
"inode_used": 0,
"mount": "/boot/efi",
"options": "rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro",
"size_available": 103061504,
"size_total": 109395456,
"uuid": "8EA5-EDF8"
}
]
}
You can see an example of how I access it here:
https://github.com/status-im/infra-ci/blob/d3d69e520f147da2807741e1b25afe7bf6d59dda/ansible/cleanup.yml#L5
Change to avoid LowDiskSpace Issue