Skip to content

Commit 58978b5

Browse files
avovchenkoekrivokonmapr
authored andcommitted
[SPARK-274] Create home directory for user who submitted job (apache#308)
1 parent 4d16c25 commit 58978b5

File tree

1 file changed

+5
-5
lines changed
  • resource-managers/kubernetes/docker/src/main/dockerfiles/spark

1 file changed

+5
-5
lines changed

resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,12 @@ function createUserGroups() {
160160

161161
function createUser() {
162162
if ! id $CURRENT_USER >/dev/null 2>&1; then
163-
adduser -u $USER_ID $CURRENT_USER
163+
adduser -u $USER_ID $CURRENT_USER -m -d /home/$CURRENT_USER
164+
if [ -d /home/$CURRENT_USER ]; then
165+
cd /home/$CURRENT_USER
166+
fi
164167
fi
168+
chown $CURRENT_USER ./
165169
}
166170

167171
#Run configure.sh
@@ -175,10 +179,6 @@ if [ ! $SPARK_K8S_CMD == "init" ]; then
175179
/opt/mapr/server/configure.sh -c -C $MAPR_CLDB_HOSTS -Z $MAPR_ZK_HOSTS -N $MAPR_CLUSTER
176180
fi
177181

178-
if [ $SPARK_K8S_CMD == "executor" ]; then
179-
chown $CURRENT_USER ./
180-
fi
181-
182182
exec sudo -u $CURRENT_USER -E "${CMD[@]}"
183183
else
184184
# Execute the container CMD

0 commit comments

Comments
 (0)