Prerequisites:
In order to deploy or develop BELY, you must have some support software installed. Follow the instructions below to achieve this.
# For red-hat based linux distribution run the following:
yum install -y gcc libgcc zlib-devel openssl-devel openldap-devel readline-devel git make cmake sed gawk autoconf automake wget mysql mysql-libs mysql-server mysql-devel curl unzip
# For debian based linux distributions run the following:
apt-get install wget gcc git make cmake build-essential libcurses-ocaml-dev curl mysql-server libmysqlclient-dev openssl libssl-dev libldap2-dev libsasl2-dev sed gawk unzip
For detailed deployment instructions please refer to our administrators guide.
Deployment Procedure:
# Make a new directory to hold BELY and its support directories. (replace or set DESIRED_BELY_INSTALL_DIRECTORY var with a unix directory.)
mkdir $DESIRED_BELY_INSTALL_DIRECTORY
cd $DESIRED_BELY_INSTALL_DIRECTORY
# Get the distribution with the support submodule (a release zip also works; make support fetches the
# support tag from etc/support.version).
git clone --recurse-submodules https://github.com/AdvancedPhotonSource/BELY.git
# Navigate inside the distribution.
cd BELY
# Build support needed for the application (prompts for the Payara master and admin passwords)
make support
# load enviornment variables with new support built.
source setup.sh
# Create deployment configuration
make configuration
# Create a clean db for the distribution
make clean-db
# Prepare web portal configuraiton
make configure-web-portal
# Configure MQTT (optional - needed for notification features; deploys the mqtt-rar 1.0.0 connector)
make mqtt-configuration
make configure-mqtt
# Deploy plugins if needed using `make deploy-cdb-plugin`
# Deploy web portal
make deploy-web-portal
# All done... output of the command below should print url to the deployed portal.
echo "https://`hostname`:8181/bely"
# Valid SSL certificates can also be applied using the following command:
# ./sbin/bely_update_glassfish_ssl.sh KEY_FILE CRT_FILE # NOTE, this will prompt for the master password set during the `make support` step.
Support submodule: the runtime installers (JDK, Payara, Ant, NetBeans) live in the shared
cdb-bely-support repository, included at support/
and pinned to the tag in etc/support.version. In an existing clone, or after pulling a new pin, run
git submodule update --init. make support copies support/ into ../support-<short-hostname> and installs there.
Payara admin password: make support saves the admin password to a per-deployment file,
$LOGR_INSTALL_DIR/etc/glassfish.admin.<short-hostname>.passwd (owner-only), and the make/sbin
scripts pass it to asadmin. Nothing is stored in ~/.gfclient, so deployments sharing a home
directory don't overwrite each other's login. To use a different location, export
CDB_BELY_SUPPORT_GLASSFISH_ADMIN_PASSWORD_FILE before sourcing setup.sh and running make support.
Sharing Payara with ComponentDB: BELY and CDB can run in one support directory and Payara production
domain (different context roots, same ports). Point LOGR_SUPPORT_DIR and
CDB_BELY_SUPPORT_GLASSFISH_ADMIN_PASSWORD_FILE at CDB's values before sourcing setup.sh (this is the
default when both checkouts share a parent directory). Running make support from either application
rebuilds the shared domain; redeploy and reconfigure both afterwards.
For detailed development instructions please refer to our developers guide.
Getting Started with development:
# first make a fork of this project.
# create a desired development directory and clone into it
mkdir $desired_dev_directory
cd $desired_dev_directory
git clone --recurse-submodules https://github.com/AdvancedPhotonSource/BELY.git
cd BELY
# Getting support software
make support
# Get Netbeans
make support-netbeans
# Load up the environment
source setup.sh
# Prepare Dev DB
# mysql could be installed as part of support by running 'make support-mysql'
# - Afterwards run `./etc/init.d/bely-mysqld start`
# if you have mysql installed and started run...
make clean-db
# Start development
make dev-config
# Open Netbeans
netbeans &
make support-netbeans installs NetBeans 32 and configures it to run on the support JDK (Java 25), which the project needs to compile (--release 25). If you use another NetBeans install, start it with --jdkhome $desired_dev_directory/support-hostname -s/java/$LOGR_HOST_ARCH or set netbeans_jdkhome in its etc/netbeans.conf. Don't select a separate Java Platform in the project properties; that would break make builds.
Once netbeans is open a few steps need to be taken to prepare netbeans for BELY development.
- Open BELY Project: File > Open Project
- Navigate to $desired_dev_directory/BELY/src/java
- Select LogrPortal and hit Open Project
- Right click on LogrPortal top level under projects
- Click "Resolve Missing Server Problem"
- Add Server -> Payara Server
- Installation Location: $desired_dev_directory/support-
hostname/netbeans/payara - Version: the Payara version in
support/bin/versions.sh(currently 7.2026.11) - Use the wizard's download
- Java Platform: the default (support JDK 25)
- Next -> Use Default Domain Location -> Finish add server instance wizard
- Select the Newly added "Payara Server"
- Copy over the required mysql client to new payara server.
# cd into the $desired_dev_directory/$distribution_directory
cp src/java/LogrPortal/lib/mariadb-java-client-3.1.0.jar ../support-`hostname`/netbeans/payara/glassfish/domains/domain1/lib/- Increase the server heap. The NetBeans-installed domain defaults to
-Xmx512m, which runs out of memory (OutOfMemoryError: Java heap space) under the parallel Selenium suite and after repeated redeploys. With the server running:
ASADMIN=../support-`hostname`/netbeans/payara/bin/asadmin
$ASADMIN list-jvm-options | grep Xm # remove every existing -Xmx/-Xms value shown
$ASADMIN delete-jvm-options -- -Xmx512m
$ASADMIN create-jvm-options -- -Xmx4g
$ASADMIN create-jvm-options -- -Xms1g
$ASADMIN list-jvm-options | grep Xm # should show only -Xmx4g and -Xms1g
$ASADMIN restart-domain- Optional (notifications/MQTT tests):
make mqtt-configurationonce, thenmake configure-mqtt-devdeploys the MQTT connector to the NetBeans Payara. - Run the project
Repeated NetBeans redeploys leak memory (old application class loaders are not fully released). Restart Payara before running the test suite or when the server slows down.
Files changed outside NetBeans (e.g. by
git pullor a patch) aren't always copied tobuild/webon save. Use Clean and Build before redeploying after such changes.
Optional (macOS): Payara's Hazelcast data grid defaults to port 5900, which is also used by macOS Screen Sharing (VNC). If startup hangs and
server.logrepeatsUnknown protocol: RFB, move Hazelcast to another port. Themake supportdomain already uses 6900; the NetBeans-installed copy needs this once. Stop the server first (a running server keeps the old value and can write it back), then use the domain path shown in NetBeans under Services → Servers → Payara → Properties:DOMAIN_XML=../support-`hostname`/netbeans/payara/glassfish/domains/domain1/config/domain.xml # Sets or adds start-port; the element may have no attributes when Payara relies on the 5900 default. sed -i '' -E 's#<hazelcast-runtime-configuration( start-port="[0-9]+")?#<hazelcast-runtime-configuration start-port="6900"#' $DOMAIN_XML # GNU sed on Linux: sed -i -E ... grep hazelcast-runtime-configuration $DOMAIN_XML # should show start-port="6900"If the server is running,
asadmin set-hazelcast-configuration --enabled=true --startport 6900followed by a restart does the same.
To get started with running the API test suite the BELY app needs to be running on local machine.
# API requirements
pip install -r tools/developer_tools/python-client/test/requirements.txtsource setup.sh
# Deploy test-db data
make test-db
# Test API
# Navigate to python-client directory
cd tools/developer_tools/python-client/
# Optionally genreate latest version of API.
./generatePyClient.sh http://localhost:8080/bely
# Run tests
pytest test/api_test.pyThis will backup the db, deploy test db, run the unit, API, Selenium and MQTT tests, and restore the backup.
The Selenium suite runs several browsers in parallel against the portal; give Payara at least a 4 GB heap (see step 10 of Preparing Netbeans). Failure logs, screenshots, and page source are written to tools/developer_tools/portal_testing/PythonSeleniumTest/test-failures/.
source setup.sh
make testsource setup.sh
make prepare-release # bumps the version everywhere and scaffolds release notes
# review the diff, then commit
make release-python-client # publishes bely-api, bely-cli, and bely-mqtt-framework to PyPISee tools/developer_tools/python-client/README.md for the full build/publish/conda
procedure, including TestPyPI dry runs.