Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate mistral from st2ci #189

Merged
merged 3 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 3 additions & 32 deletions actions/backup_logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
set -e

ST2_EXEC_ID=$1
MISTRAL_REPO=$2
MISTRAL_LOG_DIR=$3
ST2_REPO=$4
ST2_LOG_DIR=$5
BACKUP_DIR=$6
ST2_REPO=$2
ST2_LOG_DIR=$3
BACKUP_DIR=$4

# Cleanup anything from the backup directory older than a week
find ${BACKUP_DIR}/* -type d -ctime +7 | xargs rm -rf
Expand All @@ -22,30 +20,3 @@ if [[ -d "${ST2_LOG_DIR}" ]]; then
echo "Backing up st2 logs..."
cp ${ST2_LOG_DIR}/*.log ${BACKUP_PATH}
fi

# Backup mistral logs
if [[ -d "${MISTRAL_LOG_DIR}" ]]; then
echo "Backing up mistral logs..."
cp ${MISTRAL_LOG_DIR}/mistral*.log ${BACKUP_PATH}
fi

# Capture any DB deadlocks
echo "Capturing DB logs..."
sudo -u postgres psql -x -c "SELECT ka.query AS blocking, a.query AS blocked FROM pg_catalog.pg_locks bl JOIN pg_catalog.pg_stat_activity a ON a.pid = bl.pid JOIN pg_catalog.pg_locks kl ON kl.transactionid = bl.transactionid AND kl.pid != bl.pid JOIN pg_catalog.pg_stat_activity ka ON ka.pid = kl.pid WHERE NOT bl.GRANTED;" > ${BACKUP_PATH}/psql_deadlocks.log

# Stop services to clear locks so the backup steps below can run.
${ST2_REPO}/tools/launchdev.sh stop
sudo service mistral stop
sudo service postgresql stop
sleep 3

# Restart services.
sudo service postgresql start
sudo service mistral start
sleep 3

# Backup the list of WF and task executions
. ${MISTRAL_REPO}/.venv/bin/activate
mistral execution-list > ${BACKUP_PATH}/mistral_execution_list.txt
mistral task-list > ${BACKUP_PATH}/mistral_task_list.txt
deactivate
15 changes: 3 additions & 12 deletions actions/backup_logs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,19 @@
type: string
description: Action execution ID for reference.
position: 0
mis_repo_dir:
type: string
description: Location of the local mistral repo.
position: 1
mis_log_dir:
type: string
description: Location of mistral logs.
position: 2
default: /var/log
st2_repo_dir:
type: string
description: Location of the local st2 repo.
position: 3
position: 1
st2_log_dir:
type: string
description: Location of st2 logs.
position: 4
position: 2
default: /var/log/st2
backup_dir:
type: string
description: Location where to backup logs.
position: 5
position: 3
default: /home/stanley/logs
dir:
immutable: true
Expand Down
81 changes: 0 additions & 81 deletions actions/mistral.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions actions/mistral_get_build_hosts.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions actions/mistral_get_commit_shas.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions actions/mistral_get_host.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions actions/mistral_merge_upstreams.yaml

This file was deleted.

71 changes: 0 additions & 71 deletions actions/mistral_setup_infra.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions actions/mistral_teardown_infra.yaml

This file was deleted.

Loading