-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTaskfile.R.yaml
53 lines (47 loc) · 2.99 KB
/
Taskfile.R.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
version: 3
# https://hub.docker.com/_/r-base/tags
vars:
NBL_R_VERSION: 4.3.0
IDENTIFIER: base
# NOTE: When using `deps: []`, variables are inherited from the current task, but when calling them
# directly in `cmds: []`, the variables have to be passed in explicitly.
tasks:
base:copy-files:
desc: Copy files from the R directory to the build directories
cmds:
- task copy-root-files LANGUAGE=r IDENTIFIER={{.IDENTIFIER}} NBL_LANGUAGE_VERSION={{.NBL_LANGUAGE_VERSION}}
- task copy-language-files LANGUAGE=r IDENTIFIER={{.IDENTIFIER}} NBL_LANGUAGE_VERSION={{.NBL_LANGUAGE_VERSION}}
- cp r/datascience/Aptfile r/datascience/{{.NBL_LANGUAGE_VERSION}}/Aptfile
- cp r/datascience/install_packages.R r/datascience/{{.NBL_LANGUAGE_VERSION}}/install_packages.R
- cp r/datascience/requirements.R r/datascience/{{.NBL_LANGUAGE_VERSION}}/requirements.R
- cp r/noteable/Aptfile r/noteable/{{.NBL_LANGUAGE_VERSION}}/Aptfile
- cp r/noteable/.Rprofile r/noteable/{{.NBL_LANGUAGE_VERSION}}/.Rprofile
- cp r/noteable/requirements.R r/noteable/{{.NBL_LANGUAGE_VERSION}}/requirements.R
base:build:
desc: Build the R 4.x base image after copying required files
cmds:
- task r:base:copy-files IDENTIFIER=base NBL_LANGUAGE_VERSION={{.NBL_R_VERSION}}
# build the base image
- task build LANGUAGE=r NBL_LANGUAGE_VERSION={{.NBL_R_VERSION}} IDENTIFIER=base BUILD_TARGET=base -- --build-arg NBL_R_VERSION={{.NBL_R_VERSION}}
datascience:build:
desc: Build the R 4.3.x image with commonly-installed packages
cmds:
# ensure the base image is built first
- task r:base:build IDENTIFIER=datascience NBL_R_VERSION={{.NBL_R_VERSION}}
# copy datascience-specific files to the build directories
- cp r/datascience/Aptfile r/datascience/{{.NBL_R_VERSION}}/Aptfile
- cp r/datascience/install_packages.R r/datascience/{{.NBL_R_VERSION}}/install_packages.R
- cp r/datascience/requirements.R r/datascience/{{.NBL_R_VERSION}}/requirements.R
# build the datascience image off of the base image
- task build LANGUAGE=r NBL_LANGUAGE_VERSION={{.NBL_R_VERSION}} IDENTIFIER=datascience BUILD_TARGET=main -- --build-context base=docker-image://local/kernel-r-{{.NBL_R_VERSION}}-base:dev
noteable:build:
desc: Build the R 4.3.x image with data frame -> DEX support
cmds:
# ensure the datascience image is built first
- task r:datascience:build IDENTIFIER=noteable NBL_R_VERSION={{.NBL_R_VERSION}}
# copy noteable-specific files to the build directories
- cp r/noteable/Aptfile r/noteable/{{.NBL_R_VERSION}}/Aptfile
- cp r/noteable/.Rprofile r/noteable/{{.NBL_R_VERSION}}/.Rprofile
- cp r/noteable/requirements.R r/noteable/{{.NBL_R_VERSION}}/requirements.R
# build the noteable image off of the datascience image
- task build LANGUAGE=r NBL_LANGUAGE_VERSION={{.NBL_R_VERSION}} IDENTIFIER=noteable BUILD_TARGET=main -- --build-context base=docker-image://local/kernel-r-{{.NBL_R_VERSION}}-datascience:dev