composeFromSource: Compose a Acumos microservice from its source file

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/fromSource.R

Description

composeFromSource generates everything necessary to create a Acumos microservice directly from a specifically written R file, representing the component source.

Usage

1
2
3
4
5
6
composeFromSource(
  file = "acumos.R",
  name = "R Component",
  outputfile = "component.zip",
  addSource = T
)

Arguments

file

string, name of component source file (an R script)

name

string, name of the component

outputfile

string, filename for the resulting component file

addSource

boolean, to add source file to the (ZIP) bundle or not

Value

Structure describing the component (parsed content of the JSON description).

Note

A regular component source file is an R script in which at least one of the three following functions are defined: acumos_predict, acumos_transform or acumos_fit. They respectively correspond to the functions predict, transform and fit of compose. In that script, if the functions acumos_generate, acumos_service or acumos_initialize are defined, they will also correspond to the other function type arguments of compose, namely generate, service and initialize.

All the R objects defined in that script are included as auxiliary objects that are to be passed to the global workspace of the component. They will fill the aux argument of compose.

Author(s)

Alassane Samba

See Also

compose

Examples

1
2
3
4
5
6
7
8
# see an example source file in:
print(system.file("examples","example_0/", package = "acumos"))
# compose from acumos.R
example_source<-system.file("examples","example_0","acumos.R", package = "acumos")
composeFromSource(
  file=example_source,
  outputfile = "acumos_bundle_example_0.zip"
)

s-u/acumos documentation built on March 16, 2020, 2:27 a.m.