Skip to content

Commit cafb272

Browse files
committed
Merge branch 'master' into no-coerce-matrix
2 parents b692f82 + 6bde008 commit cafb272

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2591
-2431
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
^\.ci$
1414
^\.dev$
15+
^\.devcontainer$
1516
^\.graphics$
1617
^\.github$
1718

@@ -39,3 +40,4 @@
3940
^pkgdown$
4041
^lib$
4142
^library$
43+
^devwd$

.ci/Dockerfile.in

Lines changed: 0 additions & 9 deletions
This file was deleted.

.ci/README.md

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,50 @@
11
# data.table continuous integration and deployment
22

3-
On each Pull Request opened in GitHub we run Travis CI and Appveyor to provide prompt feedback about the status of PR. Our main CI pipeline runs on GitLab CI. GitLab repository automatically mirrors our GitHub repository and runs pipeline on `master` branch. It tests more environments and different configurations. It publish variety of artifacts.
3+
On each Pull Request opened in GitHub we run GitHub Actions test jobs to provide prompt feedback about the status of PR. Our main CI pipeline runs on GitLab CI nightly. GitLab repository automatically mirrors our GitHub repository and runs pipeline on `master` branch every night. It tests more environments and different configurations. It publish variety of artifacts.
44

55
## Environments
66

77
### [GitLab CI](./../.gitlab-ci.yml)
88

99
Test jobs:
10-
- `test-rel-lin` - `r-release` on Linux, most comprehensive test environment, `-O3 -flto -fno-common -Wunused-result`, extra check for no compilation warnings, includes testing [_with other packages_](./../inst/tests/other.Rraw)
11-
- `test-rel-cran-lin` - `--as-cran` on Linux, `-g0`, extra check for final status of `R CMD check` where we allow one NOTE (_size of tarball_).
12-
- `test-dev-cran-lin` - `r-devel` and `--as-cran` on Linux, `--with-recommended-packages --enable-strict-barrier --disable-long-double`, tests for compilation warnings in pkg install and new NOTEs/Warnings in pkg check, and because it is R-devel it is marked as allow_failure
13-
- `test-rel-vanilla-lin` - `r-release` on Linux, no suggested deps, no OpenMP, `-O0`, tracks memory usage during tests
14-
- `test-310-cran-lin` - R 3.1.0 on Linux
15-
- `test-344-cran-lin` - R 3.4.4 on Linux
16-
- `test-350-cran-lin` - R 3.5.0 on Linux, no `r-recommended`
17-
- `test-rel-win` - `r-release` on Windows
18-
- `test-dev-win` - `r-devel` on Windows
19-
- `test-old-win` - `r-oldrel` on Windows
20-
- `test-rel-osx` - MacOSX build not yet deployed, see [#3326](https://github.com/Rdatatable/data.table/issues/3326) for status
10+
- `test-lin-rel` - `r-release` on Linux, most comprehensive test environment, force all suggests, `-O3 -flto=auto -fno-common -Wunused-result`, test for no compilation warnings.
11+
- `test-lin-rel-vanilla` - `r-release` on Linux, no suggested deps, no zlib, no OpenMP, flags `-g -O0 -fno-openmp`, skip manual and vignettes.
12+
- `test-lin-rel-cran` - `--as-cran` on Linux, strict test for final status of `R CMD check`.
13+
- `test-lin-dev-gcc-strict-cran` - `--as-cran` on Linux, `r-devel` built with `-enable-strict-barrier --disable-long-double`, test for compilation warnings, test for new NOTEs/WARNINGs from `R CMD check`.
14+
- `test-lin-dev-clang-cran` - same as `gcc-strict` job but R built with `clang` and no `--enable-strict-barrier --disable-long-double` flags.
15+
- `test-lin-310-cran` - R 3.1.0 on Linux, stated R dependency version.
16+
- `test-win-rel` - `r-release` on Windows.
17+
- `test-win-dev` - `r-devel` on Windows.
18+
- `test-win-old` - `r-oldrel` on Windows.
19+
- `test-mac-rel` - macOS build not yet available, see [#3326](https://github.com/Rdatatable/data.table/issues/3326) for status
20+
21+
Tests jobs are allowed to fail, summary and logs of test jobs are later published at _CRAN-like checks_ page, see artifacts below.
2122

2223
Artifacts:
2324
- [homepage](https://rdatatable.gitlab.io/data.table) - made with [pkgdown](https://github.com/r-lib/pkgdown)
2425
- [html manual](https://rdatatable.gitlab.io/data.table/library/data.table/html/00Index.html)
2526
- [pdf manual](https://rdatatable.gitlab.io/data.table/web/packages/data.table/data.table.pdf)
2627
- [html vignettes](https://rdatatable.gitlab.io/data.table/library/data.table/doc/index.html)
27-
- R packages repository for `data.table` and all _Suggests_ dependencies, url: `https://Rdatatable.gitlab.io/data.table`
28+
- R packages repository for `data.table` and all _Suggests_ dependencies, url: `https://rdatatable.gitlab.io/data.table`
2829
- sources
2930
- Windows binaries for `r-release`, `r-devel` and `r-oldrel`
3031
- [CRAN-like homepage](https://rdatatable.gitlab.io/data.table/web/packages/data.table/index.html)
31-
- [CRAN-like checks results](https://rdatatable.gitlab.io/data.table/web/checks/check_results_data.table.html) - note that all artifacts, including check results page, are being published only when all test jobs successfully pass, thus one will not see an _ERROR_ status there (unless error happened on a job marked as `allow_failure`).
32-
- [docker images](https://gitlab.com/Rdatatable/data.table/container_registry) - copy/paste-able `docker pull` commands can be found at the bottom of our [CRAN-like homepage](https://rdatatable.gitlab.io/data.table/web/packages/data.table/index.html)
32+
- [CRAN-like checks results](https://rdatatable.gitlab.io/data.table/web/checks/check_results_data.table.html)
3333

34-
### [Travis CI](./../.travis.yml)
34+
### [GitHub Actions](./../.github/workflows)
3535

36-
Test jobs:
37-
- `r-release` on Linux, includes code coverage check
38-
- _(might be disabled)_ `r-release` on OSX
39-
40-
Artifacts:
41-
- R packages repository having `data.table` sources only, url: `https://Rdatatable.github.io/data.table`
42-
- code coverage stats pushed to [codecov.io/gh/Rdatatable/data.table](https://codecov.io/gh/Rdatatable/data.table)
36+
TODO document
4337

4438
### [Appveyor](./../.appveyor.yml)
4539

46-
Test jobs:
47-
- Windows `r-release`
48-
- _(might be disabled)_ Windows `r-devel`
49-
50-
Artifacts:
51-
- Windows `r-release` binaries accessed only via web UI
40+
TODO document
5241

53-
## Tools
42+
## CI tools
5443

5544
### [`ci.R`](./ci.R)
5645

57-
Base R implemented helper script, [originally proposed to R](https://svn.r-project.org/R/branches/tools4pkgs/src/library/tools/R/packages.R), that ease the process of extracting dependency information from description files, also to mirror packages and their recursive dependencies from CRAN to local CRAN-like directory. It is widely used in our [GitLab CI pipeline](./../.gitlab-ci.yml).
46+
Base R implemented helper script, [originally proposed to base R](https://svn.r-project.org/R/branches/tools4pkgs/src/library/tools/R/packages.R), that ease the process of extracting dependency information from description files, and to mirror packages and their recursive dependencies from CRAN to local CRAN-like directory. It is used in [GitLab CI pipeline](./../.gitlab-ci.yml).
5847

5948
### [`publish.R`](./publish.R)
6049

61-
Base R implemented helper script to orchestrate generation of most artifacts. It is being used only in [_integration_ stage in GitLab CI pipeline](./../.gitlab-ci.yml).
62-
63-
### [`Dockerfile.in`](./Dockerfile.in)
64-
65-
Template file to produce `Dockerfile` for, as of now, three docker images. Docker images are being built and published in [_deploy_ stage in GitLab CI pipeline](./../.gitlab-ci.yml).
66-
- `r-base-dev` using `r-release`: publish docker image of `data.table` on R-release
67-
- `r-builder` using `r-release`: publish on R-release and OS dependencies for building Rmarkdown vignettes
68-
- `r-devel`: publish docker image of `data.table` on R-devel built with `--with-recommended-packages --enable-strict-barrier --disable-long-double`
69-
70-
### [`deploy.sh`](./deploy.sh)
71-
72-
Script used on Travis CI to publish CRAN-like repository of `data.table` sources. It publishes to `gh-pages` branch in GitHub repository. It depends on a token, which is provided based on `secure` environment variable in [.travis.yml](./../.travis.yml). It has been generated by @jangorecki.
50+
Base R implemented helper script to orchestrate generation of most artifacts and to arrange them nicely. It is being used only in [_integration_ stage in GitLab CI pipeline](./../.gitlab-ci.yml).

.ci/ci.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,3 @@ function(pkgs,
185185
dp
186186
}
187187

188-
## set repositories for CI tests
189-
if (as.logical(Sys.getenv("GITLAB_CI","false")) && identical(Sys.getenv("CI_PROJECT_NAME"), "data.table")) {
190-
options("repos" = if (.Platform$OS.type == "windows") file.path("file://",getwd(),"bus/mirror-packages/cran") else file.path("file:", normalizePath("bus/mirror-packages/cran", mustWork=FALSE)))
191-
}

.ci/deploy.sh

Lines changed: 0 additions & 30 deletions
This file was deleted.

.ci/publish.R

Lines changed: 62 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -91,26 +91,17 @@ package.index <- function(package, lib.loc, repodir="bus/integration/cran") {
9191
)
9292
vign = tools::getVignetteInfo(pkg, lib.loc=lib.loc)
9393
r_rel_ver = Sys.getenv("R_REL_VERSION")
94-
r_devel_ver = Sys.getenv("R_DEVEL_VERSION")
95-
r_oldrel_ver = Sys.getenv("R_OLDREL_VERSION")
96-
stopifnot(nzchar(r_rel_ver), nzchar(r_devel_ver), nzchar(r_oldrel_ver))
94+
r_dev_ver = Sys.getenv("R_DEV_VERSION")
95+
r_old_ver = Sys.getenv("R_OLD_VERSION")
96+
stopifnot(nzchar(r_rel_ver), nzchar(r_dev_ver), nzchar(r_old_ver))
9797
cran.home = "../../.."
9898
tbl.dl = c(
9999
sprintf("<tr><td> Reference manual: </td><td> <a href=\"%s.pdf\">%s.pdf</a>, <a href=\"%s/library/%s/html/00Index.html\">00Index.html</a> </td></tr>", pkg, pkg, cran.home, pkg),
100100
if (nrow(vign)) sprintf("<tr><td>Vignettes:</td><td>%s</td></tr>", paste(sprintf("<a href=\"%s/library/data.table/doc/%s\">%s</a><br/>", cran.home, vign[,"PDF"], vign[,"Title"]), collapse="\n")), # location unline cran web/pkg/vignettes to not duplicate content, documentation is in ../../../library
101101
sprintf("<tr><td> Package source: </td><td> <a href=\"%s/src/contrib/%s_%s.tar.gz\"> %s_%s.tar.gz </a> </td></tr>", cran.home,pkg, version, pkg, version),
102-
sprintf("<tr><td> Windows binaries: </td><td> %s </td></tr>", format.bins(ver=c("r-devel","r-release","r-oldrel"), bin_ver=c(r_devel_ver, r_rel_ver, r_oldrel_ver), cran.home=cran.home, os.type="windows", pkg=pkg, version=version, repodir=repodir)),
103-
sprintf("<tr><td> macOS binaries: </td><td> %s </td></tr>", format.bins(ver=c("r-release","r-oldrel"), bin_ver=c(r_rel_ver, r_oldrel_ver), cran.home=cran.home, os.type="macosx", pkg=pkg, version=version, repodir=repodir))
102+
sprintf("<tr><td> Windows binaries: </td><td> %s </td></tr>", format.bins(ver=c("r-devel","r-release","r-oldrel"), bin_ver=c(r_dev_ver, r_rel_ver, r_old_ver), cran.home=cran.home, os.type="windows", pkg=pkg, version=version, repodir=repodir)),
103+
sprintf("<tr><td> macOS binaries: </td><td> %s </td></tr>", format.bins(ver=c("r-release","r-oldrel"), bin_ver=c(r_rel_ver, r_old_ver), cran.home=cran.home, os.type="macosx", pkg=pkg, version=version, repodir=repodir))
104104
)
105-
if (pkg=="data.table") { ## docker images
106-
registry = Sys.getenv("CI_REGISTRY", "registry.gitlab.com")
107-
namespace = Sys.getenv("CI_PROJECT_NAMESPACE", "Rdatatable")
108-
project = Sys.getenv("CI_PROJECT_NAME", "data.table")
109-
images = c("r-release","r-devel","r-release-builder")
110-
images.title = c("Base R release", "Base R development", "R release package builder")
111-
tags = rep("latest", 3)
112-
docker.dl = sprintf("<tr><td> %s: </td><td> <pre><code>docker pull %s/%s/%s/%s:%s</code></pre> </td></tr>", images.title, tolower(registry), tolower(namespace), tolower(project), tolower(images), tags)
113-
}
114105
index.file = file.path(repodir, "web/packages", pkg, "index.html")
115106
if (!dir.exists(dirname(index.file))) dir.create(dirname(index.file), recursive=TRUE)
116107
writeLines(c(
@@ -131,11 +122,6 @@ package.index <- function(package, lib.loc, repodir="bus/integration/cran") {
131122
sprintf("<table summary=\"Package %s downloads\">", pkg),
132123
tbl.dl,
133124
"</table>",
134-
if (pkg=="data.table")
135-
c("<h4>Docker images:</h4>",
136-
sprintf("<table summary=\"Package %s docker images\">", pkg),
137-
docker.dl,
138-
"</table>"),
139125
"</body>",
140126
"</html>"
141127
), index.file)
@@ -148,7 +134,7 @@ lib.copy <- function(lib.from, repodir="bus/integration/cran"){
148134
pkg.copy <- function(pkg.from, lib.to) {
149135
pkg<-basename(pkg.from);
150136
dir.create(file.path(lib.to, pkg), recursive=TRUE)
151-
lib.dirs<-intersect(c("html","doc"), all.lib.dirs<-list.dirs(pkg.from, full.names=FALSE))
137+
lib.dirs<-intersect(c("help","html","doc"), all.lib.dirs<-list.dirs(pkg.from, full.names=FALSE))
152138
ans1<-setNames(file.copy(file.path(pkg.from, lib.dirs), file.path(lib.to, pkg), recursive=TRUE), lib.dirs)
153139
lib.files<-setdiff(list.files(pkg.from), all.lib.dirs)
154140
ans2<-setNames(file.copy(file.path(pkg.from, lib.files), file.path(lib.to, pkg)), lib.files)
@@ -169,24 +155,30 @@ plat <- function(x) if (grepl("^.*win", x)) "Windows" else if (grepl("^.*mac", x
169155

170156
r.ver <- function(x) {
171157
tmp = strsplit(x, "-", fixed=TRUE)[[1L]]
172-
if (length(tmp) < 2L) stop("test job names must be test-[r.version]-...")
173-
v = tmp[2L]
158+
if (length(tmp) < 3L) stop("test job names must be test-[lin|win|mac]-[r.version]-...")
159+
v = tmp[3L]
174160
if (identical(v, "rel")) "r-release"
175161
else if (identical(v, "dev")) "r-devel"
176162
else if (identical(v, "old")) "r-oldrel"
177163
else {
178-
if (grepl("\\D", v)) stop("second word in test job name must be rel/dev/old or numbers of R version")
164+
if (grepl("\\D", v)) stop("third word in test job name must be rel/dev/old or numbers of R version")
179165
paste0("r-", paste(strsplit(v, "")[[1L]], collapse="."))
180166
}
181167
}
182168

183169
# this for now is constant but when we move to independent pipelines (commit, daily, weekly) those values can be different
184170
pkg.version <- function(job, pkg) {
185-
dcf = read.dcf(file.path("bus", job, paste(pkg, "Rcheck", sep="."), pkg, "DESCRIPTION"))
171+
Rcheck = file.path("bus", job, paste(pkg, "Rcheck", sep="."))
172+
if (!dir.exists(Rcheck))
173+
return(NA_character_)
174+
dcf = read.dcf(file.path(Rcheck, "00_pkg_src", pkg, "DESCRIPTION"))
186175
dcf[,"Version"]
187176
}
188177
pkg.revision <- function(job, pkg) {
189-
dcf = read.dcf(file.path("bus", job, paste(pkg, "Rcheck", sep="."), pkg, "DESCRIPTION"))
178+
Rcheck = file.path("bus", job, paste(pkg, "Rcheck", sep="."))
179+
if (!dir.exists(Rcheck))
180+
return(NA_character_)
181+
dcf = read.dcf(file.path(Rcheck, "00_pkg_src", pkg, "DESCRIPTION"))
190182
if ("Revision" %in% colnames(dcf)) {
191183
proj.url = Sys.getenv("CI_PROJECT_URL", "")
192184
if (!nzchar(proj.url)) {
@@ -198,7 +190,10 @@ pkg.revision <- function(job, pkg) {
198190
} else ""
199191
}
200192
pkg.flags <- function(job, pkg) {
201-
cc = file.path("bus", job, paste(pkg, "Rcheck", sep="."), pkg, "cc") ## data.table style cc file
193+
Rcheck = file.path("bus", job, paste(pkg, "Rcheck", sep="."))
194+
if (!dir.exists(Rcheck))
195+
return(NA_character_)
196+
cc = file.path(Rcheck, pkg, "cc") ## data.table style cc file
202197
if (file.exists(cc)) {
203198
d = readLines(cc)
204199
w.cflags = substr(d, 1, 7)=="CFLAGS="
@@ -268,6 +263,34 @@ check.flavors <- function(jobs, repodir="bus/integration/cran") {
268263
setNames(file.exists(file), file)
269264
}
270265

266+
log.copy <- function(job, repodir="bus/integration/cran") {
267+
dir.create(job.checks<-file.path(repodir, "web", "checks", pkg<-"data.table", job), recursive=TRUE, showWarnings=FALSE)
268+
to = file.path(job.checks, "log")
269+
if (!file.exists(job_id_file <- file.path("bus", job, "id")))
270+
return(setNames(file.exists(to), "log"))
271+
job_id = readLines(job_id_file, warn=FALSE)[1L]
272+
from = sprintf("https://gitlab.com/Rdatatable/data.table/-/jobs/%s/raw", job_id)
273+
download.file(from, to, method="wget", quiet=TRUE)
274+
Sys.sleep(0.1) ## to not get ban from gitlab.com
275+
setNames(file.exists(to), "log")
276+
}
277+
278+
ci.status <- function(job) {
279+
if (!file.exists(status_file <- file.path("bus", job, "status")))
280+
return(NA_character_)
281+
readLines(status_file, warn=FALSE)[1L]
282+
}
283+
284+
ci.log <- function(jobs, repodir="bus/integration/cran") {
285+
pkg = "data.table"
286+
ans = vector("character", length(jobs))
287+
logs = sapply(jobs, log.copy, repodir=repodir)
288+
statuses = sapply(jobs, ci.status)
289+
ans[!logs] = statuses[!logs]
290+
ans[logs] = sprintf('<a href=\"%s/%s/log\">%s</a>', pkg[any(logs)], jobs[logs], statuses[logs])
291+
ans
292+
}
293+
271294
check.index <- function(pkg, jobs, repodir="bus/integration/cran") {
272295
status = function(x) if (grepl("^.*ERROR", x)) "ERROR" else if (grepl("^.*WARNING", x)) "WARNING" else if (grepl("^.*NOTE", x)) "NOTE" else if (grepl("^.*OK", x)) "OK" else NA_character_
273296
test.files = function(job, files, trim.name=FALSE, trim.exts=0L, pkg="data.table") {
@@ -308,17 +331,18 @@ check.index <- function(pkg, jobs, repodir="bus/integration/cran") {
308331
}
309332
memouts
310333
})
311-
th = "<th>Flavor</th><th>Version</th><th>Revision</th><th>Install</th><th>Status</th><th>Flags</th><th>Rout.fail</th><th>Memtest</th>"
334+
th = "<th>Flavor</th><th>Version</th><th>Revision</th><th>Install</th><th>Status</th><th>Flags</th><th>Rout.fail</th><th>Log</th><th>Memtest</th>"
312335
tbl = sprintf(
313-
"<tr><td><a href=\"check_flavors.html\">%s</a></td><td>%s</td><td>%s</td><td><a href=\"%s/%s/00install.out\">out</a></td><td><a href=\"%s/%s/00check.log\">%s</a></td><td>%s</td><td>%s</td><td>%s</td></tr>",
314-
sub("test-", "", jobs, fixed=TRUE),
315-
sapply(jobs, pkg.version, pkg),
316-
sapply(jobs, pkg.revision, pkg),
317-
pkg, jobs, ## install
318-
pkg, jobs, sapply(sapply(jobs, check.test, pkg="data.table"), status), ## check
319-
sapply(jobs, pkg.flags, pkg),
320-
mapply(test.files, jobs, routs, trim.exts=2L), # 1st fail, 2nd Rout, keep just: tests_x64/main
321-
mapply(test.files, jobs, memouts, trim.name=TRUE)
336+
"<tr><td><a href=\"check_flavors.html\">%s</a></td><td>%s</td><td>%s</td><td><a href=\"%s/%s/00install.out\">out</a></td><td><a href=\"%s/%s/00check.log\">%s</a></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
337+
sub("test-", "", jobs, fixed=TRUE), ## Flavor
338+
sapply(jobs, pkg.version, pkg), ## Version
339+
sapply(jobs, pkg.revision, pkg), ## Revision
340+
pkg, jobs, ## Install
341+
pkg, jobs, sapply(sapply(jobs, check.test, pkg="data.table"), status), ## Status
342+
sapply(jobs, pkg.flags, pkg), ## Flags
343+
mapply(test.files, jobs, routs, trim.exts=2L), ## Rout.fail: 1st fail, 2nd Rout, keep just: tests_x64/main
344+
ci.log(jobs), ## CI job logs
345+
mapply(test.files, jobs, memouts, trim.name=TRUE) ## Memtest // currently not used
322346
)
323347
file = file.path(repodir, "web/checks", sprintf("check_results_%s.html", pkg))
324348
writeLines(c(
@@ -354,7 +378,8 @@ check.test <- function(job, pkg) {
354378
check[length(check)]
355379
}
356380

357-
move.bin <- function(job, bin.version, os.type, file="DESCRIPTION", silent=FALSE) {
381+
move.bin <- function(job, bin.version, os.type, file="DESCRIPTION", silent=TRUE) {
382+
## currently not used, if not used for macos in future then can be removed
358383
if (os.type=="unix") {
359384
stop("publish of linux binaries not supported")
360385
} else if (os.type=="windows") {

0 commit comments

Comments
 (0)