Skip to content

Commit

Permalink
fix env vars and workdir
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed May 10, 2022
1 parent 32edb4c commit 2e34f41
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions renku/core/session/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# limitations under the License.
"""Docker based interactive session provider."""

import os.path
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Tuple, cast
from uuid import uuid4
Expand Down Expand Up @@ -166,19 +165,12 @@ def session_start(
if working_dir is None:
working_dir = "/home/jovyan"

work_dir = Path(working_dir) / "work"
work_dir = Path(working_dir) / "work" / project_name

environment = {}
volumes = [f"{str(client.path.resolve())}:{work_dir}"]

global_git_config_path = os.path.normpath(os.path.expanduser("~/.gitconfig"))

if os.path.exists(global_git_config_path):
volumes.append(f"{global_git_config_path}:{work_dir}/.gitconfig")
else:
user = client.repository.get_global_user()
environment["GIT_AUTHOR_NAME"] = user.name
environment["GIT_AUTHOR_EMAIL"] = user.email
user = client.repository.get_user()
environment = {"GIT_AUTHOR_NAME": user.name, "GIT_AUTHOR_EMAIL": user.email}

container = self.docker_client().containers.run(
image_name,
Expand Down

0 comments on commit 2e34f41

Please sign in to comment.