Skip to content

Implement remote assets #421

@hulto

Description

@hulto

Is your feature request related to a problem? Please describe.
Right now we don't have an easy way to take a tome from local testing with golem into production.
Currently every instance of assests.* has to be replace with a file.download and file.* function.
To avoid this we should implement a remote option to the assets module.

Describe the solution you'd like

  1. Create a new dictionary tavern_remote_assest using the pattern set by input_params that's passed into every tome.

    • This dictionary will track file names ---> remote asset links.
    • If a file name isn't found as a key of tavern_remote_assest then it's not a remote asset.
  2. Implement remote versions of each assets function:

    • Use the current callback URI
    • Transparently acces the tavern_remote_assest dict with something like the following:
use starlark::eval::Evaluator;

pub fn list(starlark_eval: &mut Evaluator) -> Result<Vec<i32>> {
    let tmp = starlark_eval
        .module()
        .get("tavern_remote_assest")
        .context("Failed to get 'tavern_remote_assest' ")?;
    unimplemented!();
}
- Translate the asset name `persist_service/systemd_service.j2` to a downloadable URL `https://<CALLBACK_URI>/cdn/download/Bundle-504b83fae75bc5c068803d59311ce53babf71bde2c49142a4d20cda91c8e6f08` using the `tavern_remote_assest` dictionary.
- download, read, or stream the content from remote asset to fulfill the assets function goal.
  1. Implement a search order for assets:

    • The assets library should first check for remote files and then local ones.
      • The thought is that by allowing remote to override local we avoid situations where a local copy of something breaks the tome
    • If an asset is not found in the tavern_remote_assest dictionary then search the local Assets struct for a file with the same name.
  2. Add the tavern_remote_assest Dict to the tavern ---> imix communication such that the task has the tomes unique key value pairs.

Describe alternatives you've considered
Na

Additional context
Na

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions