Skip to content

Commit 51e6478

Browse files
authored
Merge pull request #1479 from ImagingDataCommons/idc-prod-sp
#1487, banner removal
2 parents d3120ff + cb51848 commit 51e6478

File tree

10 files changed

+79
-64
lines changed

10 files changed

+79
-64
lines changed

idc/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,16 @@
159159
print("[ERROR] While trying to set local/developer git version: ")
160160
print(e)
161161
VERSION = "{}.{}.{}".format("local-dev", datetime.datetime.now().strftime('%Y%m%d%H%M'), "unavailable")
162+
else:
163+
print("[ERROR] Application version file not found for non-dev deployment! Exiting...")
164+
exit(1)
162165

163166
APP_VERSION = os.environ.get("APP_VERSION", VERSION)
164167

165168
DEV_TIER = bool(DEBUG or re.search(r'^local-dev\.', APP_VERSION))
166169

167170
print("[STATUS] DEV_TIER setting is {}".format(DEV_TIER))
171+
print("[STATUS] Application version is {}".format(APP_VERSION))
168172

169173
# If this is a GAE-Flex deployment, we don't need to specify SSL; the proxy will take
170174
# care of that for us

shell/install-deps.sh

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if [ -n "$CI" ]; then
2-
echo "Check our Python and Ubuntu versions since they keep getting updated without warning..."
2+
echo "[STATUS] Check our Python and OS versions since they keep getting updated without warning..."
33

44
ls -l /usr/bin/python3*
55
cat /etc/os-release
@@ -14,7 +14,7 @@ if [ -n "$CI" ]; then
1414
elif [[ ${CIRCLE_BRANCH} == "expr" ]]; then
1515
COMMON_BRANCH=expr
1616
fi
17-
echo "Cloning IDC-Common branch ${COMMON_BRANCH}..."
17+
echo "[STATUS] Cloning IDC-Common branch ${COMMON_BRANCH}..."
1818
git clone -b ${COMMON_BRANCH} https://github.com/ImagingDataCommons/IDC-Common.git
1919
else
2020
if ( "/home/vagrant/www/shell/get_env.sh" ) ; then
@@ -35,7 +35,7 @@ find . -type f -name '*.pyc' -delete
3535
apt-get update -qq
3636
3737
# Install and update apt-get info
38-
echo "Preparing System..."
38+
echo "[STATUS] Preparing System..."
3939
apt-get -y --force-yes install software-properties-common ca-certificates gnupg
4040
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv B7B3B788A8D3785C
4141
wget "https://repo.mysql.com/mysql-apt-config_0.8.30-1_all.deb" -P /tmp
@@ -46,48 +46,48 @@ apt-get update -qq
4646
apt-get install mysql-client
4747
4848
# Install apt-get dependencies
49-
echo "Installing Dependencies..."
49+
echo "[STATUS] Installing Dependencies..."
5050
apt-get install -y --force-yes unzip libffi-dev libssl-dev git g++ curl dos2unix pkg-config
5151
apt-get install -y --force-yes python3-distutils python3-mysqldb libmysqlclient-dev libpython3-dev build-essential
5252
apt-get install -y --force-yes python3-pip
5353
54-
echo "Dependencies Installed"
54+
echo "[STATUS] Dependencies Installed"
5555
5656
# If this is local development, clean out lib for a re-structuring
5757
if [ -z "${CI}" ]; then
5858
# Clean out lib to prevent confusion over multiple builds in local development
5959
# and prep for local install
60-
echo "Emptying out ${HOMEROOT}/lib/ ..."
60+
echo "[STATUS] Emptying out ${HOMEROOT}/lib/ ..."
6161
rm -rf "${HOMEROOT}/lib/"
62-
echo "Confirming clearance of lib:"
62+
echo "[STATUS] Confirming clearance of lib:"
6363
ls ${HOMEROOT}/lib/
6464
fi
6565
6666
# Install PIP + Dependencies
67-
echo "Installing pip3..."
67+
echo "[STATUS] Installing pip3..."
6868
curl --silent https://bootstrap.pypa.io/get-pip.py | python3
6969
7070
# Install our primary python libraries
7171
# If we're not on CircleCI, or we are but the lib directory isn't there (cache miss), install lib
7272
if [ -z "${CI}" ] || [ ! -d "lib" ]; then
73-
echo "Installing Python Libraries..."
73+
echo "[STATUS] Installing Python Libraries..."
7474
pip install -r ${HOMEROOT}/requirements.txt -t ${HOMEROOT}/lib --upgrade --only-binary all
7575
else
76-
echo "Using restored cache for Python Libraries"
76+
echo "[STATUS] Using restored cache for Python Libraries"
7777
fi
7878
7979
if [ -z "${CI}" ]; then
80-
echo "Installing responses library for unit tests, but not for deployment..."
80+
echo "[STATUS] Installing responses library for unit tests, but not for deployment..."
8181
pip install -q responses -t ${HOMEROOT}/lib --only-binary all
8282
fi
8383
8484
if [ "$DEBUG" = "True" ] && [ "$DEBUG_TOOLBAR" = "True" ]; then
85-
echo "Installing Django Debug Toolbar for local dev..."
85+
echo "[STATUS] Installing Django Debug Toolbar for local dev..."
8686
pip install -q django-debug-toolbar==3.2.4 -t ${HOMEROOT}/lib --only-binary all
8787
fi
8888
8989
if [ "$IS_DEV" = "True" ]; then
90-
echo "Installing GitPython for local dev version display..."
90+
echo "[STATUS] Installing GitPython for local dev version display..."
9191
pip install -q gitpython -t ${HOMEROOT}/lib --only-binary all
9292
fi
9393
@@ -96,22 +96,22 @@ echo "Libraries Installed"
9696
# Install Google Cloud SDK
9797
# If we're not on CircleCI or we are but google-cloud-sdk isn't there, install it
9898
if [ -z "${CI}" ] || [ ! -d "/usr/lib/google-cloud-sdk" ]; then
99-
echo "Installing Google Cloud SDK..."
99+
echo "[STATUS] Installing Google Cloud SDK..."
100100
export CLOUDSDK_CORE_DISABLE_PROMPTS=1
101101
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
102102
apt-get -y install apt-transport-https ca-certificates
103103
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
104104
apt-get update -qq
105105
apt-get -y install google-cloud-sdk
106106
apt-get -y install google-cloud-sdk-app-engine-python
107-
echo "Google Cloud SDK Installed"
107+
echo "[STATUS] Google Cloud SDK Installed"
108108
fi
109109
110110
# Run dos2unix on the files in shell/ because of line terminator shenanigans with Windows
111-
echo "Running dos2unix on shell/*.sh..."
111+
echo "[STATUS] Running dos2unix on shell/*.sh..."
112112
dos2unix ${HOMEROOT}/shell/*.sh
113113
114-
echo "Loading Git Hooks"
114+
echo "[STATUS] Loading Git Hooks"
115115
if [ -z "${CI}" ] && [ -d "${HOMEROOT}/git-hooks/" ]; then
116116
cp -r ${HOMEROOT}/git-hooks/* ${HOMEROOT}/.git/hooks/
117117
fi
@@ -123,5 +123,7 @@ if [ -n "${CI}" ]; then
123123
else
124124
TIER=${DEPLOYMENT_TIER,,}
125125
fi
126-
echo "APP_VERSION=${TIER}.$(date '+%Y%m%d%H%M').${APP_SHA}" > ${HOMEROOT}/version.env
126+
VERSION="${TIER}.$(date '+%Y%m%d%H%M').${APP_SHA}"
127+
echo "[STATUS] Application version set to ${VERSION}"
128+
echo "APP_VERSION=${VERSION}" > ${HOMEROOT}/version.env
127129
fi

static/css/search.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,14 @@ tr {
423423
width: 23.75%;
424424
word-wrap: break-word; }
425425

426+
#cases_table td.narrow, #cases_table_head th.narrow {
427+
width: 15%;
428+
word-wrap: break-word; }
429+
430+
#cases_table td.wide, #cases_table_head th.wide {
431+
width: 28%;
432+
word-wrap: break-word; }
433+
426434
#studies_table_head th, #studies_table td {
427435
word-break: break-word; }
428436

@@ -463,8 +471,11 @@ tr {
463471
}
464472

465473
#studies_table_head th.download-col,
466-
#studies_table td.download-col {
474+
#studies_table td.download-col, #cases_table_head th.download-col,
475+
#cases_table td.download-col, #series_table_head th.download-col,
476+
#series_table td.download-col {
467477
width:6%;
478+
min-width: 80px;
468479
}
469480

470481
#series_table_head th, #series_table td {

static/css/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4522,6 +4522,11 @@ d-topics-list iframe {
45224522
cursor: pointer;
45234523
}
45244524

4525+
.download-all-disabled {
4526+
cursor: not-allowed;
4527+
color: gray;
4528+
}
4529+
45254530
#floating-message {
45264531
position: fixed;
45274532
bottom: 50px;

static/js/downloader.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*/
1818

19-
// by @pieper 6/25/25
19+
// initial design by @pieper 6/25/25
2020
require.config({
2121
baseUrl: STATIC_FILES_URL + 'js/',
2222
paths: {
@@ -29,13 +29,20 @@ require([
2929
'base', 'jquery'
3030
], function (base, $) {
3131

32-
const byte_level = {
32+
const byte_level = Object.freeze({
3333
1: "KB",
3434
2: "MB",
3535
3: "GB",
3636
4: "TB",
3737
5: "PB"
38-
};
38+
});
39+
40+
const REQ_TYPE = Object.freeze({
41+
COLLECTION: 1,
42+
CASE: 2,
43+
STUDY: 3,
44+
SERIES: 4
45+
});
3946

4047
function size_display_string(size) {
4148
if(size <= 0) {
@@ -99,6 +106,7 @@ require([
99106
}
100107

101108
class DownloadRequest {
109+
request_type = REQ_TYPE.SERIES;
102110
region = "us-east-1";
103111

104112
constructor(request) {
@@ -111,6 +119,20 @@ require([
111119
this.crdc_series_id = request['crdc_series_id'];
112120
this.directory = request['directory'];
113121
this.total_size = parseFloat(request['series_size']);
122+
123+
if(this.series_id) {
124+
this.request_type = REQ_TYPE.SERIES;
125+
} else if(this.study_id) {
126+
this.request_type = REQ_TYPE.STUDY;
127+
} else if(this.patient_id) {
128+
this.request_type = REQ_TYPE.CASE;
129+
} else {
130+
this.request_type = REQ_TYPE.COLLECTION;
131+
}
132+
}
133+
134+
get request_type() {
135+
return
114136
}
115137

116138
async getAllS3ObjectKeys() {
@@ -181,7 +203,7 @@ require([
181203

182204
class DownloadQueueManager {
183205
WORKING_QUEUE_LIMIT = 2000;
184-
HOPPER_LIMIT = 500;
206+
HOPPER_LIMIT = 4000;
185207

186208
hopper = [];
187209
working_queue = [];
@@ -249,6 +271,7 @@ require([
249271
async _update_queue() {
250272
if(this.working_queue.length < this.WORKING_QUEUE_LIMIT && this.hopper.length > 0) {
251273
let request = this.hopper.pop();
274+
if(request)
252275
await request.loadAllKeys().then(keys => {
253276
this.working_queue.push(...keys);
254277
});

static/js/tables.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,10 +491,10 @@ define(['cartutils','filterutils','tippy','jquery', 'base'], function(cartutils,
491491
{className: "ckbx studyview","targets": [0]},
492492
{className: "ckbx shopping-cart-holder", "targets": [1]},
493493
{className: "ckbx cartnumholder", "targets":[2]},
494-
{className: "col1 project-name", "targets": [3]},
494+
{className: "col1 project-name wide", "targets": [3]},
495495
{className: "col1 case-id", "targets": [4]},
496-
{className: "col1 numrows", "targets": [5]},
497-
{className: "col1 numseries", "targets": [6]},
496+
{className: "col1 numrows narrow", "targets": [5]},
497+
{className: "col1 numseries narrow", "targets": [6]},
498498
{className: "col1 download-case download-col", "targets": [7]}];
499499
};
500500

@@ -864,7 +864,7 @@ define(['cartutils','filterutils','tippy','jquery', 'base'], function(cartutils,
864864
{className: "col1 numrows", "targets": [7]},
865865
{className: "ohif open-viewer", "targets": [8]},
866866
{className: "manifest-col", "targets": [9]},
867-
{className: "download-col", "targets": [10]},
867+
{className: "download-col download-study", "targets": [10]},
868868
],
869869
"columns": [
870870
{
@@ -1244,7 +1244,7 @@ define(['cartutils','filterutils','tippy','jquery', 'base'], function(cartutils,
12441244
{className: "series-description", "targets": [6]},
12451245
{className: "ohif open-viewer", "targets": [7]},
12461246
{className: "manifest-col", "targets": [8]},
1247-
{className: "download-col", "targets": [9]}
1247+
{className: "download-col download-series", "targets": [9]}
12481248
],
12491249
"columns": [
12501250
{"type": "html", "orderable": false, render: function () {

templates/base.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@
9494
</div>
9595
<div id="floating-message" style="display: none;">
9696
<div class="alert alert-info alert-dismissible">
97-
<button type="button" class="close" data-dismiss="alert">
98-
<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
99-
</button>
10097
<p class="floating-messages floating-message-header"></p>
10198
<p><span class="floating-messages floating-message-content"></span>
10299
<i class="floating-message-icon floating-message-icon-download fa-solid fa-atom fa-spin"

templates/idc/explore.html

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,6 @@
5555
</div>
5656
</div>
5757
</div>
58-
<div class="row">
59-
<div class="alert alert-warning alert-dismissible special-announcement">
60-
<button type="button" class="close" data-dismiss="alert">
61-
<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
62-
</button>
63-
We have removed user accounts from our system. If you would like to provide feedback on this
64-
decision or need help accessing your previously saved cohorts, please visit us at our
65-
<a class="external-link" href="" url="https://discourse.canceridc.dev/t/idc-portal-sign-in-feature-deprecation/723"
66-
title="IDC Discourse Forum" data-toggle="modal" data-target="#external-web-warning">
67-
Discourse topic <i class="fa-solid fa-external-link external-link-icon" aria-hidden="true"></i>
68-
</a>.
69-
</div>
70-
</div>
7158
<h3 class="pull-left" role="heading" aria-level="1">Explore Image Data </h3>
7259
{# {% if request.user.is_authenticated %}#}
7360
{# <button id="save-cohort-btn" class="btn btn-special pull-right" data-toggle="modal"#}

templates/idc/explore_data_core.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -864,11 +864,11 @@ <h4 class="panel-title">
864864
</th>
865865
<th class="ckbx cart-info"><i class="fa-solid fa-info-circle cart-info-icon"></i></th>
866866
<th class="ckbx cartnumholder"># of Series in Cart</th>
867-
<th class="text_data">Collection Name</th>
867+
<th class="text_data wide">Collection Name</th>
868868
<th class="text_data">Case ID <i class="fas fa-info-circle case-info"></i></th>
869-
<th class="numeric_data">Total # of Studies</th>
870-
<th class="numeric_data">Total # of Series</th>
871-
<th class="download-case"></th>
869+
<th class="numeric_data narrow">Total # of Studies</th>
870+
<th class="numeric_data narrow">Total # of Series</th>
871+
<th class="download-case download-col"></th>
872872
</tr>
873873
</thead>
874874
</table>
@@ -895,7 +895,7 @@ <h4 class="panel-title">
895895
<th class="col1 numrows numeric_data table-count"># of Series</th>
896896
<th class="ohif text_data open-viewer">View</th>
897897
<th class="manifest-col"></th>
898-
<th class="download-col"></th>
898+
<th class="download-col download-study"></th>
899899
</tr>
900900
</thead>
901901
</table>
@@ -917,9 +917,8 @@ <h4 class="panel-title">
917917
<th class="body-part-examined">Body Part Examined</th>
918918
<th class="series-description">Series Description</th>
919919
<th class="open-viewer text_data">View</th>
920-
<th class="series-citations"></th>
921920
<th class="download-manifest"></th>
922-
<th class="download-files"></th>
921+
<th class="download-files dowbload-series download-col"></th>
923922
</tr>
924923
</thead>
925924
</table>

templates/idc/landing.html

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,6 @@
4545
</div>
4646
</div>
4747
</div>
48-
<div class="row">
49-
<div class="alert alert-warning alert-dismissible special-announcement">
50-
<button type="button" class="close" data-dismiss="alert">
51-
<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
52-
</button>
53-
We have removed user accounts from our system. If you would like to provide feedback on this
54-
decision or need help accessing your previously saved cohorts, please visit us at our
55-
<a class="external-link" href="" url="https://discourse.canceridc.dev/t/idc-portal-sign-in-feature-deprecation/723"
56-
title="IDC Discourse Forum" data-toggle="modal" data-target="#external-web-warning">
57-
Discourse topic <i class="fa-solid fa-external-link external-link-icon" aria-hidden="true"></i>
58-
</a>.
59-
</div>
60-
</div>
6148
<div class="buttons row">
6249
<div class="container-fluid">
6350
<div class="col-lg-12 col-md-12 col-sm-12 buttons-col">

0 commit comments

Comments
 (0)