File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ app_setup_block: |
7676# changelog
7777changelogs :
7878 - { date: "11.07.21:", desc: "Bump node to 14 to fix builds" }
79+ - { date: "05.07.21:", desc: "Fix slow `chown` on large workspace" }
7980 - { date: "08.05.21:", desc: "Fix doc link" }
8081 - { date: "04.02.20:", desc: "Allow setting gui password via hash using env var `HASHED_PASSWORD`." }
8182 - { date: "23.12.20:", desc: "Allow setting sudo password via hash using env var `SUDO_PASSWORD_HASH`." }
Original file line number Diff line number Diff line change @@ -18,5 +18,20 @@ if [ -n "${SUDO_PASSWORD}" ] || [ -n "${SUDO_PASSWORD_HASH}" ]; then
1818fi
1919
2020# permissions
21- chown -R abc:abc \
22- /config
21+ if [ -f "/usr/bin/find" ] && [ -f "/usr/bin/xargs" ]; then
22+ # Split workload between config and workspace
23+ echo "setting permissions::configuration"
24+ CORES=$(nproc --all)
25+ find /config -maxdepth 4 -mindepth 1 -path /config/workspace -prune -false -o -type d | \
26+ xargs --max-args=1 --max-procs=$(($CORES*2*8)) \
27+ chown -R abc:abc
28+
29+ echo "setting permissions::workspace"
30+ chown abc:abc /config/workspace
31+ find /config/workspace -maxdepth 4 -mindepth 1 -type d | \
32+ xargs --max-args=1 --max-procs=$(($CORES*2*16)) \
33+ chown -R abc:abc
34+ else
35+ chown -R abc:abc \
36+ /config
37+ fi
You can’t perform that action at this time.
0 commit comments