当我在使用自定义容器部署的sagemaker中调用端点/批处理作业时,我想在S3中存储一些信息。
例如,在此图像中
在“部署/托管”中,我想将一些对象放入S3容器中,而不仅要读取/ opt / model
在plumber.R函数中,我想:
function(req) {
# Setup locations
prefix <- '/opt/ml'
model_path <- paste(prefix, 'model', sep='/')
# Bring in model file and factor levels
load(paste(model_path, 'mars_model.RData', sep='/'))
# Read in data
conn <- textConnection(gsub('\\\\n', '\n', req$postBody))
data <- read.csv(conn)
close(conn)
# Convert input to model matrix
scoring_X <- model.matrix(~., data, xlev=factor_levels)
####
SAVE OBJECT IN S3
#####
# Return prediction
return(paste(predict(mars_model, scoring_X, row.names=FALSE), collapse=','))}
我该如何实现?使用aws.s3连接到容器还是其他技术?
编辑:直接在容器内部连接的aws.s3解决方案似乎不起作用