diambra / init

init container image to download sources during evaluation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

init

This implements an init container to download users sources and other assets required during an agent run.

Configuration

SOURCES

  • json map of strings
  • key is a path relative to /sources and the value is the url to download the source from
  • currently only http(s) is supported
  • additionally a processor can be specified. Currently only unzip is supported. Example:
{ "data": "https+unzip://example.com/my-source.zip" }

SECRETS

  • json map of strings
  • key is a name and value the value of the secret
  • secrets can be refered to in SOURCES. Example:
SECRETS='{"password": "my-secret"}'
SOURCES='{"data": "https+unzip://user:{{ .Secrets.password }}@example.com/my-source.zip"}'

Assets

  • same as SOURCES but the path can be absolute
  • used internally for additional assets

Docker

Build

docker build -t init .

Run

Using git:

docker run --rm \
    -e SOURCES='{".": "git+https://discordianfish:{{.Secrets.gh_token}}@github.com/discordianfish/diambra-agent.git#ref=main"}' \
    -e SECRETS="{\"gh_token\": \"$(pass dev/github/pat)\"}" \
    -v /tmp/sources:/sources init

About

init container image to download sources during evaluation

License:Apache License 2.0


Languages

Language:Go 98.8%Language:Dockerfile 1.2%