Skip to content

Commit

Permalink
Mount artifacts to /tmp to avoid permissions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
judahrand committed Sep 8, 2021
1 parent e58aff7 commit 6cc4d03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions sdk/python/kfp/v2/components/types/artifact_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions v2/component/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 6cc4d03

Please sign in to comment.