Title: | Build 'Docker Images' in 'Amazon SageMaker Studio' using 'Amazon Web Service CodeBuild' |
---|---|
Description: | Allows users to easily build custom 'docker images' <https://docs.docker.com/> from 'Amazon Web Service Sagemaker' <https://aws.amazon.com/sagemaker/> using 'Amazon Web Service CodeBuild' <https://aws.amazon.com/codebuild/>. |
Authors: | Dyfan Jones [aut, cre] |
Maintainer: | Dyfan Jones <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.4 |
Built: | 2024-10-29 03:46:17 UTC |
Source: | https://github.com/DyfanJones/sm-docker |
AWS ARN
execution role from AWS SageMaker
Return the AWS ARN
execution role
from AWS SageMaker
sagemaker_get_execution_role()
sagemaker_get_execution_role()
Character containing the AWS ARN
role retrieved from AWS SageMaker
AWS CodeBuild
to build docker images and push them to Amazon ECR
This function takes a directory containing a
dockerfile, and builds it on
AWS CodeBuild
. The resulting image is
then stored in AWS ECR
for later use.
sm_build( repository = NULL, compute_type = c("BUILD_GENERAL1_SMALL", "BUILD_GENERAL1_MEDIUM", "BUILD_GENERAL1_LARGE", "BUILD_GENERAL1_2XLARGE"), role = NULL, dir = ".", bucket = NULL, vpc_id = NULL, subnet_ids = list(), security_group_ids = list(), log = TRUE, ... )
sm_build( repository = NULL, compute_type = c("BUILD_GENERAL1_SMALL", "BUILD_GENERAL1_MEDIUM", "BUILD_GENERAL1_LARGE", "BUILD_GENERAL1_2XLARGE"), role = NULL, dir = ".", bucket = NULL, vpc_id = NULL, subnet_ids = list(), security_group_ids = list(), log = TRUE, ... )
repository |
(character): The |
compute_type |
(character): The |
role |
(character): The |
dir |
(character): Directory to build |
bucket |
(character): The S3 bucket to use for sending data to |
vpc_id |
(character): The Id of the |
subnet_ids |
(list): List of |
security_group_ids |
(list): List of security group ids for
the |
log |
(logical): Show the logs of the running |
... |
docker build parameters
https://docs.docker.com/engine/reference/commandline/build/#options
(NOTE: use "_" instead of "-" for example: docker optional parameter
|
invisible character vector of AWS ECR
image uri
.
## Not run: # Execute on current directory. sm_build() # Execute on different directory. sm_build(dir = "my-project") # Add extra docker arguments sm_build( file = "/path/to/Dockerfile", build_arg = "foo=bar" ) ## End(Not run)
## Not run: # Execute on current directory. sm_build() # Execute on different directory. sm_build(dir = "my-project") # Add extra docker arguments sm_build( file = "/path/to/Dockerfile", build_arg = "foo=bar" ) ## End(Not run)
paws
config
across smdocker
packageThis function sets up paws
client config list for all AWS
calls.
This function only needs to be used when changing default settings when
connecting to AWS
.
smdocker_config( aws_access_key_id = NULL, aws_secret_access_key = NULL, aws_session_token = NULL, region_name = NULL, profile_name = NULL, disable_ssl = FALSE, anonymous = FALSE, refresh = FALSE, ... )
smdocker_config( aws_access_key_id = NULL, aws_secret_access_key = NULL, aws_session_token = NULL, region_name = NULL, profile_name = NULL, disable_ssl = FALSE, anonymous = FALSE, refresh = FALSE, ... )
aws_access_key_id |
(character): AWS access key ID |
aws_secret_access_key |
(character): AWS secret access key |
aws_session_token |
(character): AWS temporary session token |
region_name |
(character): Default region when creating new connections |
profile_name |
(character): The name of a profile to use. If not given, then the default profile is used. |
disable_ssl |
(logical): Whether or not to use |
anonymous |
(logical): Set up anonymous credentials when connecting to |
refresh |
(logical): Refresh cached smdocker |
... |
Other parameters within |
Invisible list, containing credentials for paws
clients.
ecr codebuild sagemaker cloudwatchlogs iam sts s3
# Set up connection using profile smdocker_config(profile_name = "smdocker_example") # Reset connection to connect to a different region smdocker_config( profile_name = "smdocker_example", region_name = "us-east-1", refresh = TRUE )
# Set up connection using profile smdocker_config(profile_name = "smdocker_example") # Reset connection to connect to a different region smdocker_config( profile_name = "smdocker_example", region_name = "us-east-1", refresh = TRUE )
Ability to configure smdocker logging system, through the use of smdocker
helper function smdocker_log
or R:base
options
function. options
configurable
parameters:
smdocker.log_level
(integer): The minimum log level that should be tracked
smdocker.log_file
(character): path for logs to populate, default output logs to console.
smdocker.log_timestamp_fmt
(character): see format.POSIXct()
smdocker_log( level = 3L, file = "", timestamp_fmt = "%Y-%m-%d %H:%M:%OS3" )
smdocker_log( level = 3L, file = "", timestamp_fmt = "%Y-%m-%d %H:%M:%OS3" )
level |
(integer): the level logging threshold.
|
file |
(character): path for logs to populate, default output logs to console. |
timestamp_fmt |
(character): timestamp format, see |
NULL
invisible
## Not run: # log to a file temp_file <- tempfile() smdocker_log(file = temp_file) # change log threshold to INFO smdocker_log(level = 3L) # reset to default config smdocker_log() # options() equivalents: # log to a file temp_file <- tempfile() options(smdocker.log_file = temp_file) # change log threshold to INFO options(smdocker.log_level = 3L) ## End(Not run)
## Not run: # log to a file temp_file <- tempfile() smdocker_log(file = temp_file) # change log threshold to INFO smdocker_log(level = 3L) # reset to default config smdocker_log() # options() equivalents: # log to a file temp_file <- tempfile() options(smdocker.log_file = temp_file) # change log threshold to INFO options(smdocker.log_level = 3L) ## End(Not run)