Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(worker): deterministic worker working directory #3584

@fsamin

Description

@fsamin

Actually some tools requires to be ran with the directory structures.

Example from terraform:
https://www.terraform.io/guides/running-terraform-in-automation.html

Terraform currently makes some assumptions which must be accommodated by such an automation setup:

The saved plan file can contain absolute paths to child modules and other data files referred to by configuration. Therefore it is necessary to ensure that the archived configuration is extracted at an identical absolute path. This is most commonly achieved by running Terraform in some sort of isolation, such as a Docker container, where the filesystem layout can be controlled.

but out worker working directory is not deterministic:

// Setup working directory
	pbJobPath := path.Join(fmt.Sprintf("%d", jobInfo.Number),
		fmt.Sprintf("%d", jobInfo.SubNumber),
		fmt.Sprintf("%d", jobInfo.NodeJobRun.ID),
		fmt.Sprintf("%d", jobInfo.NodeJobRun.Job.PipelineActionID))
	wd := workingDirectory(w.basedir, pbJobPath)

we should have to refactor this to be able to have always the same working directory (for the same workermodel)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions