Re: [ccache] Shared ccache directory between docker containers

2016-02-08 Thread Anders Björklund
Ragnar Rova wrote:
> Thanks, i'll try it out. How stable is the memcached support?
>
>> It would also be interesting to test sharing a cache between containers
>> on different hosts, by using the "memcached" feature over the network:
>>
>> https://lists.samba.org/archive/ccache/2016q1/001394.html

It is ready for public testing, all known issues addressed:
https://github.com/jrosdahl/ccache/pull/58

An earlier version of it has been in production for years:
https://github.com/jrosdahl/ccache/pull/30


By default it will still use the file cache, just like before.
You have the option to only use memcached for storing objects.

We are looking for some more testers and for other feedback...
And there's a few minor tweaks being done, but nothing major.

/Anders
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Shared ccache directory between docker containers

2016-02-08 Thread Ragnar Rova
Thanks, i'll try it out. How stable is the memcached support?

On Mon, Feb 8, 2016 at 10:24 PM, Anders Björklund 
wrote:

> Ragnar Rova wrote:
> > Thanks, i'll try upgrading although I made sure hostname is unique now.
>
> >> Is it safe to share the ccache directory between docker containers wrt
> >> to locking?
>
> It would also be interesting to test sharing a cache between containers
> on different hosts, by using the "memcached" feature over the network:
>
> https://lists.samba.org/archive/ccache/2016q1/001394.html
>
> One method of doing so is mounting a moxi socket inside the container,
> to avoid it having to "know" about the rest of the memcached network...
>
> docker run -v /tmp/moxi.sock:/tmp/moxi.sock [...]
>
>
> Then you can access the memcached servers over this unix socket,
> while sharing the latest cache data in host memory when doing so.
>
> export MEMCACHED_SERVERS=/tmp/moxi.sock
> export CCACHE_MEMCACHED_CONF=--SOCKET=\"/tmp/moxi.sock\"
>
> You would need to start the host memcached proxy up first, though.
> And also to configure it with the cluster configuration (or URL):
>
> export MEMCACHED_SERVERS=localhost
> moxi -s /tmp/moxi.sock -d -z 11311=localhost:11211
>
> /Anders
>
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Shared ccache directory between docker containers

2016-02-08 Thread Anders Björklund
Ragnar Rova wrote:
> Thanks, i'll try upgrading although I made sure hostname is unique now.

>> Is it safe to share the ccache directory between docker containers wrt
>> to locking?

It would also be interesting to test sharing a cache between containers
on different hosts, by using the "memcached" feature over the network:

https://lists.samba.org/archive/ccache/2016q1/001394.html

One method of doing so is mounting a moxi socket inside the container,
to avoid it having to "know" about the rest of the memcached network...

docker run -v /tmp/moxi.sock:/tmp/moxi.sock [...]


Then you can access the memcached servers over this unix socket,
while sharing the latest cache data in host memory when doing so.

export MEMCACHED_SERVERS=/tmp/moxi.sock
export CCACHE_MEMCACHED_CONF=--SOCKET=\"/tmp/moxi.sock\"

You would need to start the host memcached proxy up first, though.
And also to configure it with the cluster configuration (or URL):

export MEMCACHED_SERVERS=localhost
moxi -s /tmp/moxi.sock -d -z 11311=localhost:11211

/Anders
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Shared ccache directory between docker containers

2016-02-06 Thread Joel Rosdahl
>
> Thanks, i'll try upgrading although I made sure hostname is unique now.
> Whats the mechanism for uniqueness in 3.2?


Using mkstemp .

-- Joel
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Shared ccache directory between docker containers

2016-02-06 Thread Ragnar Rova
Thanks, i'll try upgrading although I made sure hostname is unique now.
Whats the mechanism for uniqueness in 3.2?

On Sat, Feb 6, 2016 at 5:27 PM, Joel Rosdahl  wrote:

> Hi,
>
> On 5 February 2016 at 12:05, Ragnar Rova  wrote:
>
> Is it safe to share the ccache directory between docker containers wrt
>> to locking?
>
>
> I think so.
>
> ccache version 3.1.10
>> ccache: FATAL: Failed to open
>> /var/tmp/docker-build-ccache/tmp/tmp.cpp_stderr.docker-host.21810: No such
>> file or directory
>
>
> Yes, ccache 3.1.* and earlier rely on the tuple  being
> unique when creating temporary files. This has been fixed in the ccache 3.2
> series, so try upgrading if possible.
>
> -- Joel
>
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Shared ccache directory between docker containers

2016-02-06 Thread Joel Rosdahl
Hi,

On 5 February 2016 at 12:05, Ragnar Rova  wrote:

Is it safe to share the ccache directory between docker containers wrt
> to locking?


I think so.

ccache version 3.1.10
> ccache: FATAL: Failed to open
> /var/tmp/docker-build-ccache/tmp/tmp.cpp_stderr.docker-host.21810: No such
> file or directory


Yes, ccache 3.1.* and earlier rely on the tuple  being
unique when creating temporary files. This has been fixed in the ccache 3.2
series, so try upgrading if possible.

-- Joel
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Shared ccache directory between docker containers

2016-02-05 Thread Ragnar Rova
I made sure hostname is unique now.

On Fri, Feb 5, 2016 at 12:05 PM, Ragnar Rova  wrote:

> Hello list.
>
> Is it safe to share the ccache directory between docker containers wrt to
> locking?
>
> We use host mounts (i.e. not volumes) like this:
>
> docker run -v
> /var/tmp/docker-build-ccache:/var/tmp/docker-build-ccache my-compile-job
>
> We sometimes see issues when simultaneous jobs are run.
>
> docker storage Driver: aufs
> Backing Filesystem: extfs
> ccache version 3.1.10
>
> ccache: FATAL: Failed to open
> /var/tmp/docker-build-ccache/tmp/tmp.cpp_stderr.docker-host.21810: No such
> file or directory
>
> The hostname of these concurrent containers is the same. PID:s in docker
> are translated (they are in their own PID namespace).
>
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


[ccache] Shared ccache directory between docker containers

2016-02-05 Thread Ragnar Rova
Hello list.

Is it safe to share the ccache directory between docker containers wrt to
locking?

We use host mounts (i.e. not volumes) like this:

docker run -v
/var/tmp/docker-build-ccache:/var/tmp/docker-build-ccache my-compile-job

We sometimes see issues when simultaneous jobs are run.

docker storage Driver: aufs
Backing Filesystem: extfs
ccache version 3.1.10

ccache: FATAL: Failed to open
/var/tmp/docker-build-ccache/tmp/tmp.cpp_stderr.docker-host.21810: No such
file or directory

The hostname of these concurrent containers is the same. PID:s in docker
are translated (they are in their own PID namespace).
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache