Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
[kube-runtime] fix runtime bug (#3776)
Browse files Browse the repository at this point in the history
Runtime goes wrong when repeat execuate in same env. Fix such bug
  • Loading branch information
Binyang2014 authored Oct 29, 2019
1 parent 7bcd966 commit 36b3a2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/kube-runtime/src/init
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ PAI_LOG_DIR=${PAI_WORK_DIR}/logs/${FC_POD_UID}

# Move previous logs to another folder. Notice: exclude for init.log, new log will append to previous log file
LOG_FILES=$(find $PAI_LOG_DIR -maxdepth 1 -type f ! -name "init.log")
if [[ ! -z $LOG_FILES ]]; then
if [[ ! -z "$LOG_FILES" ]]; then
echo "[WARN] $PAI_LOG_DIR not empty, contains previous results"
PRE_LOG_DIR=$PAI_LOG_DIR/prelog_$RANDOM
while [[ -d $PRE_LOG_DIR ]]
Expand All @@ -100,7 +100,7 @@ if [[ ! -z $LOG_FILES ]]; then
fi

# Clean ${PAI_WORK_DIR} since it may contain last execution content. (rarely happen, but seen in real world)
find ${PAI_WORK_DIR} -maxdepth 1 -type f -exec rm {} \;
find ${PAI_WORK_DIR} -maxdepth 1 -mindepth 1 ! -name "logs" -exec rm -rf {} \;


# Move all runtime sources to PAI_WORK_DIR
Expand Down

0 comments on commit 36b3a2c

Please sign in to comment.