Skip to content

Commit 2bf52e9

Browse files
authored
Fixed migrated WISE scan_id image failed to load (#1244)
* WiseIbeDataSource was using fits image from filesystem. - This is not reliable. Remove logic so it will call irsa/ibe instead. - fixed client table not showing filters when showFilters=true - docker local dev environment so all logs is showing in console - add ability to pass in 'env' in devMode
1 parent 8d25116 commit 2bf52e9

File tree

7 files changed

+30
-25
lines changed

7 files changed

+30
-25
lines changed

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ services:
3030
ports:
3131
- "8080:8080"
3232
- "5050:5050"
33+
env_file:
34+
- ./firefly-docker.env
3335
volumes: *volInfo

docker/Dockerfile

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@ RUN apt-get update \
4141
&& rm apache-tomcat-9*tar.gz \
4242
&& rm -rf /var/lib/apt/lists/*;
4343

44-
ENV JPDA_ADDRESS=*:5050 \
45-
CATALINA_HOME=/opt/tomcat \
46-
DEBUG=true \
47-
START_MODE=start \
44+
ENV CATALINA_HOME=/opt/tomcat \
4845
USE_ADMIN_AUTH="false"
4946

5047
ENV work_dir=firefly
5148
ENV project=firefly
49+
ENV env=local
5250

5351
WORKDIR ${CATALINA_HOME}
5452

@@ -60,7 +58,7 @@ COPY firefly/docker/tomcat-users.xml conf/
6058
RUN mkdir -p /firefly/workarea /firefly/logs/statistics /firefly/alerts \
6159
&& chmod a+x *.sh
6260

63-
CMD /opt/tomcat/launchTomcat.sh && cd /opt/work/${work_dir} && gradle ${project}:bAD -x buildClient && gradle ${project}:dev
61+
CMD ./devMode.sh
6462

6563

6664
FROM node_module AS builder
@@ -143,11 +141,6 @@ ENV JVM_CORES=0\
143141

144142
ARG IMAGE_NAME=''
145143

146-
ENV JPDA_ADDRESS=*:5050 \
147-
VISUALIZE_FITS_SEARCH_PATH='' \
148-
BUILD_TIME_NAME=${IMAGE_NAME} \
149-
START_MODE=run
150-
151144
WORKDIR ${CATALINA_HOME}
152145

153146
# set up directory protections, copy stuff around, add tomcat user and group

docker/devMode.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
cd /opt/work/${work_dir}
4+
gradle -Penv=${env} ${project}:bAD
5+
gradle -Penv=${env} ${project}:dev &
6+
7+
cd ${CATALINA_HOME}
8+
/opt/tomcat/launchTomcat.sh

docker/launchTomcat.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#!/bin/bash
22

3+
JPDA_ADDRESS=${JPDA_ADDRESS:-*:5050}
4+
VISUALIZE_FITS_SEARCH_PATH=${VISUALIZE_FITS_SEARCH_PATH:-''}
5+
START_MODE=${START_MODE:-run}
36
NAME=${BUILD_TIME_NAME:-"ipac/firefly"}
7+
48
ADMIN_USER=${ADMIN_USER:-admin}
59
ADMIN_PASSWORD=${ADMIN_PASSWORD:-`echo $RANDOM | base64 | head -c 8`}
610
USE_ADMIN_AUTH=${USE_ADMIN_AUTH:-"true"}
711

12+
13+
14+
815
echo -e "\n!!============================================================"
916
echo "!!============================================================"
1017
echo "!!==================== For Help =============================="

firefly-docker.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010

1111
##---- Empty declarations: environment will come from the shell
1212
ADMIN_PASSWORD
13+
env

src/firefly/java/edu/caltech/ipac/astro/ibe/datasource/WiseIbeDataSource.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,12 @@ private void setupDS(String ibeHost, String baseFsPath, DataProduct ds) {
338338
setDataset(wds.getDataset());
339339
setTableName(wds.getImageTable());
340340

341-
File dir= (baseFsPath!=null) ? new File(baseFsPath) : null;
342-
343-
if (baseFsPath != null && dir.canRead()) {
344-
setUseFileSystem(true);
345-
setBaseFilesystemPath(baseFsPath + "/" + wds.getFilesysDatasetPath());
346-
}
341+
// File dir= (baseFsPath!=null) ? new File(baseFsPath) : null;
342+
//
343+
// if (baseFsPath != null && dir.canRead()) {
344+
// setUseFileSystem(true);
345+
// setBaseFilesystemPath(baseFsPath + "/" + wds.getFilesysDatasetPath());
346+
// }
347347
}
348348
}
349349

src/firefly/js/tables/ui/BasicTableView.jsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,13 @@ const BasicTableViewInternal = React.memo((props) => {
3636
const {tbl_id, columnWidths, scrollLeft=0, scrollTop=0, triggeredBy, showTypes, showFilters, showUnits, filterInfo,
3737
selectable, sortInfo, textView} = uiStates;
3838

39-
useEffect( () => {
40-
dispatchTableUiUpdate({tbl_ui_id,
41-
...omitBy(pick(props, 'showTypes', 'showFilters', 'showUnits', 'filterInfo','selectable', 'sortInfo', 'textView'), isUndefined)
42-
});
43-
}, []);
44-
4539
useEffect( () => {
4640
if (!isEmpty(columns)) {
47-
const changes = {};
48-
if (isUndefined(showUnits)) {
41+
const changes = omitBy(pick(props, 'showTypes', 'showFilters', 'showUnits', 'filterInfo','selectable', 'sortInfo', 'textView'), isUndefined);
42+
if (isUndefined(changes.showUnits)) {
4943
changes.showUnits = !!columns.find?.((col) => col?.units);
5044
}
51-
if (isUndefined(showFilters)) {
45+
if (isUndefined(changes.showFilters)) {
5246
changes.showFilters = !!tbl_id && !isClientTable(tbl_id); // false if no tbl_id or is a client table
5347
}
5448
if (!isEmpty(changes)) {

0 commit comments

Comments
 (0)