Skip to content

Firefly-1980: firefly standalone installation#1962

Draft
robyww wants to merge 4 commits into
devfrom
FIREFLY-1980-standalone
Draft

Firefly-1980: firefly standalone installation#1962
robyww wants to merge 4 commits into
devfrom
FIREFLY-1980-standalone

Conversation

@robyww
Copy link
Copy Markdown
Contributor

@robyww robyww commented May 19, 2026

Firefly-1980: create a user installable standalone firefly

Testing

  • install firefly on your machine
  • create a install directory
curl -L https://raw.githubusercontent.com/Caltech-IPAC/firefly/refs/heads/FIREFLY-1980-standalone/bin/get-firefly | bash
  • start the server firefly/bin/ff start
  • it should open the web browser
  • see more options with the ff command firefly/bin/ff

Information

  • workarea and logs are under ~/.firefly/server
    • log files firefly.log and application.log
  • installation including webapp dir is where ever you installed firefly
  • if you want to change the port edit ~/.firefly/port.txt
  • add java start up parameters ~/.firefly/user_ops.sh
  • graphics are not final but I need a placeholder

Todo

  • End user documentation
  • change temporary PR branch endpoints before merge
  • gradle: fix dependency
  • gradle: put dependencies in local mavin

@robyww robyww added this to the 2026.2 milestone May 19, 2026
@robyww robyww self-assigned this May 19, 2026
@robyww robyww force-pushed the FIREFLY-1980-standalone branch from 78a2cfa to c46648e Compare May 19, 2026 21:58
@robyww robyww force-pushed the FIREFLY-1980-standalone branch from c46648e to 5a6913f Compare May 20, 2026 15:04
Copy link
Copy Markdown
Contributor

@loitly loitly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good. Definitely good enough for phase 1. Below are my feedbacks.

Instead of a new standalone directory under firefly repo root, have you considered moving these scripts into the existing bin directory?

Rather than remoteInstall.sh, maybe call it get-firefly.

Instead of “create an install directory,” install.sh should prompt for an installation location, defaulting to the current directory.

I would move startFirefly into the firefly/bin directory. There will likely be additional scripts added later, and we could either add this directory to the user’s PATH automatically or instruct the user to do so during installation.

I’d also think about how to organize the files under ~/.firefly. Maybe place them under a config directory so files are not hanging directly off .firefly.

Copy link
Copy Markdown
Contributor

@loitly loitly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though this is already in the firefly repo, we still prefix it with “firefly” everywhere. Perhaps instead of “src/firefly_standalone”, it should simply be “standalone” or “application”.

Comment on lines +111 to +115
// tomcat for standalone
implementation 'org.apache.tomcat.embed:tomcat-embed-core:11.0.21'
implementation 'org.apache.tomcat.embed:tomcat-embed-websocket:11.0.21'
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper:11.0.21'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still necessary when firefly_standalone dependencies are already defined?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove them

@robyww
Copy link
Copy Markdown
Contributor Author

robyww commented May 21, 2026

@loitly firefly_standalone was you idea but I am happy the change it to standalone

@robyww
Copy link
Copy Markdown
Contributor Author

robyww commented May 21, 2026

Instead of a new standalone directory under firefly repo root, have you considered moving these scripts into the existing bin directory?

sure

Rather than remoteInstall.sh, maybe call it get-firefly.

good idea

Instead of “create an install directory,” install.sh should prompt for an installation location, defaulting to the current directory.

many install scripts no longer prompt. they go for simple. For example install java.

I would move startFirefly into the firefly/bin directory. There will likely be additional scripts added later, and we could either add this directory to the user’s PATH automatically or instruct the user to do so during installation.

yea, I suppose, I was not quite sure where to put it. I wanted a script that the user could copy to other places. If it is in the bin I guess the install script needs to make a clear message to the user.

I’d also think about how to organize the files under ~/.firefly. Maybe place them under a config directory so files are not hanging directly off .firefly.

I experimented with stuff like that. After that, I purposely tried to make it more shallow I am not sure of the point of making it deeper.

@loitly
Copy link
Copy Markdown
Contributor

loitly commented May 21, 2026

One more suggestion:
Instead of using startFireflyServer.sh, I recommend using firefly with parameters.

Here’s an example of how you can use it:

firefly start [-d]
firefly stop
firefly status
firefly logs [-f]

This script can be extended to include additional functionalities, such as loading a file:

firefly load <file-name>

The purpose of these user-facing suggestions, including the directory organization, is to future-proof the tool.

Copy link
Copy Markdown
Member

@jaladh-singhal jaladh-singhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really good. The commands were easy to follow after seeing help. The firefly menu in the topmost tray is helpful.

  1. Upload and IRSA image search are working fine but the searches that go through job monitor aren't working for me. In the logs, I see the following two errors after POSTing a TAP, SIA or IRSA catalogs query:
java.lang.NullPointerException: Cannot invoke "edu.caltech.ipac.firefly.core.background.JobInfo.getMeta()" because "info" is null

io.lettuce.core.RedisCommandExecutionException: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
  1. It will be nice if you can add an option --port, -p to start to override port.txt. I find editing file an extra step/

  2. The multi-port deployment needs more thought. I started one firefly server at 8888 with ff start -d and then changed the port.txt to 8889 and started another one. The state of these two servers are independent - I tired doing different searches in each url - so that's good. Now when I did ff stop it successfully shut downned the recent one which was 8999. Then I did ff stop again but it fails with line 32: kill: (84074) - No such process. These multi-port issues are probably out-of-scope for this pass and we can just prevent starting firefly server at more than one port by checking if it's already running.

(I didn't really do a proper code review but skimmed it and nothing jumps out)

Comment thread bin/install.sh
echo
echo ">>>>>>>>>>>>>>>>>>>>>> ${binDir#$PWD/}/ff start"
echo
echo "You might want to add the bin dir to your path: $binDir"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make it clear that we're talking about PATH env var:

Suggested change
echo "You might want to add the bin dir to your path: $binDir"
echo "You might want to add the bin dir to your PATH: $binDir"


if isTrue $inBackground; then
(cd "$applicationDir" && ${JAVA} ${splash} "${nameParam}" ${PROPS} edu.caltech.ipac.app.FireflyApplication &> "${fireflyServer}/logs/backgroundStart.log" &)
echo "Firefly server starting in background (is takes a few seconds)..."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Firefly server starting in background (is takes a few seconds)..."
echo "Firefly server starting in background (it takes a few seconds)..."

@@ -0,0 +1,184 @@
#!/bin/bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this script should also check if the port is available before starting firefly server.

Before executing start command, I had a jupyter server running (it also uses 8888) and the start command succeeded with Firefly ready: use URL: http://localhost:8888/firefly/ but going to this url showed me:

Image

The start command should have given port not free error along with instructions to change port.

Comment thread src/standalone/assets/ff
echo "stop the firefly server"
else
pid=$(cat "$fireflyDir/pid.txt");
kill "$pid"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth echoing a message (if the process kill was successful) that "Firefly server at <url> stopped". It gives no feedback esp if you started Firefly server with ff start -d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants