Skip to content

Fix comment on workdir (very confusing) #3181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ekzhang
Copy link
Member

@ekzhang ekzhang commented May 24, 2025

Extremely confusing field called workdir on ImageMetadata which is not actually used by any of our systems, ImageManifest.workdir is the actual workdir. This is wrong in 99% of images.

@mwaskom
Copy link
Contributor

mwaskom commented May 27, 2025

Not sure I know the initial intention here or exactly the nature of the confusion, but I think this is meant to convey what the workdir state would be for subsequent builder tasks, (i.e. so that we can know where .add_local_* layers would put their files with a relative remote location. @freider might know more.

@ekzhang
Copy link
Member Author

ekzhang commented May 27, 2025

Yeah there's a somewhat confusing issue in that image.manifest.workdir and image.workdir are different. image.manifest.workdir is the actual workdir, and it's read by tasks on startup:

  • runner tasks: uses manifest.workdir, otherwise /root if not set
  • builder tasks: uses manifest.workdir, otherwise / if not set
  • sandbox tasks: uses sandbox.workdir, otherwise manifest.workdir if not set, otherwise / if not set

Meanwhile image.workdir is not read by anything in the runtime and is a duplicate metadata value that is measured by builder.

The issue is that for the vast majority of tasks, manifest.workdir is not set, but in the internal lookup and database for images, we see workdir: / observed by this metadata process. Which is misleading — it's actually not set, and the runtime code treats it as not set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants