tar_and_upload_dir: Package source files and uploads a compress tar file to S3.

View source: R/fw_utils.R

tar_and_upload_dirR Documentation

Package source files and uploads a compress tar file to S3.

Description

Package source files and upload a compress tar file to S3. The S3 location will be “s3://<bucket>/s3_key_prefix/sourcedir.tar.gz“. If directory is an S3 URI, an UploadedCode object will be returned, but nothing will be uploaded to S3 (this allow reuse of code already in S3). If directory is None, the script will be added to the archive at “./<basename of script>“. If directory is not None, the (recursive) contents of the directory will be added to the archive. directory is treated as the base path of the archive, and the script name is assumed to be a filename or relative path inside the directory.

Usage

tar_and_upload_dir(
  sagemaker_session,
  bucket,
  s3_key_prefix,
  script,
  directory = NULL,
  dependencies = NULL,
  kms_key = NULL
)

Arguments

sagemaker_session

(sagemaker.Session): sagemaker_session session used to access S3.

bucket

(str): S3 bucket to which the compressed file is uploaded.

s3_key_prefix

(str): Prefix for the S3 key.

script

(str): Script filename or path.

directory

(str): Optional. Directory containing the source file. If it starts with "s3://", no action is taken.

dependencies

(List[str]): Optional. A list of paths to directories (absolute or relative) containing additional libraries that will be copied into /opt/ml/lib

kms_key

(str): Optional. KMS key ID used to upload objects to the bucket (default: None).

Value

sagemaker.fw_utils.UserCode: An object with the S3 bucket and key (S3 prefix) and script name.


DyfanJones/sagemaker-r-local documentation built on June 14, 2022, 10:32 p.m.