Can't run the task cluster commands locally due to ~/.tc-vcs not existing

RESOLVED FIXED

Status

Taskcluster
General
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Away for a while, Unassigned)

Tracking

Details

(Whiteboard: [tc-vcs])

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
I'm trying to run https://tools.taskcluster.net/task-graph-inspector/#KkKhYP_AS1OC91Mz4t1W7g/I-V64jDOQO2bGMuNNDm4sg/ locally:

home/worker/tooltool-cache'   taskcluster/desktop-build:0.1.3   /bin/bash 'bin/build.sh'

# TODO: when bug 1093833 is solved and tasks can run as non-root, reduce this
# to a simple fail-if-root check
if [ $(id -u) = 0 ]; then
    # each of the caches we have mounted are owned by root, so update that ownership
    # to 'worker'
    for cache in /home/worker/.tc-vcs /home/worker/workspace /home/worker/tooltool-cache; do
        # -R probably isn't necessary forever, but it fixes some poisoned
        # caches for now
        chown -R worker:worker $cache
    done

    # ..then drop privileges by re-running this script
    exec su worker /home/worker/bin/build.sh
fi
++ id -u
+ '[' 0 = 0 ']'
+ for cache in /home/worker/.tc-vcs /home/worker/workspace /home/worker/tooltool-cache
+ chown -R worker:worker /home/worker/.tc-vcs
chown: cannot access `/home/worker/.tc-vcs': No such file or directory
See Also: → bug 1230511
Whiteboard: [tc-vcs]
Created attachment 8717779 [details] [diff] [review]
Ignore missing directories when changing ownership of cache directories in build.sh

This works locally for me if I change the build.sh file in the container, and allows to go to the next failure per bug 1230511 (tooltool).

Does this still require to bump a version and to create a new image?
Attachment #8717779 - Flags: review?(dustin)
Comment on attachment 8717779 [details] [diff] [review]
Ignore missing directories when changing ownership of cache directories in build.sh

Good fix, thanks.  Note, however, that running the container this way loses all caching, including vcs, so you'll have a long build time every run.
Attachment #8717779 - Flags: review?(dustin) → review+
Do I need to do something more than landing this patch?
Nope!

Comment 5

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/e39c9c48355d

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/e39c9c48355d
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.