38 lines
1.3 KiB
Shell
38 lines
1.3 KiB
Shell
#!/bin/bash
|
|
|
|
### install R
|
|
|
|
PLATFORM_ID=$(cat /etc/os-release | grep 'PLATFORM_ID=' | cut -d'=' -f2 | tr -d '"')
|
|
|
|
if [ $PLATFORM_ID = "platform:el9" ]; then
|
|
|
|
subscription-manager register --username pat-s --password $RED_HAT_DEV_PW
|
|
|
|
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
|
|
dnf -y install git rsync
|
|
# dnf update -y
|
|
# FIXME: protect PW
|
|
|
|
echo "R Version: ${R_VERSION}"
|
|
echo "Downloading R-${R_VERSION}.rpm from S3..."
|
|
curl -o /tmp/R-${R_VERSION}.rpm https://cynkra-r-builds-arm64.s3.eu-central-1.amazonaws.com/el9/R-"${R_VERSION}"-1-1."$(arch)".rpm
|
|
dnf install -y /tmp/R-${R_VERSION}.rpm
|
|
fi
|
|
|
|
export PATH=/opt/R/${R_VERSION}/bin:$PATH
|
|
|
|
### install R packages needed for building
|
|
|
|
R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
|
|
R -q -e 'options(repos = c(CRAN="https://stat.ethz.ch/CRAN/")); pak::pak(c("pkgbuild", "cranlike", "drat"))'
|
|
|
|
### install awscli
|
|
curl -s "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
|
|
unzip -qq awscliv2.zip
|
|
./aws/install
|
|
rm -rf awscliv2.zip
|
|
|
|
mkdir /root/.aws
|
|
echo -e "[default]\n
|
|
aws_access_key_id=AKIATHTKSC6FRVE5LNE7\n
|
|
aws_secret_access_key=KCsGZCWEdz8BlVdTqmFG04/UiM41ETgaQnOTL0mm\n" >/root/.aws/credentials
|