qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Lukáš Doktor" <ldoktor@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	avocado-devel <avocado-devel@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Willian Rampazzo" <wrampazz@redhat.com>
Subject: Re: [Avocado-devel] How to set a limit and clear Avocado cache?
Date: Wed, 22 Jan 2020 07:37:13 +0100	[thread overview]
Message-ID: <8bf0f889-dea9-ae5d-e66f-efebc3ac0297@redhat.com> (raw)
In-Reply-To: <de831637-040b-d182-2f46-e833fead575b@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 2453 bytes --]

Dne 21. 01. 20 v 10:15 Philippe Mathieu-Daudé napsal(a):
> Hello,
> 
> Today I ran out of space in my /home, I ran the 'baobab' tool and while the first bigger directory was obvious to me (~/.ccache), the second wasn't: ~/avocado/data/cache/by_location/, with various GiB.
> 
> Note, this directory is not listed in my config...
> $ avocado config | fgrep ${HOME}/avocado
> $
> 
> I might already have asked on qemu-devel mailing list, but is there a way to set a particular location for the cache directory, different than my data directory where I keep the job-results log files?
> 

Hello Philippe,

yes, the cache dirs can be specified in the config files in `[datadir.paths]` section via `cache_dirs = ['/some/location', '/other/location']`. The simplest way is to put this to `~/.config/avocado/avocado.conf` (or to `$VIRTUAL_ENV/.config/avocado/avocado.conf` in case you use virtual env).

The default is `data_dir/cache` (therefor usually `~/avocado/cache`) and when it's not specified in the custom cache_dirs it is appended to the list of available cache_dirs. When writing assets we go through the cache_dirs attempting to write them to the first RW location proceeding to the next one.

> From the doc, get_cache_dirs() "Returns the list of cache dirs, according to configuration and convention" but doesn't explain how to configure it:
> https://avocado-framework.readthedocs.io/en/75.1/api/core/avocado.core.html#avocado.core.data_dir.get_cache_dirs
> 

PRs are welcome.

> I searched if there was an Avocado command displaying cache use, and to eventually flush it, like ccache --cleanup/--clear options, but couldn't find any, so I ended calling a rmdir ~/avocado, which I know it is not correct, but saved me some headaches.
> 

I'm not aware of any such option, we only support asset expiration and IIRC it only replaces the file on use. Willian do you know if there are any plans for this? Can it be included to the asset handler?

> Is there a clean way to do this?
> 
> I see the clean_tmp_files() function, but no equivalent for the cache:
> https://avocado-framework.readthedocs.io/en/75.1/api/core/avocado.core.html#avocado.core.data_dir.clean_tmp_files
> 
> Bonus question, can I set a size limit for the cache directory?
> 

The same here, shouldn't be hard to add to the asset handler or at least contrib script. (again, PRs welcome)

> Thanks,
> 
> Phil.
> 

Regards,
Lukáš


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2020-01-22  6:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21  9:15 How to set a limit and clear Avocado cache? Philippe Mathieu-Daudé
2020-01-22  6:37 ` Lukáš Doktor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bf0f889-dea9-ae5d-e66f-efebc3ac0297@redhat.com \
    --to=ldoktor@redhat.com \
    --cc=avocado-devel@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wrampazz@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).