d2g

package
v57.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

README

d2g

The d2g repo is intended to contain the following tooling:

  • A go library for converting Docker Worker task payloads into Generic Worker task payloads
  • A CLI wrapper for the above go library

Eventually this library will be used in Generic Worker, in order to support Docker Worker task payloads. On detecting that a claimed task has a Docker Worker payload, it will use the d2g library to convert the payload into its own native format, before validating and executing it.

The intention is that this library will also be helpful to users wishing to convert Docker Worker task payloads directly to Generic Worker native task payloads, as it is intended to eventually deprecate the Docker Worker payload format entirely.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(dwPayload *dockerworker.DockerWorkerPayload) (gwPayload *genericworker.GenericWorkerPayload, err error)

Convert transforms a Docker Worker task payload into an equivalent Generic Worker Multiuser POSIX task payload. The resulting Generic Worker payload is a BASH script which uses Podman to contain the Docker Worker payload. Since scopes fall outside of the payload in a task definition, scopes need to be converted separately (see d2g.Scopes function).

func ConvertTaskDefinition

func ConvertTaskDefinition(dwTaskDef json.RawMessage) (json.RawMessage, error)

func Scopes

func Scopes(dwScopes []string, dwPayload *dockerworker.DockerWorkerPayload, taskQueueID string) (gwScopes []string)

Scopes takes a slice of Docker Worker task scopes and returns a slice of equivalent Generic Worker scopes. These scopes should be used together with a converted Docker Worker task payload (see d2g.Convert function) to run Docker Worker tasks under Generic Worker.

Types

type DockerImageArtifact

type DockerImageArtifact dockerworker.DockerImageArtifact

func (*DockerImageArtifact) FileMounts

func (dia *DockerImageArtifact) FileMounts() ([]genericworker.FileMount, error)

func (*DockerImageArtifact) String

func (dia *DockerImageArtifact) String() (string, error)

type DockerImageName

type DockerImageName string

func (*DockerImageName) FileMounts

func (din *DockerImageName) FileMounts() ([]genericworker.FileMount, error)

func (*DockerImageName) String

func (din *DockerImageName) String() (string, error)

type Image

type Image interface {
	FileMounts() ([]genericworker.FileMount, error)
	String() (string, error)
}

type IndexedDockerImage

type IndexedDockerImage dockerworker.IndexedDockerImage

func (*IndexedDockerImage) FileMounts

func (idi *IndexedDockerImage) FileMounts() ([]genericworker.FileMount, error)

func (*IndexedDockerImage) String

func (idi *IndexedDockerImage) String() (string, error)

type NamedDockerImage

type NamedDockerImage dockerworker.NamedDockerImage

func (*NamedDockerImage) FileMounts

func (ndi *NamedDockerImage) FileMounts() ([]genericworker.FileMount, error)

func (*NamedDockerImage) String

func (ndi *NamedDockerImage) String() (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL