From 6cc4d0389d8e1a71f90704834dec3e51a6849a82 Mon Sep 17 00:00:00 2001 From: Judah Rand <17158624+judahrand@users.noreply.github.com> Date: Wed, 8 Sep 2021 16:54:22 +0100 Subject: [PATCH] Mount artifacts to `/tmp` to avoid permissions Custom base images may be built specificallly to avoid granting root privileges. Without these privileges the local mount points cannot be created if they live at the root of the filesystem. --- sdk/python/kfp/v2/components/types/artifact_types.py | 6 +++--- v2/component/launcher.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/python/kfp/v2/components/types/artifact_types.py b/sdk/python/kfp/v2/components/types/artifact_types.py index d3f027f275a6..f4c7f03ef273 100644 --- a/sdk/python/kfp/v2/components/types/artifact_types.py +++ b/sdk/python/kfp/v2/components/types/artifact_types.py @@ -19,9 +19,9 @@ import os from typing import Dict, Generic, List, Optional, Type, TypeVar, Union -_GCS_LOCAL_MOUNT_PREFIX = '/gcs/' -_MINIO_LOCAL_MOUNT_PREFIX = '/minio/' -_S3_LOCAL_MOUNT_PREFIX = '/s3/' +_GCS_LOCAL_MOUNT_PREFIX = '/tmp/gcs/' +_MINIO_LOCAL_MOUNT_PREFIX = '/tmp/minio/' +_S3_LOCAL_MOUNT_PREFIX = '/tmp/s3/' class Artifact(object): diff --git a/v2/component/launcher.go b/v2/component/launcher.go index 23fa18e9b656..07738aaa455a 100644 --- a/v2/component/launcher.go +++ b/v2/component/launcher.go @@ -652,13 +652,13 @@ func (l *Launcher) generateOutputURI(name string) string { func localPathForURI(uri string) (string, error) { if strings.HasPrefix(uri, "gs://") { - return "/gcs/" + strings.TrimPrefix(uri, "gs://"), nil + return "/tmp/gcs/" + strings.TrimPrefix(uri, "gs://"), nil } if strings.HasPrefix(uri, "minio://") { - return "/minio/" + strings.TrimPrefix(uri, "minio://"), nil + return "/tmp/minio/" + strings.TrimPrefix(uri, "minio://"), nil } if strings.HasPrefix(uri, "s3://") { - return "/s3/" + strings.TrimPrefix(uri, "s3://"), nil + return "/tmp/s3/" + strings.TrimPrefix(uri, "s3://"), nil } return "", fmt.Errorf("failed to generate local path for URI %s: unsupported storage scheme", uri) }