core

package
v0.0.0-...-d3da680 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package core includes some of the core concepts of cipkg. Those interfaces are shared across cipkg framework including: - Derivation - Action - PackageManager Detailed description for each interface are in their own files.

Index

Constants

This section is empty.

Variables

View Source
var (
	Action_Metadata_CIPD_InstallMode_name = map[int32]string{
		0: "copy",
		1: "symlink",
	}
	Action_Metadata_CIPD_InstallMode_value = map[string]int32{
		"copy":    0,
		"symlink": 1,
	}
)

Enum value maps for Action_Metadata_CIPD_InstallMode.

View Source
var (
	HashAlgorithm_name = map[int32]string{
		0: "HASH_UNSPECIFIED",
		1: "HASH_MD5",
		2: "HASH_SHA256",
	}
	HashAlgorithm_value = map[string]int32{
		"HASH_UNSPECIFIED": 0,
		"HASH_MD5":         1,
		"HASH_SHA256":      2,
	}
)

Enum value maps for HashAlgorithm.

View Source
var (
	// ErrPackageNotExist returns when trying to increase the reference of a
	// non-existent package.
	ErrPackageNotExist = errors.New("package does not exist")
)
View Source
var File_go_chromium_org_luci_cipkg_core_action_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_cipkg_core_derivation_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_cipkg_core_specs_proto protoreflect.FileDescriptor

Functions

func GetActionID

func GetActionID(a *Action) (string, error)

GetActionID calculates a unique ID from action's content and can represent package abstraction. Different actions may generate same derivation and share underlying content. ActionID isn't safe to be used as filesystem path.

func GetDerivationID

func GetDerivationID(drv *Derivation) (string, error)

GetDerivationID calculates a unique ID from derivation's content and can represent its corresponding output content. The DerivationID is safe for filesystem path and other common applications.

Types

type Action

type Action struct {

	// Name is required for all actions. It's the name of the action's output.
	// The name shouldn't include version of the package and should represents
	// its content (e.g. cpython3, curl, ninja), NOT the action taken place
	// (e.g. build_cpython3, build_curl, build_ninja).
	// This name doesn't need to be unique and won't be used for deduplication,
	// but may be used as the placeholder for the path to the package during
	// transformation.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Metadata contains metadata information which won't affect the result of the
	// output. It can be used by package manager for cache/store packages and
	// helping users to identify its content.
	Metadata *Action_Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// Dependencies which PackageManager will ensure being available prior to the
	// execution of this Action.
	// TODO: Maybe move dependencies into specs?
	Deps []*Action `protobuf:"bytes,3,rep,name=deps,proto3" json:"deps,omitempty"`
	// Spec is the action spec describing what action we want to perform.
	// It can be extended using extension for domain-specific use cases.
	// See cipkg/base/actions.ActionProcessor for additional details.
	//
	// Types that are assignable to Spec:
	//
	//	*Action_Command
	//	*Action_Url
	//	*Action_Copy
	//	*Action_Cipd
	//	*Action_Extension
	Spec isAction_Spec `protobuf_oneof:"spec"`
	// contains filtered or unexported fields
}

Action is a high level description of one node in the build graph.

It includes a set of predefined verbs (e.g. `command`, `reexec`, ...) and provides the ability to add additional high level verbs within a single application // (`extension` field, see `cipkg/base/actions.SetTransformer` for additional details).

Typically, Actions are produced via the Generation process (see `cipkg/base/generators“ for more details).

An action's dependency on additional Actions forms the high level build graph.

The Action graph is transformed into a Derivation graph via the ActionProcessor (see `cipkg/base/actions.ActionProcessor` for additional details).

Actions exist apart from Derivations in order to maintain a serializable/debuggable structure which is higher level than the raw Derivations, which end up including system specific details.

func (*Action) Descriptor deprecated

func (*Action) Descriptor() ([]byte, []int)

Deprecated: Use Action.ProtoReflect.Descriptor instead.

func (*Action) GetCipd

func (x *Action) GetCipd() *ActionCIPDExport

func (*Action) GetCommand

func (x *Action) GetCommand() *ActionCommand

func (*Action) GetCopy

func (x *Action) GetCopy() *ActionFilesCopy

func (*Action) GetDeps

func (x *Action) GetDeps() []*Action

func (*Action) GetExtension

func (x *Action) GetExtension() *anypb.Any

func (*Action) GetMetadata

func (x *Action) GetMetadata() *Action_Metadata

func (*Action) GetName

func (x *Action) GetName() string

func (*Action) GetSpec

func (m *Action) GetSpec() isAction_Spec

func (*Action) GetUrl

func (x *Action) GetUrl() *ActionURLFetch

func (*Action) ProtoMessage

func (*Action) ProtoMessage()

func (*Action) ProtoReflect

func (x *Action) ProtoReflect() protoreflect.Message

func (*Action) Reset

func (x *Action) Reset()

func (*Action) String

func (x *Action) String() string

type ActionCIPDExport

type ActionCIPDExport struct {

	// Ensure_file is the serialized text ensure file for cipd.
	EnsureFile string `protobuf:"bytes,1,opt,name=ensure_file,json=ensureFile,proto3" json:"ensure_file,omitempty"`
	// Env is the extra environment variables passed to the cipd process.
	Env []string `protobuf:"bytes,2,rep,name=env,proto3" json:"env,omitempty"`
	// contains filtered or unexported fields
}

ActionCIPDExport exports cipd packages to the output directory. NOTE: this uses cipd export subcommand, which only includes CIPD package content without any cipd tracking metadata. TODO(fancl): use a protobuf ensure file instead.

func (*ActionCIPDExport) Descriptor deprecated

func (*ActionCIPDExport) Descriptor() ([]byte, []int)

Deprecated: Use ActionCIPDExport.ProtoReflect.Descriptor instead.

func (*ActionCIPDExport) GetEnsureFile

func (x *ActionCIPDExport) GetEnsureFile() string

func (*ActionCIPDExport) GetEnv

func (x *ActionCIPDExport) GetEnv() []string

func (*ActionCIPDExport) ProtoMessage

func (*ActionCIPDExport) ProtoMessage()

func (*ActionCIPDExport) ProtoReflect

func (x *ActionCIPDExport) ProtoReflect() protoreflect.Message

func (*ActionCIPDExport) Reset

func (x *ActionCIPDExport) Reset()

func (*ActionCIPDExport) String

func (x *ActionCIPDExport) String() string

type ActionCommand

type ActionCommand struct {
	Args []string `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"`
	Env  []string `protobuf:"bytes,2,rep,name=env,proto3" json:"env,omitempty"`
	// contains filtered or unexported fields
}

ActionCommand executes the command directly. Template is supported in both args and env: {{.depName}} will be replaced by the output path of the action's dependency with depName. e.g. An ActionCommand with python3 as dependency:

&core.Action{
  Name: "some_script",
  Deps: []*core.Action_Dependency{Python3Action},
  Spec: &core.Action_Command{
    Command: &core.ActionCommand{
      Args: []string{"{{.python3}}/bin/python3", "something.py")},
    },
  }
}

"{{.python3}}/bin/python3" will be replaced by the output path in the transformed derivation.

func (*ActionCommand) Descriptor deprecated

func (*ActionCommand) Descriptor() ([]byte, []int)

Deprecated: Use ActionCommand.ProtoReflect.Descriptor instead.

func (*ActionCommand) GetArgs

func (x *ActionCommand) GetArgs() []string

func (*ActionCommand) GetEnv

func (x *ActionCommand) GetEnv() []string

func (*ActionCommand) ProtoMessage

func (*ActionCommand) ProtoMessage()

func (*ActionCommand) ProtoReflect

func (x *ActionCommand) ProtoReflect() protoreflect.Message

func (*ActionCommand) Reset

func (x *ActionCommand) Reset()

func (*ActionCommand) String

func (x *ActionCommand) String() string

type ActionFilesCopy

type ActionFilesCopy struct {

	// Files are the destination-source pairs which is the relative path
	// source files should be copied to.
	Files map[string]*ActionFilesCopy_Source `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

ActionFilesCopy copies listed files into the output directory. TODO(fancl): Local, Embed, Output can be separated into different specs?

func (*ActionFilesCopy) Descriptor deprecated

func (*ActionFilesCopy) Descriptor() ([]byte, []int)

Deprecated: Use ActionFilesCopy.ProtoReflect.Descriptor instead.

func (*ActionFilesCopy) GetFiles

func (x *ActionFilesCopy) GetFiles() map[string]*ActionFilesCopy_Source

func (*ActionFilesCopy) ProtoMessage

func (*ActionFilesCopy) ProtoMessage()

func (*ActionFilesCopy) ProtoReflect

func (x *ActionFilesCopy) ProtoReflect() protoreflect.Message

func (*ActionFilesCopy) Reset

func (x *ActionFilesCopy) Reset()

func (*ActionFilesCopy) String

func (x *ActionFilesCopy) String() string

type ActionFilesCopy_Source

type ActionFilesCopy_Source struct {

	// Mode is unix file mode.
	Mode uint32 `protobuf:"varint,1,opt,name=mode,proto3" json:"mode,omitempty"`
	// Win_attrs is windows file attributes.
	WinAttrs uint32 `protobuf:"varint,7,opt,name=win_attrs,json=winAttrs,proto3" json:"win_attrs,omitempty"`
	// Version is the version string for the file.
	Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`
	// Types that are assignable to Content:
	//
	//	*ActionFilesCopy_Source_Raw
	//	*ActionFilesCopy_Source_Local_
	//	*ActionFilesCopy_Source_Embed_
	//	*ActionFilesCopy_Source_Output_
	Content isActionFilesCopy_Source_Content `protobuf_oneof:"content"`
	// contains filtered or unexported fields
}

Source defines the source file we want to copied from.

func (*ActionFilesCopy_Source) Descriptor deprecated

func (*ActionFilesCopy_Source) Descriptor() ([]byte, []int)

Deprecated: Use ActionFilesCopy_Source.ProtoReflect.Descriptor instead.

func (*ActionFilesCopy_Source) GetContent

func (m *ActionFilesCopy_Source) GetContent() isActionFilesCopy_Source_Content

func (*ActionFilesCopy_Source) GetEmbed

func (*ActionFilesCopy_Source) GetLocal

func (*ActionFilesCopy_Source) GetMode

func (x *ActionFilesCopy_Source) GetMode() uint32

func (*ActionFilesCopy_Source) GetOutput

func (*ActionFilesCopy_Source) GetRaw

func (x *ActionFilesCopy_Source) GetRaw() []byte

func (*ActionFilesCopy_Source) GetVersion

func (x *ActionFilesCopy_Source) GetVersion() string

func (*ActionFilesCopy_Source) GetWinAttrs

func (x *ActionFilesCopy_Source) GetWinAttrs() uint32

func (*ActionFilesCopy_Source) ProtoMessage

func (*ActionFilesCopy_Source) ProtoMessage()

func (*ActionFilesCopy_Source) ProtoReflect

func (x *ActionFilesCopy_Source) ProtoReflect() protoreflect.Message

func (*ActionFilesCopy_Source) Reset

func (x *ActionFilesCopy_Source) Reset()

func (*ActionFilesCopy_Source) String

func (x *ActionFilesCopy_Source) String() string

type ActionFilesCopy_Source_Embed

type ActionFilesCopy_Source_Embed struct {

	// Ref is the reference to the embed.FS.
	Ref string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"`
	// Path is the relative path to the file inside the embedded filesystem.
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func (*ActionFilesCopy_Source_Embed) Descriptor deprecated

func (*ActionFilesCopy_Source_Embed) Descriptor() ([]byte, []int)

Deprecated: Use ActionFilesCopy_Source_Embed.ProtoReflect.Descriptor instead.

func (*ActionFilesCopy_Source_Embed) GetPath

func (x *ActionFilesCopy_Source_Embed) GetPath() string

func (*ActionFilesCopy_Source_Embed) GetRef

func (*ActionFilesCopy_Source_Embed) ProtoMessage

func (*ActionFilesCopy_Source_Embed) ProtoMessage()

func (*ActionFilesCopy_Source_Embed) ProtoReflect

func (*ActionFilesCopy_Source_Embed) Reset

func (x *ActionFilesCopy_Source_Embed) Reset()

func (*ActionFilesCopy_Source_Embed) String

type ActionFilesCopy_Source_Embed_

type ActionFilesCopy_Source_Embed_ struct {
	// Embed refers to the embedded file in the go binary.
	Embed *ActionFilesCopy_Source_Embed `protobuf:"bytes,4,opt,name=embed,proto3,oneof"`
}

type ActionFilesCopy_Source_Local

type ActionFilesCopy_Source_Local struct {

	// Path is the local filesystem absolute path to the file.
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// Follow_symlinks, if set to true, will follow all the symlinks in the
	// directories while copying.
	FollowSymlinks bool `protobuf:"varint,3,opt,name=follow_symlinks,json=followSymlinks,proto3" json:"follow_symlinks,omitempty"`
	// contains filtered or unexported fields
}

func (*ActionFilesCopy_Source_Local) Descriptor deprecated

func (*ActionFilesCopy_Source_Local) Descriptor() ([]byte, []int)

Deprecated: Use ActionFilesCopy_Source_Local.ProtoReflect.Descriptor instead.

func (x *ActionFilesCopy_Source_Local) GetFollowSymlinks() bool

func (*ActionFilesCopy_Source_Local) GetPath

func (x *ActionFilesCopy_Source_Local) GetPath() string

func (*ActionFilesCopy_Source_Local) ProtoMessage

func (*ActionFilesCopy_Source_Local) ProtoMessage()

func (*ActionFilesCopy_Source_Local) ProtoReflect

func (*ActionFilesCopy_Source_Local) Reset

func (x *ActionFilesCopy_Source_Local) Reset()

func (*ActionFilesCopy_Source_Local) String

type ActionFilesCopy_Source_Local_

type ActionFilesCopy_Source_Local_ struct {
	// Local refers to the local file.
	Local *ActionFilesCopy_Source_Local `protobuf:"bytes,3,opt,name=local,proto3,oneof"`
}

type ActionFilesCopy_Source_Output

type ActionFilesCopy_Source_Output struct {

	// Name is the output action's Metadata.Name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Path is the relative path to the file inside the output.
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func (*ActionFilesCopy_Source_Output) Descriptor deprecated

func (*ActionFilesCopy_Source_Output) Descriptor() ([]byte, []int)

Deprecated: Use ActionFilesCopy_Source_Output.ProtoReflect.Descriptor instead.

func (*ActionFilesCopy_Source_Output) GetName

func (*ActionFilesCopy_Source_Output) GetPath

func (*ActionFilesCopy_Source_Output) ProtoMessage

func (*ActionFilesCopy_Source_Output) ProtoMessage()

func (*ActionFilesCopy_Source_Output) ProtoReflect

func (*ActionFilesCopy_Source_Output) Reset

func (x *ActionFilesCopy_Source_Output) Reset()

func (*ActionFilesCopy_Source_Output) String

type ActionFilesCopy_Source_Output_

type ActionFilesCopy_Source_Output_ struct {
	// Output refers to the output file from other derivations.
	Output *ActionFilesCopy_Source_Output `protobuf:"bytes,5,opt,name=output,proto3,oneof"`
}

type ActionFilesCopy_Source_Raw

type ActionFilesCopy_Source_Raw struct {
	// Raw contains the literal content of the file.
	Raw []byte `protobuf:"bytes,2,opt,name=raw,proto3,oneof"`
}

type ActionURLFetch

type ActionURLFetch struct {

	// HTTP(s) url for the remote resource.
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// HashAlgorithm is the hash function used to calculate hash value.
	HashAlgorithm HashAlgorithm `protobuf:"varint,2,opt,name=hash_algorithm,json=hashAlgorithm,proto3,enum=HashAlgorithm" json:"hash_algorithm,omitempty"`
	// HashValue is the lower-case text representation for the hex value of the
	// hash sum.
	HashValue string `protobuf:"bytes,3,opt,name=hash_value,json=hashValue,proto3" json:"hash_value,omitempty"`
	// contains filtered or unexported fields
}

ActionURLFetch downloads from url into output directory with name 'file'.

func (*ActionURLFetch) Descriptor deprecated

func (*ActionURLFetch) Descriptor() ([]byte, []int)

Deprecated: Use ActionURLFetch.ProtoReflect.Descriptor instead.

func (*ActionURLFetch) GetHashAlgorithm

func (x *ActionURLFetch) GetHashAlgorithm() HashAlgorithm

func (*ActionURLFetch) GetHashValue

func (x *ActionURLFetch) GetHashValue() string

func (*ActionURLFetch) GetUrl

func (x *ActionURLFetch) GetUrl() string

func (*ActionURLFetch) ProtoMessage

func (*ActionURLFetch) ProtoMessage()

func (*ActionURLFetch) ProtoReflect

func (x *ActionURLFetch) ProtoReflect() protoreflect.Message

func (*ActionURLFetch) Reset

func (x *ActionURLFetch) Reset()

func (*ActionURLFetch) String

func (x *ActionURLFetch) String() string

type Action_Cipd

type Action_Cipd struct {
	Cipd *ActionCIPDExport `protobuf:"bytes,7,opt,name=cipd,proto3,oneof"`
}

type Action_Command

type Action_Command struct {
	Command *ActionCommand `protobuf:"bytes,4,opt,name=command,proto3,oneof"`
}

type Action_Copy

type Action_Copy struct {
	Copy *ActionFilesCopy `protobuf:"bytes,6,opt,name=copy,proto3,oneof"`
}

type Action_Extension

type Action_Extension struct {
	Extension *anypb.Any `protobuf:"bytes,99,opt,name=extension,proto3,oneof"`
}

type Action_Metadata

type Action_Metadata struct {

	// Dependencies which PackageManager will ensure being available prior to
	// the use of this Action's output.
	RuntimeDeps []*Action                `protobuf:"bytes,1,rep,name=runtime_deps,json=runtimeDeps,proto3" json:"runtime_deps,omitempty"`
	Cipd        *Action_Metadata_CIPD    `protobuf:"bytes,2,opt,name=cipd,proto3" json:"cipd,omitempty"`
	Luciexe     *Action_Metadata_LUCIExe `protobuf:"bytes,3,opt,name=luciexe,proto3" json:"luciexe,omitempty"`
	// context_info can be used to indicate what this action related to - this
	// can help e.g. differentiate action with same content but comes from
	// different generator.
	ContextInfo string `protobuf:"bytes,4,opt,name=context_info,json=contextInfo,proto3" json:"context_info,omitempty"`
	// contains filtered or unexported fields
}

func (*Action_Metadata) Descriptor deprecated

func (*Action_Metadata) Descriptor() ([]byte, []int)

Deprecated: Use Action_Metadata.ProtoReflect.Descriptor instead.

func (*Action_Metadata) GetCipd

func (x *Action_Metadata) GetCipd() *Action_Metadata_CIPD

func (*Action_Metadata) GetContextInfo

func (x *Action_Metadata) GetContextInfo() string

func (*Action_Metadata) GetLuciexe

func (x *Action_Metadata) GetLuciexe() *Action_Metadata_LUCIExe

func (*Action_Metadata) GetRuntimeDeps

func (x *Action_Metadata) GetRuntimeDeps() []*Action

func (*Action_Metadata) ProtoMessage

func (*Action_Metadata) ProtoMessage()

func (*Action_Metadata) ProtoReflect

func (x *Action_Metadata) ProtoReflect() protoreflect.Message

func (*Action_Metadata) Reset

func (x *Action_Metadata) Reset()

func (*Action_Metadata) String

func (x *Action_Metadata) String() string

type Action_Metadata_CIPD

type Action_Metadata_CIPD struct {

	// Name is the cipd package name for the Action's output.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Version is the cipd version tag for action's output. Version tag
	// considered to be unique.
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// disable_upload, if true, indicates the package shouldn't be uploaded
	// to CIPD service.
	DisableUpload bool `protobuf:"varint,3,opt,name=disable_upload,json=disableUpload,proto3" json:"disable_upload,omitempty"`
	// tags is the list of extra tags should be attached to the cipd instance.
	Tags []string `protobuf:"bytes,4,rep,name=tags,proto3" json:"tags,omitempty"`
	// refs is the list of extra refs should be attached to the cipd instance.
	Refs []string `protobuf:"bytes,5,rep,name=refs,proto3" json:"refs,omitempty"`
	// install_mode the installation method of the cipd package on client
	// machines.
	// If omitted, this defaults to `copy`.
	InstallMode Action_Metadata_CIPD_InstallMode `` /* 133-byte string literal not displayed */
	// version_file is the CIPD-installation-relative path to a version file.
	// If omitted, no version file will be added to the package.
	VersionFile string `protobuf:"bytes,7,opt,name=version_file,json=versionFile,proto3" json:"version_file,omitempty"`
	// contains filtered or unexported fields
}

func (*Action_Metadata_CIPD) Descriptor deprecated

func (*Action_Metadata_CIPD) Descriptor() ([]byte, []int)

Deprecated: Use Action_Metadata_CIPD.ProtoReflect.Descriptor instead.

func (*Action_Metadata_CIPD) GetDisableUpload

func (x *Action_Metadata_CIPD) GetDisableUpload() bool

func (*Action_Metadata_CIPD) GetInstallMode

func (*Action_Metadata_CIPD) GetName

func (x *Action_Metadata_CIPD) GetName() string

func (*Action_Metadata_CIPD) GetRefs

func (x *Action_Metadata_CIPD) GetRefs() []string

func (*Action_Metadata_CIPD) GetTags

func (x *Action_Metadata_CIPD) GetTags() []string

func (*Action_Metadata_CIPD) GetVersion

func (x *Action_Metadata_CIPD) GetVersion() string

func (*Action_Metadata_CIPD) GetVersionFile

func (x *Action_Metadata_CIPD) GetVersionFile() string

func (*Action_Metadata_CIPD) ProtoMessage

func (*Action_Metadata_CIPD) ProtoMessage()

func (*Action_Metadata_CIPD) ProtoReflect

func (x *Action_Metadata_CIPD) ProtoReflect() protoreflect.Message

func (*Action_Metadata_CIPD) Reset

func (x *Action_Metadata_CIPD) Reset()

func (*Action_Metadata_CIPD) String

func (x *Action_Metadata_CIPD) String() string

type Action_Metadata_CIPD_InstallMode

type Action_Metadata_CIPD_InstallMode int32
const (
	Action_Metadata_CIPD_copy    Action_Metadata_CIPD_InstallMode = 0
	Action_Metadata_CIPD_symlink Action_Metadata_CIPD_InstallMode = 1
)

func (Action_Metadata_CIPD_InstallMode) Descriptor

func (Action_Metadata_CIPD_InstallMode) Enum

func (Action_Metadata_CIPD_InstallMode) EnumDescriptor deprecated

func (Action_Metadata_CIPD_InstallMode) EnumDescriptor() ([]byte, []int)

Deprecated: Use Action_Metadata_CIPD_InstallMode.Descriptor instead.

func (Action_Metadata_CIPD_InstallMode) Number

func (Action_Metadata_CIPD_InstallMode) String

func (Action_Metadata_CIPD_InstallMode) Type

type Action_Metadata_LUCIExe

type Action_Metadata_LUCIExe struct {

	// step_name is the name of this action when it's being executed under
	// luciexe framework.
	StepName string `protobuf:"bytes,1,opt,name=step_name,json=stepName,proto3" json:"step_name,omitempty"`
	// contains filtered or unexported fields
}

func (*Action_Metadata_LUCIExe) Descriptor deprecated

func (*Action_Metadata_LUCIExe) Descriptor() ([]byte, []int)

Deprecated: Use Action_Metadata_LUCIExe.ProtoReflect.Descriptor instead.

func (*Action_Metadata_LUCIExe) GetStepName

func (x *Action_Metadata_LUCIExe) GetStepName() string

func (*Action_Metadata_LUCIExe) ProtoMessage

func (*Action_Metadata_LUCIExe) ProtoMessage()

func (*Action_Metadata_LUCIExe) ProtoReflect

func (x *Action_Metadata_LUCIExe) ProtoReflect() protoreflect.Message

func (*Action_Metadata_LUCIExe) Reset

func (x *Action_Metadata_LUCIExe) Reset()

func (*Action_Metadata_LUCIExe) String

func (x *Action_Metadata_LUCIExe) String() string

type Action_Url

type Action_Url struct {
	Url *ActionURLFetch `protobuf:"bytes,5,opt,name=url,proto3,oneof"`
}

type Derivation

type Derivation struct {

	// Name is the name of the derivation's output and serves ONLY as an
	// indicator of its output.
	// The name shouldn't include version of the package and should represents
	// its content (e.g. cpython3, curl, ninja), NOT the action taken place
	// (e.g. build_cpython3, build_curl, build_ninja).
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Platform is a textual description of the platform in which this Derivation
	// should be performed, and serves ONLY as an indicator of implicit
	// environmental contamination of the output of the derivation.
	// Actions should relies on cipkg/base/actions.ActionProcessor to populate
	// this field appropriately.
	Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"`
	// Args are the `argv` vector of the derivation when executed.
	Args []string `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"`
	// Env includes all the environment variables for the execution isolated from
	// host.
	// NOTE: ${out} is not included here but will be presented in the environment
	// during execution.
	Env []string `protobuf:"bytes,4,rep,name=env,proto3" json:"env,omitempty"`
	// Inputs are ids of all packages referred by this derivation.
	// It depends on the package manager to ensure packages represented by the
	// derivation IDs will be available before execution.
	// Ideally derivation should only be able to access derivations listed in the
	// inputs. Executor may lock down the runtime environment to prevent the
	// derivation from accessing any resource other than those listed in the
	// future.
	Inputs []string `protobuf:"bytes,5,rep,name=inputs,proto3" json:"inputs,omitempty"`
	// fixed_output, if set, represents the content of the output. ID will be
	// generated based on fixed_output exclusively.
	// WARNING: Using fixed_output means shifting away the responsibility for
	// detecting any change from derivation. This should be rarely touched and
	// most of its use cases have a builtin implementation to take care of the
	// generated fixed_output value. Any use of it outside the builtin modules
	// are strongly discouraged. YOU HAVE BEEN WARNED.
	FixedOutput string `protobuf:"bytes,6,opt,name=fixed_output,json=fixedOutput,proto3" json:"fixed_output,omitempty"`
	// contains filtered or unexported fields
}

Derivation is the atomic step transformed from different types of actions. It should contain all information used during the execution in its definition. NOTE: ${out} enviroment variable is not part of the derivation. We can't determine the output directory before we have a deterministic derivation so it has to be excluded from derivation to avoid self-reference.

func (*Derivation) Descriptor deprecated

func (*Derivation) Descriptor() ([]byte, []int)

Deprecated: Use Derivation.ProtoReflect.Descriptor instead.

func (*Derivation) GetArgs

func (x *Derivation) GetArgs() []string

func (*Derivation) GetEnv

func (x *Derivation) GetEnv() []string

func (*Derivation) GetFixedOutput

func (x *Derivation) GetFixedOutput() string

func (*Derivation) GetInputs

func (x *Derivation) GetInputs() []string

func (*Derivation) GetName

func (x *Derivation) GetName() string

func (*Derivation) GetPlatform

func (x *Derivation) GetPlatform() string

func (*Derivation) ProtoMessage

func (*Derivation) ProtoMessage()

func (*Derivation) ProtoReflect

func (x *Derivation) ProtoReflect() protoreflect.Message

func (*Derivation) Reset

func (x *Derivation) Reset()

func (*Derivation) String

func (x *Derivation) String() string

type HashAlgorithm

type HashAlgorithm int32

HashAlgorithm includes all supported hash algorithms shared by actions.

const (
	HashAlgorithm_HASH_UNSPECIFIED HashAlgorithm = 0
	HashAlgorithm_HASH_MD5         HashAlgorithm = 1
	HashAlgorithm_HASH_SHA256      HashAlgorithm = 2
)

func (HashAlgorithm) Descriptor

func (HashAlgorithm) Enum

func (x HashAlgorithm) Enum() *HashAlgorithm

func (HashAlgorithm) EnumDescriptor deprecated

func (HashAlgorithm) EnumDescriptor() ([]byte, []int)

Deprecated: Use HashAlgorithm.Descriptor instead.

func (HashAlgorithm) Number

func (HashAlgorithm) String

func (x HashAlgorithm) String() string

func (HashAlgorithm) Type

type PackageHandler

type PackageHandler interface {
	// OutputDirectory() returns the output directory.
	OutputDirectory() string

	// LoggingDirectory() returns the logging directory.
	LoggingDirectory() string

	// Build(buildFunc) makes packages available in the storage.
	// It's responsible for:
	// - Hold exclusive lock to the package during the build.
	// - Ensure build only happens once unless the package is removed.
	// - Check the remote cache server (if possible).
	// - Set up the build environment (e.g. create output directory).
	// - Mark package available if build function successfully returns.
	// Calling build function is expected to trigger the actual build iff package
	// isn't available yet.
	Build(builder func() error) error

	// TryRemove() may remove the package only if there is no reference to it.
	TryRemove() (ok bool, err error)

	// Reference the package to prevent it from being removed while in use.
	// IncRef() updates the last access time of the package as well.
	// IncRef() only succeeds if the package is available.
	// Otherwise ErrPackageNotExist will be returned.
	IncRef() error
	DecRef() error
}

PackageHandler is the interface for a handler in the storage. The content of a package can be built by calling Build(func(Package) error) error, which will make package available if successful and can be referenced by other packages. Package shouldn't be modified after build.

type PackageManager

type PackageManager interface {
	// Get(id) returns the handler for the package.
	Get(id string) PackageHandler
}

PackageManager represents the management interface for packages to provide a place for storing and retrieving packages.

Jump to

Keyboard shortcuts

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