Skip to content
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

Release file cleanup and standardisation #3334

Open
sree-warrier opened this issue Sep 20, 2024 · 2 comments
Open

Release file cleanup and standardisation #3334

sree-warrier opened this issue Sep 20, 2024 · 2 comments

Comments

@sree-warrier
Copy link

Problem Statement

Where the release files are stored (Assuming it to the filestore(disk/buckets), please do correct if its are wrong) ?
How the release files are been cleaned ? While checking we found that with the retention we set is not doing the cleanup activity with releases. Any configuration referring to the release retentions ? Any standard practice to follow on release file maintenance, as its filling the disk.

Solution Brainstorm

NA

@bijancot
Copy link

Hi,

Do you have any information which services/container that data filling up your disk? Long time ago i have issue with the postgresql even after execute cleanup manually. It turns out in my case i need to also do a vacuum in purpose to reclaim the disk.

and if you want to set the retention period you can take a look at .env https://github.com/getsentry/self-hosted/blob/master/.env#L3 but you need to rerun install process and docker compose up i think for better result

Cheers
Baskoro

@webard
Copy link

webard commented Sep 22, 2024

Look at this issue #2313

Make docker-compose.override.yml with content below:

x-restart-policy: &restart_policy
  restart: unless-stopped
services:
  disk-cleanup:
    <<: *restart_policy
    image: sentry-cleanup-self-hosted-local
    build:
      context: ./cron
      args:
        BASE_IMAGE: sentry-self-hosted-local
    entrypoint: "/entrypoint.sh"
    command: '"0 0 * * * find /_data/files -type d -empty | xargs -r rmdir"'
    volumes:
      - sentry-data:/_data

  disk-cleanup-files:
    <<: *restart_policy
    image: sentry-cleanup-self-hosted-local
    build:
      context: ./cron
      args:
        BASE_IMAGE: sentry-self-hosted-local
    entrypoint: "/entrypoint.sh"
    environment:
      # Leaving the value empty to just pass whatever is set
      # on the host system (or in the .env file)
      SENTRY_EVENT_RETENTION_DAYS:
    command: '"0 30 * * * find /_data/files -type f -atime +$SENTRY_EVENT_RETENTION_DAYS -delete"'
    volumes:
      - sentry-data:/_data

and run ./install.sh to install new services. They will clean outdated files and empty directories every day. You can also manually run commands from services to see effects immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Status: No status
Development

No branches or pull requests

3 participants