Skip to content

Commit

Permalink
add purge.sh wrapper and disable python bytecode writing (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
pymonger authored Oct 6, 2020
1 parent 12f58a5 commit ac556d7
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions aws_get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
source ~/.bash_profile

BASE_PATH=$(dirname "${BASH_SOURCE}")
export PYTHONDONTWRITEBYTECODE=1

# check args
if [ "$#" -eq 3 ]; then
Expand Down
2 changes: 1 addition & 1 deletion docker/job-spec.json.lw-mozart-purge
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"required_queues":["system-jobs-queue"],
"command":"python /home/ops/lightweight-jobs/purge.py",
"command":"/home/ops/lightweight-jobs/purge.sh",
"disk_usage":"3GB",
"soft_time_limit": 86400,
"time_limit": 86700,
Expand Down
2 changes: 1 addition & 1 deletion docker/job-spec.json.lw-tosca-purge
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"required_queues":["system-jobs-queue"],
"command":"python /home/ops/lightweight-jobs/purge.py",
"command":"/home/ops/lightweight-jobs/purge.sh",
"imported_worker_files":{
"$HOME/.aws":"/home/ops/.aws",
"$HOME/.azure": "/home/ops/.azure"
Expand Down
1 change: 1 addition & 0 deletions notify_by_email.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
source ~/.bash_profile

BASE_PATH=$(dirname "${BASH_SOURCE}")
export PYTHONDONTWRITEBYTECODE=1

# send email
echo "##########################################" 1>&2
Expand Down
24 changes: 24 additions & 0 deletions purge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
BASE_PATH=$(dirname "${BASH_SOURCE}")
BASE_PATH=$(cd "${BASE_PATH}"; pwd)

# source PGE env
export PYTHONPATH=$BASE_PATH:$PYTHONPATH
export PATH=$BASE_PATH:$PATH
export PYTHONDONTWRITEBYTECODE=1

# source environment
source $HOME/verdi/bin/activate

echo "##########################################" 1>&2
echo -n "Running purge.py: " 1>&2
date 1>&2
python $BASE_PATH/purge.py
STATUS=$?
echo -n "Finished running purge.py: " 1>&2
date 1>&2
if [ $STATUS -ne 0 ]; then
echo "Failed to run purge.py" 1>&2
cat purge.log 1>&2
exit $STATUS
fi
1 change: 1 addition & 0 deletions retry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
source ~/.bash_profile

BASE_PATH=$(dirname "${BASH_SOURCE}")
export PYTHONDONTWRITEBYTECODE=1

# retry job
echo "##########################################" 1>&2
Expand Down
1 change: 1 addition & 0 deletions wget.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
source ~/.bash_profile

BASE_PATH=$(dirname "${BASH_SOURCE}")
export PYTHONDONTWRITEBYTECODE=1

# check args
if [ "$#" -eq 3 ]; then
Expand Down

0 comments on commit ac556d7

Please sign in to comment.