Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
benofben authored Aug 19, 2022
2 parents 7f62803 + 2db714c commit 94f0731
Show file tree
Hide file tree
Showing 18 changed files with 1,204 additions and 1,364 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN apt-get update && \
python3 \
vim \
&& rm -rf /var/lib/apt/lists/* \
&& curl -O https://bootstrap.pypa.io/pip/3.7/get-pip.py \
&& curl -O https://bootstrap.pypa.io/pip/3.6/get-pip.py \
&& python3 get-pip.py

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
"metadata": {},
"source": [
"### Invoke just one of models 1000 times \n",
"Since the models will be in memory and loaded, these invocations will not have any latency \n"
"Since the models are in memory and loaded, these invocations should not have any latency \n"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def train():
'This usually indicates that the channel ({}) was incorrectly specified,\n' +
'the data specification in S3 was incorrectly specified or the role specified\n' +
'does not have permission to access the data.').format(training_path, channel_name))
raw_data = [ pd.read_csv(file, header=None) for file in input_files ]
raw_data = [ pd.read_csv(file, header=None) for file in input_files if file.endswith(".csv")]
train_data = pd.concat(raw_data)

# labels are in the first column
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
"# Build the docker image locally with the image name and then push it to ECR\n",
"# with the full name.\n",
"\n",
"docker build -t ${algorithm_name} .\n",
"docker build -t ${algorithm_name} .\n",
"docker tag ${algorithm_name} ${fullname}\n",
"\n",
"docker push ${fullname}"
Expand Down Expand Up @@ -315,9 +315,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# S3 prefix\n",
Expand Down Expand Up @@ -347,9 +345,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import sagemaker as sage\n",
Expand Down
26 changes: 25 additions & 1 deletion hyperparameter_tuning/r_bring_your_own/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,31 @@ RUN apt-get -y update && apt-get install -y --no-install-recommends \
r-base-dev \
ca-certificates

RUN R -e "install.packages(c('mda', 'plumber'), repos='https://cloud.r-project.org')"
RUN R -e "install.packages(c('Rcpp', 'BH', 'R6', 'jsonlite', 'crayon'), repos='https://cloud.r-project.org')"

RUN wget http://cran.r-project.org/src/contrib/Archive/stringi/stringi_1.2.4.tar.gz
RUN R CMD INSTALL stringi_1.2.4.tar.gz

RUN wget http://cran.r-project.org/src/contrib/Archive/rlang/rlang_0.2.2.tar.gz
RUN R CMD INSTALL rlang_0.2.2.tar.gz

RUN wget http://cran.r-project.org/src/contrib/Archive/magrittr/magrittr_1.5.tar.gz
RUN R CMD INSTALL magrittr_1.5.tar.gz

RUN wget http://cran.r-project.org/src/contrib/Archive/later/later_0.7.5.tar.gz
RUN R CMD INSTALL later_0.7.5.tar.gz

RUN wget http://cran.r-project.org/src/contrib/Archive/promises/promises_1.0.1.tar.gz
RUN R CMD INSTALL promises_1.0.1.tar.gz

RUN wget http://cran.r-project.org/src/contrib/Archive/httpuv/httpuv_1.4.4.2.tar.gz
RUN R CMD INSTALL httpuv_1.4.4.2.tar.gz

RUN wget http://cran.r-project.org/src/contrib/Archive/mda/mda_0.4-10.tar.gz
RUN R CMD INSTALL mda_0.4-10.tar.gz

RUN wget http://cran.r-project.org/src/contrib/Archive/plumber/plumber_0.4.6.tar.gz
RUN R CMD INSTALL plumber_0.4.6.tar.gz

COPY mars.R /opt/ml/mars.R
COPY plumber.R /opt/ml/plumber.R
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
")\n",
"\n",
"estimator = sagemaker.estimator.Estimator(\n",
" image_name=\"{}.dkr.ecr.{}.{}/rmars:latest\".format(account, region, domain),\n",
" image_uri=\"{}.dkr.ecr.{}.{}/rmars:latest\".format(account, region, domain),\n",
" role=role,\n",
" train_instance_count=1,\n",
" train_instance_type=\"ml.m4.xlarge\",\n",
Expand Down
Loading

0 comments on commit 94f0731

Please sign in to comment.