Open Bug 1499063 Opened 8 years ago Updated 3 years ago

Provide support for task directories to be under a fixed path

Categories

(Taskcluster :: Workers, enhancement, P5)

enhancement

Tracking

(Not tracked)

REOPENED

People

(Reporter: pmoore, Unassigned, Mentored)

References

Details

(Keywords: good-first-bug, Whiteboard: [lang=go])

Sometimes task caches only work when they are available at a given file path. For example, sccache uses the full file path of a file as a key into its database (I believe), and also python virtualenv directories sometimes/always become invalid when relocated to a new filesystem path. We work around this in gecko Windows builds by creating a symlink from Z:\build to the task directory, and then invoking build system commands from Z:\build, in order to keep a consistent path across tasks. However, it complicates the task payload commands, and isn't very pretty. If we add a feature to the worker to support running task commands from a fixed path, this should solve this problem. Note, this isn't completely trivial, as we have configuration options to retain old task directories, and we could hit new security challenges with different task users having access permissions to the same file system paths that were previously namespaced by task user username. Note, we already distinguish between task directory and task user home directory, so it may be possible to keep a consistent task directory without moving the task user home directories. However, on many work types, the task directory and user home directory are the same, so special attention needs to be made here, that we don't break anything. This would be a great bug for someone that wants to get involved with generic-worker, since it isn't super high priority for us to implement, given the other bugs which are of a higher priority, but it is one that would make certain groups of users very happy.
Potential "gotchas": 1) As described above - need to make sure config setting `cleanUpTaskDirs` still works when set to true/false - and if a user elects not to clean up task directories, that we have a mechanism for archiving the task directory somewhere before running the next task 2) Many work types have task directory = task user home directory. If the task directory moves to a static location, we need to think carefully about whether the task user home directory should be in a fixed location too. 3) For tasks that assume that the task directory and the task user home directory are named after the task user username, we should think about whether we reuse the same task username for each task. If we do this, we need to make sure that it has a different UID/SID to previous task users, so that it won't inherit any permissions that a previous task set, and that the previous task users really are successfully purged between tasks. 4) We need to check for any other type of corruption that occur, such as registry entries that use the user's username as a key for permissions, rather than the user's SID, etc - so that permissions do not leak between tasks. 5) Failure to delete/move directories in cleanup become critical errors now - previously, if we had trouble removing a directory for a previous task, it was a non-critical error, since new tasks could run without interference. Probably this isn't a bad thing since it forces us to ensure a cleaner environment is created for the new task. 6) We need to think carefully about how this affects all platforms, not just Windows. On macOS/Linux we don't create separate users currently (see bug 1499051 and bug 1499054 for that) - so the impact is smaller, but also needs to be considered. In any case, we should certainly make sure we have tests to ensure that tasks can't exploit the fact the task directory / home directory / task user username is reused, across all of the supported platforms.
Component: Generic-Worker → Workers

This is still an issue.

Would this be a good first bug for generic-worker?

Flags: needinfo?(pmoore)

Possibly. For the brave.

Mentor: pmoore
Flags: needinfo?(pmoore)
Keywords: good-first-bug
Whiteboard: [lang=go]
Priority: -- → P5

I would like to work on this bug, might be a good way to learn about generic-worker

Flags: needinfo?(pmoore)

Hi vnzongzna,

Thanks for your interest in this bug!

Do you have time to meet up over Skype / Vidyo / Zoom / WhatsApp / some other video conferencing solution, to talk through it?

I'm generally available between 9am and 6pm Monday-Friday, Central European time - so let me know if there is a time that suits you.

Thanks,
Pete

Flags: needinfo?(pmoore) → needinfo?(vnzongzna)

Yes, I can meet up over meet, zoom or whatsapp to talk through it. I am currently in Indian Standard Time and can discuss over chat.mozilla.org about timing and contact details.
I am not familiar with generic-worker code base yet, but would be happy to discuss my ideas so far.

Flags: needinfo?(vnzongzna)

(closed in bulk closure of old P5 bugs, representing that they are unlikely to ever be worked on)

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INACTIVE

Reopening inactive bugs, because they may still need attention. Historically, inactive bugs were closed, but this hides the fact there are genuine issues which have not been resolved.

Status: RESOLVED → REOPENED
Resolution: INACTIVE → ---
You need to log in before you can comment on or make changes to this bug.