0

This is my lifecycle configuration for the Notebook but raster fails in the install step....

I have taken some recommendations from the following thread where they install dependencies related to geospatial processing but without much success

github thead

I am also incorporating EPEL, which aws recommends for these cases.

sudo -b  yum --enablerepo=epel

I install all the libraries in the conda R environment

set -e
# OVERVIEW
# This script installs a single conda R package (bigmemory) in SageMaker R environment.
# To install an R package with conda, the package needs to be prefixed with 'r-'. For example, to install the package `shiny`, run 'conda install -c r r-shiny'.
 
nohup sudo -b -u ec2-user -i <<'EOF'

nohup sudo -b  yum --enablerepo=epel


# First, we need to install the lustre-client libraries
# https://stackoverflow.com/questions/20923209/problems-installing-the-devtools-package
nohup sudo -b yum install -y \
    libgeos \
    libgdal-dev \
    libgeos-dev \
    libproj-dev \
    libgdal-devel \
    libgeos-devel \
    libproj-devel \
    libcurl \
    libcurl-devel \
    openssl-devel \
    libxml2-devel  

echo "PASS STAGE 1 "

# libgdal1 libgdal1-dev libgeos libgeos-dev
source activate R

nohup conda install -y -c r r-binutils &
nohup conda install -y -c r r-libgit2 & 
nohup conda install -y -c r r-libxml2-devel &  

nohup conda install -y -c r r-devtools   &

nohup conda install -y -c r r-remotes   &
nohup conda install -y -c r r-units   &
nohup conda install -y -c r r-sf    &
nohup conda install -y -c r r-terra   &
nohup conda install -y -c r r-spData  &
nohup conda install -y -c r r-spdep  & 
nohup conda install -y -c r r-raster  &  ##this can not install
nohup conda install -y -c r r-reshape2  &
nohup conda install -y -c r r-DescTools  &
nohup conda install -y -c r r-spdep  &
nohup conda install -y -c r r-xgboost  &
nohup conda install -y -c r r-dplyr  &
nohup conda install -y -c r r-readr   &
nohup conda install -y -c r r-readxl   &
nohup conda install -y -c r r-paws   & 
nohup conda install -y -c r r-botor   &


echo "PASS STAGE 2 "
#outForest
nohup conda install -y -c r r-RcppEigen &
nohup conda install -y -c r r-FNN &
nohup conda install -y -c r r-ranger &
nohup conda install -y -c r r-missRanger &

nohup conda install -y -c r r-outForest &
 
echo "PASS STAGE 3 "
conda deactivate

1 Answers1

0

well finaly the succesfull script here one important point is use a text editor compatible with unix return carriage

Important When you create or change a script, we recommend that you use a text editor that provides Unix-style line breaks, such as the text editor available in the console when you create a notebook. Copying text from a non-Linux operating system might introduce incompatible line breaks and result in an unexpected error.

#!/bin/bash
 
set -e

sudo -u ec2-user -i <<'EOF'

nohup yum -y install  gcc gcc-c++ clang  libcurl-devel    openssl-devel  | "FAIL LINUX DEPS"

source activate R 
nohup conda install -y -c r r-sf &
nohup conda install -y -c r r-raster=3.4-10 & 
nohup conda install -y -c r r-dplyr         &
nohup conda install -y -c r r-readr     &
nohup conda install -y -c r r-readxl    &
nohup conda install -y -c r r-paws      & 
nohup conda install -y -c r r-botor     & 
 
conda deactivate
 
EOF

AWS LifeCicleConf