Contenuto principale

package

Create deployable archive or standalone application from pipeline

Since R2026a

    Description

    archivePath = package(pipeline,type,folder) creates a deployable archive or standalone application archivePath from the pipeline pipeline, generating files of the type type and storing the files in the folder folder. You can create an archive for deployment to MATLAB® Production Server™, or create a standalone application to run outside of MATLAB.

    To create an archive to deploy on MATLAB Production Server, you must have the MATLAB Client for MATLAB Production Server support package and MATLAB Compiler SDK™. To create a standalone application, you must have MATLAB Compiler™.

    example

    archivePath = package(pipeline,type,folder,Name=Value) Additionally allows you to specify a name for your archive and files to package with your pipeline using one or more name-value arguments.

    example

    Examples

    collapse all

    After you create a deployable archive using the package function, you can use the archive to deploy pipelines to MATLAB Production Server. Then, you can connect to the pipelines using the Python® or MATLAB client.

    Create a pipeline with two components.

    removeMissing = observationRemoverComponent;
    normalizer = normalizerComponent;
    pipeline = series(removeMissing,normalizer);

    Generate a deployable archive by using the package function.

    archivePath = package(pipeline,"ProductionServer","/files/to/deploy");

    For more information, see Deploy Pipeline to MATLAB Production Server.

    You can deploy pipelines as standalone applications, which do not require MATLAB to run.

    Create a standalone application in the folder "/files/to/deploy" by using the package function. Specify the name MyApplication for the standalone application.

     standalonePipeline = package(pipeline,"Application","/files/to/deploy",Name="MyApplication");

    From your system command line, run the pipeline as a standalone application named MyApplication in the folder /files/to/deploy/ with two outputs and one input.

    /files/to/deploy/MyApplication.exe 2,file:///work/deploy/data/x.mat,file:///work/deploy/data/y.mat run file:///work/deploy/data/a.mat

    The pipeline takes input from the file file:///work/deploy/data/a.mat, and outputs to the files file:///work/deploy/data/x.mat and file:///work/deploy/data/y.mat. For more information, see Call Pipeline as Standalone Application.

    When you create a deployable archive or standalone application using the package function, you can include additional files with the packaged pipeline.

    Create a pipeline with two components.

    removeMissing = observationRemoverComponent;
    normalizer = normalizerComponent;
    pipeline = series(removeMissing,normalizer);

    Generate a deployable archive by using the package function. Include the files /files/to/deploy/a.mat and /files/to/deploy/b.mat.

    archivePath = package(pipeline,"ProductionServer","/files/to/deploy",AdditionalFiles={"/files/to/deploy/a.mat","/files/to/deploy/b.mat"});

    Your pipeline can access these files when it is deployed.

    Input Arguments

    collapse all

    Pipeline from which to create a deployable archive or standalone application, specified as a LearningPipeline object.

    Type of file to generate, specified as "Application" for a standalone application, or "ProductionServer" for a deployable archive for MATLAB Production Server.

    Data Types: string | char

    Folder in which to place generated files, specified as a string scalar or character vector indicating a file path. If folder does not exist, the function creates it. If the folder already contains a file with the same name as a generated file, the function overwrites the existing file.

    Data Types: string | char

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: standalonePipeline = package(pipeline,"Application","/files/to/deploy",Name="MyApplication");

    Files to package with the pipeline, specified as a string scalar or character vector indicating a file path, or as a cell array or string vector specifying multiple file paths.

    Data Types: string | char

    Name of the generated file, specified as a string scalar or character vector. By default, the file generated by package has the same name as the pipeline used to create the file.

    Data Types: string | char

    Output Arguments

    collapse all

    Path to the archive containing the deployable version of pipeline, returned as a string scalar. If the value of type is "Application", this path is for a standalone application. If the value of type is "ProductionServer", this path is for a deployable archive for MATLAB Production Server.

    By default, the path filename is the same as pipeline unless you specify a different name using the Name name-value argument. The filename has the extension .ctf for MATLAB Production Server archives. For for standalone applications on Windows, it has the .exe extension. For for standalone applications on Linux, it has no extension. The path to the generated file is formed from the arguments as folder/name.[ext].

    More About

    collapse all

    Version History

    Introduced in R2026a

    See Also

    (MATLAB Production Server) | (MATLAB Production Server)