[
https://issues.apache.org/jira/browse/MESOS-3413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14900025#comment-14900025
]
haosdent commented on MESOS-3413:
---------------------------------
[~neunhoef] No sure I understand your ideas correct or not. Let me show how I
use persistent volumes in docker below.
I need set the volume info correctly in ContainerInfo, so that docker executor
would mount the persistent volumes. Suppose we have already set up a "path1"
persistent volume correctly.
{code}
ContainerInfo::DockerInfo dockerInfo;
dockerInfo.set_image("busybox");
Volume* dockerVolume = containerInfo.add_volumes();
dockerVolume->set_host_path("path1");
dockerVolume->set_container_path("/path2");
dockerVolume->set_mode(Volume::RW);
containerInfo.mutable_docker()->CopyFrom(dockerInfo);
{code}
We could found the docker executor would mount the "path1" to "/path2" in
docker docker. I got below log from executor stderr file.
{code}
docker -v
/tmp/xxxx/slaves/db206124-6d5f-493b-8b72-fdfbf65ed744-S0/frameworks/db206124-6d5f-493b-8b72-fdfbf65ed744-0000/executors/1/runs/88cc5c49-50bd-4bab-9e74-f23c43504906/path1:/path2:rw
-v
/tmp/xxxx/slaves/db206124-6d5f-493b-8b72-fdfbf65ed744-S0/frameworks/db206124-6d5f-493b-8b72-fdfbf65ed744-0000/executors/1/runs/88cc5c49-50bd-4bab-9e74-f23c43504906:/mnt/mesos/sandbox
--net host --entrypoint /bin/sh --name
mesos-db206124-6d5f-493b-8b72-fdfbf65ed744-S0.88cc5c49-50bd-4bab-9e74-f23c43504906
busybox -c ls /
{code}
>From executor stdout file, because I run "ls /" command we also could see the
>/path2 exists.
{code}
Starting task 1
bin
dev
etc
home
lib
lib64
linuxrc
media
mnt
opt
path2
proc
root
run
sbin
sys
tmp
usr
var
{code}
> Docker containerizer does not symlink persistent volumes into sandbox
> ---------------------------------------------------------------------
>
> Key: MESOS-3413
> URL: https://issues.apache.org/jira/browse/MESOS-3413
> Project: Mesos
> Issue Type: Bug
> Components: containerization, docker, slave
> Affects Versions: 0.23.0
> Reporter: Max Neunhöffer
> Assignee: haosdent
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> For the ArangoDB framework I am trying to use the persistent primitives.
> nearly all is working, but I am missing a crucial piece at the end: I have
> successfully created a persistent disk resource and have set the persistence
> and volume information in the DiskInfo message. However, I do not see any way
> to find out what directory on the host the mesos slave has reserved for us. I
> know it is ${MESOS_SLAVE_WORKDIR}/volumes/roles/<myRole>/<NAME>_<UUID> but we
> have no way to query this information anywhere. The docker containerizer does
> not automatically mount this directory into our docker container, or symlinks
> it into our sandbox. Therefore, I have essentially no access to it. Note that
> the mesos containerizer (which I cannot use for other reasons) seems to
> create a symlink in the sandbox to the actual path for the persistent volume.
> With that, I could mount the volume into our docker container and all would
> be well.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)