Support R 4.x.x
- Be compatible with AWS CLI v2 - `npm audit fix`
This commit is contained in:
parent
1e03fcc8bb
commit
16be369c4f
4 changed files with 3974 additions and 1185 deletions
2
Makefile
2
Makefile
|
|
@ -25,7 +25,7 @@ docker-shell-r-env:
|
|||
@cd builder && docker-compose run --entrypoint /bin/bash ubuntu-1604
|
||||
|
||||
ecr-login:
|
||||
@eval $(shell aws ecr get-login --no-include-email --region $(AWS_REGION))
|
||||
(aws ecr get-login-password --region $(AWS_REGION) | docker login --username AWS --password-stdin $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com)
|
||||
|
||||
fetch-serverless-custom-file:
|
||||
aws s3 cp s3://rstudio-serverless/serverless/r-builds/serverless-custom.yml .
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ Create a `builder/Dockerfile.platform-version` (where `platform-version` is `ubu
|
|||
|
||||
1. an `OS_IDENTIFIER` env with the `platform-version`.
|
||||
2. a step which ensures the R source build dependencies are installed
|
||||
3. The `awscli`, most likely installed via `pip` for uploading tarballs to S3
|
||||
3. The `awscli`, 1.17.10+ if installed via `pip`, for uploading tarballs to S3
|
||||
4. `COPY` and `ENTRYPOINT` for the `build.sh` file in `builder/`.
|
||||
|
||||
### docker-compose.yml
|
||||
|
|
|
|||
19
handler.py
19
handler.py
|
|
@ -5,7 +5,8 @@ import json
|
|||
import boto3
|
||||
import botocore
|
||||
|
||||
CRAN_SRC_R_URL = 'https://cran.rstudio.com/src/base/R-3/'
|
||||
CRAN_SRC_R3_URL = 'https://cran.rstudio.com/src/base/R-3/'
|
||||
CRAN_SRC_R4_URL = 'https://cran.rstudio.com/src/base/R-4/'
|
||||
batch_client = boto3.client('batch', region_name='us-east-1')
|
||||
|
||||
|
||||
|
|
@ -23,9 +24,9 @@ def _persist_r_versions(data):
|
|||
obj.put(Body=json.dumps(data), ContentType='application/json')
|
||||
|
||||
|
||||
def _cran_r_versions():
|
||||
def _cran_r_versions(url):
|
||||
"""Perform a lookup of CRAN-known R version."""
|
||||
r = requests.get(CRAN_SRC_R_URL)
|
||||
r = requests.get(url)
|
||||
soup = BeautifulSoup(r.text, 'html.parser')
|
||||
r_versions = []
|
||||
for link in soup.find_all('a'):
|
||||
|
|
@ -34,6 +35,14 @@ def _cran_r_versions():
|
|||
v = href.replace('.tar.gz', '').replace('R-', '')
|
||||
if '-revised' not in v: # reject 3.2.4-revised
|
||||
r_versions.append(v)
|
||||
return r_versions
|
||||
|
||||
|
||||
def _cran_all_r_versions():
|
||||
"""Perform a lookup of CRAN-known R version."""
|
||||
r_versions = []
|
||||
r_versions.extend(_cran_r_versions(CRAN_SRC_R3_URL))
|
||||
r_versions.extend(_cran_r_versions(CRAN_SRC_R4_URL))
|
||||
return {'r_versions': r_versions}
|
||||
|
||||
|
||||
|
|
@ -86,13 +95,13 @@ def _submit_job(version, platform):
|
|||
|
||||
|
||||
def _versions_to_build(force):
|
||||
cran_versions = _cran_r_versions()['r_versions']
|
||||
cran_versions = _cran_all_r_versions()['r_versions']
|
||||
known_versions = _known_r_versions()['r_versions']
|
||||
new_versions = _compare_versions(cran_versions, known_versions)
|
||||
|
||||
if len(new_versions) > 0:
|
||||
print('New R Versions found: %s' % new_versions)
|
||||
_persist_r_versions(_cran_r_versions())
|
||||
_persist_r_versions(_cran_all_r_versions())
|
||||
|
||||
if force in [True, 'True', 'true']:
|
||||
return cran_versions
|
||||
|
|
|
|||
4946
package-lock.json
generated
4946
package-lock.json
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue