knitr::opts_chunk$set(echo = TRUE, results=‘hide’)
This chapter describes the build process for VisionEval. The VisionEval “build process” (re)builds VisionEval packages to incorporate default, localized, or custom data in the module’s model estimation and data processing steps in order to update data resources and estimated model coefficients.
This chapter sets out the process for updating these datasets that VisionEval modules use during any of the model runs.
For the VisionEval models to access any of these updated data requires re-building of the VisionEval package source. The reason that a package must be rebuilt before it is available for use in VisionEval is that VisionEval creates its own R environment with its own VisionEval modules built as R packages.
R is a community-based project and depends upon a community of re-usable, reproducible, and shareable code. To facilitate this, R uses a standardized method for bundling a collection of code and data into a built into a shareable binary “package”. Packages can then be downloaded and installed into your local R library. An R environment can only access the packages installed in a local R library.
VisionEval relies on this fundamental package framework for sharing code and data from its modules. In order to alter the data used within a VisionEval module (i.e., an R Package) it must be repackaged, or re-built, using the new data. Otherwise, if only the source data is altered and not re-built, the VisionEval environment fails to recognize the updated data.
It is crucial for users to understand the distinction between the VisionEval runtime environment and the VisionEval build environment. VisionEval begins as source code and data in the build environment from which the VisionEval R packages are built, and a runtime environment is created. VisionEval models can only be run from a runtime environment where the built packages are loaded (into an R session) and used by R to perform the model steps. The VisionEval runtime environment will be referred to as VisionEval from this point on in the document.
The process for obtaining the source code used for rebuilding or updating any module within VisionEval depends on how a user obtained the current runtime:
Users who installed a pre-built VisionEval runtime environment using a VisionEval installer.
Users who created a VisionEval runtime environment through a build environment by obtaining the source code from GitHub.
The processes for both types of users are described below. Additionally, the process for advanced users who may want to build VisionEval natively from the source code for development or on non-Windows computers is described at the end of this section.
Users at this point should have a full VisionEval installed and running. If not visit https://visioneval.org/docs/getting-started.html#installation-and-setup and follow the path 1 listed to download and install the base model.
R – R for windows can be downloaded here: https://cran.rstudio.com/ (The most recent version is usually supported in VisionEval within a few weeks of its release). It is suggested to use an R version that aligns with the VE R version. The Cran website includes links to past versions although the most current is the one often highlighted on the first page.
RStudio – RStudio for windows can be downloaded here: https://posit.co/download/rstudio-desktop/
Rebuilding a package in this VisionEval setup will require source code for the specific build that was installed (specific R, operating system, etc.) which is made available in a zip file that you can get from the Github release. Be sure to pick the version corresponding your installed version of R and VisionEval. This zip file contains the source code and default data for all the VisionEval packages that can be easily installed in VisionEval using R native command “install.packages” or RStudio build tools. The user can download and unzip the zip file into their VisionEval directory. After unzipping a
src folder will be present alongside
ve-lib. Each VisionEval package is present in a sub-folder of
src and you can change files there and rebuild the package as described below.
The source code of these packages contains code and data upon which the modules are built. This data can then be updated with localized or custom data and the module can be rebuilt into VisionEval. The process of rebuilding is explained in more detail in the section of this document.
For advanced users who have a complete VisionEval built using the source code from GitHub, the process for updating and rebuilding individual modules and packages can be done without the need to download additional source code material. A version of the source code, easily installable in R, is created during the “build process”.
Note: if you want to install a complete VisionEval model from the source code please see the section VisionEval Full Build Process.
RTools – RTools for windows can be downloaded here: https://cran.r-project.org/bin/windows/Rtools/rtools43/files/rtools43-5493-5475.exe.
Git – Git for windows can be downloaded here: https://git-scm.com/download/win.
The source code created during the build process can be used to rebuild packages in this VisionEval setup. The process of rebuilding is the same as before, the only difference is the location of the source code relative to the VisionEval setup.
VisionEval build environment allows for a single VisionEval package to be created, modified, and installed (aka “built”) into an existing VisionEval that had been previously created from a full install build. This is useful for creating or modifying single packages and their constituent modules within the VisionEval framework. The build process can be used to incorporate localized or custom data into VisionEval by making a change to a module and then rebuilding it.
Advanced users may want to build VisionEval natively from the source code for development or on non-Windows computers. This process can take several hours the first time it runs. For more details, see instruction in build/Building.md.
Clone or “fork” a copy of the VisionEval from the Github repository (https://github.com/VisionEval/VisionEval) into a directory of your choice (e.g.,
C:/Users/<``user name``>/Documents/VisionEval-Source) using:
git clone ``email@example.com:VisionEval``/``VisionEval.git`` VisionEval-Source
For developers, there is a separate development repository with the latest unreleased source code: https://github.com/VisionEval/VisionEval-Dev
Users not familiar with git and GitHub can simply download the repository as a zip file (https://github.com/VisionEval/VisionEval/archive/refs/heads/master.zip). In either case, the download is very large (over 900MB compressed download and 3.4GB uncompressed on disk).
Start VisionEval by double clicking the
VisionEval.RProjfile in the newly cloned
Start the build process by entering
ve.build``()into the console. This will start the process of downloading and installing every R package dependencies required by VisionEval as well as installing the VisionEval framework specific packages. The output will look something like this:
- This will take a while, potentially over an hour. Once completed, you’ve successfully performed a full build install of the VisionEval runtime environment.
- A new folder called ‘built’ will be created your source directory, populated with a sub-folder for the R-version you used to build VisionEval with:\
VisionEval-Source\built\visioneval\<your R version number e.g., 4.1.``3``>\
This will contain a few key folders:
src: The VisionEval package source.
ve-lib: The package library containing all built and installed R packages.
runtime: The built model runtime.