[
https://issues.apache.org/jira/browse/MESOS-7405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15977703#comment-15977703
]
Gilbert Song commented on MESOS-7405:
-------------------------------------
[~tillt], please let me know if the following logic in your isolator can
resolve the issue of setting environment variables correctly:
{noformat}
// Determine the correct sandbox directory with/without a rootfs.
const string directory = containerConfig.has_rootfs()
? flags.sandbox_directory
: containerConfig.directory();
env["YOUR_ENV_VAR"] = path::join(directory,
containerConfig.container_info().volumes(0).container_path());
{noformat}
> Allow isolators to render mapped sandbox specific environment variables.
> ------------------------------------------------------------------------
>
> Key: MESOS-7405
> URL: https://issues.apache.org/jira/browse/MESOS-7405
> Project: Mesos
> Issue Type: Bug
> Components: agent, containerization, isolation
> Reporter: Till Toenshoff
>
> Within the mesos-containerizer, isolators are responsible for preparing the
> containerized context for an executor by implementing
> [{{prepare}}|https://github.com/apache/mesos/blob/253c89483cb6e31225a1f55449ff88c676030eec/include/mesos/slave/isolator.hpp#L68-L70].
> Part of such preparation may e.g. be sandbox mutations within the root
> filesystem as well as rendering environment variables returned via the
> optionally returned
> [{{ContainerLaunchInfo}}|https://github.com/apache/mesos/blob/253c89483cb6e31225a1f55449ff88c676030eec/include/mesos/slave/containerizer.proto#L164].
> IIUC currently it seems to not be possible to have an isolator setup
> environment variables pointing to mapped locations within the sandbox path as
> that path gets determined after all isolators did their preparation.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)