BB.Inference.Artefact (bb_inference v0.1.0)

Copy Markdown View Source

Where a model's artefact lives.

The :bb_inference compiler places each model's artefact at priv/bb_inference/<Robot>/<model><extension> in the application that defines the robot, so it is part of the build and of any release. The extension is the artefact's own - from archive_member when the source is an archive, otherwise from the source.

Summary

Functions

The archive format of source, judged by its name, or nil.

The artefact's absolute path at runtime.

The artefact's path relative to the application's priv.

Whether source is a URL rather than a local path.

Functions

archive_format(source)

@spec archive_format(String.t()) :: :zip | :tar | :tar_gz | nil

The archive format of source, judged by its name, or nil.

path(robot, model)

The artefact's absolute path at runtime.

A robot that isn't part of an application - one compiled in a script, say - has nothing placed for it, so a local source is used where it is.

relative_path(robot, model)

@spec relative_path(module(), BB.Inference.Dsl.Model.t()) :: Path.t()

The artefact's path relative to the application's priv.

url?(source)

@spec url?(String.t()) :: boolean()

Whether source is a URL rather than a local path.