You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Change the working directory to the new directory
107
+
docker exec -t colab /bin/bash -c "set -o xtrace && set -o errexit && set -o pipefail && set -o nounset && set +o errexit && cd /content/temp/${nb} && papermill --log-level='DEBUG' /content/notebooks/getting_started/${nb}.ipynb /content/test/outputs/${nb}_papermill_output.ipynb && set -o errexit && ls -A"
108
+
94
109
docker stop colab
95
110
docker rm colab
111
+
sudo rm -r "temp/${nb}"
96
112
done
97
-
98
-
# skip commit
99
-
#- name: Commit changes
100
-
# if: ${{ github.event_name != 'pull_request' }}
101
-
# uses: stefanzweifel/git-auto-commit-action@v4
102
-
# with:
103
-
# commit_message: 'Check colab env'
104
-
# file_pattern: 'test/*.csv test/outputs/*.ipynb'
105
-
# branch: 'master'
106
-
107
-
#- name: Check output notebooks for errors
108
-
# run: |
109
-
# for nb in part1_prerequisites part2_searching_basics part3_exploring_cohorts; do
110
-
# if grep -q '"name": "stderr"\|"status": "failed"' test/outputs/output_${nb}.ipynb; then
111
-
# echo "Error messages found in the ${nb} notebook output:"
112
-
# cat test/outputs/output_${nb}.ipynb
113
-
# exit 1
114
-
# else
115
-
# echo "No errors found in the ${nb} notebook output."
116
-
# fi
117
-
# done
118
-
# exit $EXIT_CODE
113
+
114
+
- name: Create Pull Request to update the colab image metadata database
115
+
if: github.event_name != 'pull_request'
116
+
uses: peter-evans/create-pull-request@v5
117
+
with:
118
+
title: Update colab images list
119
+
body: Update colab-images-list.csv so that when a colab image is updated, we do not keep pulling colab docker image from gcp and pushing to dockerhub everytime
cell.source=cell.source.replace('my_ProjectID = "" #@param {type:"string"}', f"#this project_id is injected for testing\nmy_ProjectID='{project_id}'")
14
+
cell.source=cell.source.replace(
15
+
'my_ProjectID = "" #@param {type:"string"}',
16
+
f"#this project_id is injected for testing\nmy_ProjectID='{project_id}'",
17
+
)
14
18
# Comment out another line
15
-
cell.source=cell.source.replace('auth.authenticate_user()', '#while testing, the authentication is handled by using application default credentials\n#auth.authenticate_user()')
16
-
cell.source=cell.source.replace('REPLACE THIS TEXT WITH YOUR QUERY!', query1)
17
-
cell.source=cell.source.replace('# write the selection criteria under this line!', query2)
19
+
cell.source=cell.source.replace(
20
+
"auth.authenticate_user()",
21
+
"#while testing, the authentication is handled by using application default credentials\n#auth.authenticate_user()",
22
+
)
23
+
cell.source=cell.source.replace(
24
+
"REPLACE THIS TEXT WITH YOUR QUERY!", query1
25
+
)
26
+
cell.source=cell.source.replace(
27
+
"# write the selection criteria under this line!", query2
query1='#this query is injected for testing\n SELECT DISTINCT collection_tumorLocation FROM `bigquery-public-data.idc_current.dicom_all` 'if'part2'infile_nameelse''
34
-
query2='#this query is injected for testing\n MODALITY=\'MR\' AND collection_tumorLocation=\'Lung\''if'part2'infile_nameelse''
49
+
project_id="idc-external-025"
50
+
query1= (
51
+
"#this query is injected for testing\n SELECT DISTINCT collection_tumorLocation FROM `bigquery-public-data.idc_current.dicom_all` "
52
+
if"part2"infile_name
53
+
else""
54
+
)
55
+
query2= (
56
+
"#this query is injected for testing\n MODALITY='MR' AND collection_tumorLocation='Lung'"
0 commit comments