Spaces:
Runtime error
Runtime error
AnujPanthri
commited on
Commit
·
e2e357f
1
Parent(s):
b80497c
added kaggle status checking script
Browse files
.github/workflows/checking_kaggle_status.sh
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
check_status(){
|
| 6 |
+
COMMAND="kaggle k status $1"
|
| 7 |
+
while true
|
| 8 |
+
do
|
| 9 |
+
echo "EXECUTING: $COMMAND"
|
| 10 |
+
sleep 2s
|
| 11 |
+
KERNEL_STATUS=$($COMMAND)
|
| 12 |
+
echo "OUTPUT: $KERNEL_STATUS"
|
| 13 |
+
# okay now try to exit or raise error
|
| 14 |
+
if [[ $KERNEL_STATUS == *"kernel must be specified"* ]]; then
|
| 15 |
+
# error
|
| 16 |
+
echo "ERROR"
|
| 17 |
+
exit 1
|
| 18 |
+
|
| 19 |
+
elif [[ $KERNEL_STATUS == *"has status \"complete\""* ]]; then
|
| 20 |
+
# success
|
| 21 |
+
echo "Notebook finished running !"
|
| 22 |
+
exit 0
|
| 23 |
+
|
| 24 |
+
else
|
| 25 |
+
echo "Notebook still running on kaggle..."
|
| 26 |
+
fi
|
| 27 |
+
done
|
| 28 |
+
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
KERNEL_ID=$1
|
| 32 |
+
check_status $KERNEL_ID
|
.github/workflows/kaggle.yaml
CHANGED
|
@@ -9,26 +9,14 @@ jobs:
|
|
| 9 |
deploy:
|
| 10 |
runs-on: ubuntu-latest
|
| 11 |
steps:
|
| 12 |
-
- name: Kaggle kernel
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
with:
|
| 16 |
-
kaggle_username: ${{ secrets.KAGGLE_USERNAME }}
|
| 17 |
-
kaggle_key: ${{ secrets.KAGGLE_KEY }}
|
| 18 |
-
kernel_id: anujpanthri/train-image-colorization
|
| 19 |
-
kaggle_make_new_kernel: true
|
| 20 |
-
code_file_path: kaggle/train-image-colorization.ipynb
|
| 21 |
-
kaggle_metadata_path: kaggle/kernel-metadata.json
|
| 22 |
-
collect_output: true
|
| 23 |
|
| 24 |
-
- name:
|
| 25 |
run: |
|
| 26 |
-
|
| 27 |
-
unzip outputs/outputs.zip
|
| 28 |
-
ls outputs/outputs/
|
| 29 |
|
| 30 |
- name: Download outputs
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
path: outputs/outputs.zip
|
|
|
|
| 9 |
deploy:
|
| 10 |
runs-on: ubuntu-latest
|
| 11 |
steps:
|
| 12 |
+
- name: Push Kaggle kernel
|
| 13 |
+
run: kaggle kernels push -p kaggle/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
- name: Checking Kaggle Status
|
| 16 |
run: |
|
| 17 |
+
bash .github/workflows/checking_kaggle_status.sh $KAGGLE_KERNEL_ID
|
|
|
|
|
|
|
| 18 |
|
| 19 |
- name: Download outputs
|
| 20 |
+
run: |
|
| 21 |
+
kaggle k output $KAGGLE_KERNEL_ID -p outputs/
|
| 22 |
+
ls outputs/
|
|
|
checking_kaggle_status.sh
DELETED
|
@@ -1,15 +0,0 @@
|
|
| 1 |
-
#!/bin/bash
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
check_status(){
|
| 5 |
-
KERNEL_STATUS=$(kaggle k status)
|
| 6 |
-
RESULT=$?
|
| 7 |
-
while true
|
| 8 |
-
do
|
| 9 |
-
sleep 2s
|
| 10 |
-
echo $KERNEL_STATUS
|
| 11 |
-
done
|
| 12 |
-
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
check_status
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|