File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ app_setup_block: |
76
76
# changelog
77
77
changelogs :
78
78
- { date: "11.07.21:", desc: "Bump node to 14 to fix builds" }
79
+ - { date: "05.07.21:", desc: "Fix slow `chown` on large workspace" }
79
80
- { date: "08.05.21:", desc: "Fix doc link" }
80
81
- { date: "04.02.20:", desc: "Allow setting gui password via hash using env var `HASHED_PASSWORD`." }
81
82
- { 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
18
18
fi
19
19
20
20
# 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