Skip to content

Support passing environment variables #10

@popzxc

Description

@popzxc

Technically, we have support for getting environment variables that is not utilized currently.
We can make it possible getting environment variables, e.g. (as one of thoughts) as follows:

  1. Pass metadata from host to guest through Inputs (e.g. extend this structure to be able to set env vars).
  2. On guest, add a way to retrieve metadata and "install" it, potentially with validation (e.g. restrict which environment variables can be set and which cannot).
  3. In "installation", initialize a once cell for "guest state", which for now will include environment variables and their values.
  4. In sys_getenv from airbender-rt/glue access this guest state and read data from there.

Note: if we will be using inputs for passing info from host to guest, it's important to make sure that we don't introduce inconsistencies, e.g. think about the following:

  • Probably passing metadata should be opt-in. Maybe we need some kind of HostMetadataBuilder (choose better name) that will have a builder interface which would allow adding more functionality later in a non-breaking way.
  • Decoding metadata should be explicit and consistent, e.g. potentially we want clients to read it as an explicit action and "install" (with potential validation, as described above) as another explicit action.

There should be no surprices or magic happening under the hood.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions