-
Notifications
You must be signed in to change notification settings - Fork 0
STRIDES Deployment
Biome is managed as a systemd service under the name biome.service. This service is responsible for running the Beaker kernel server process, which is started using a custom Python installation located at /opt/biome-python. The service is configured to write its logs to a dedicated log file for easy troubleshooting and monitoring.
Note: The
biomerepository found in the home directory (~/biome) is the source code used to install or build the Biome service and its dependencies.
-
Service file:
/etc/systemd/system/biome.service -
ExecStart:
python3.12 -m beaker_kernel.service.server -
Python binary:
/opt/biome-python/bin/python3.12(custom installation) -
User: Typically runs as
rootor a dedicated user (e.g.,beaker) -
Source repo:
/home/ubuntu/biome(for reference or development) -
Beaker install:
/opt/biome-python/bin/beaker -
Beaker environment:
/root/env.biome(includesBEAKER_APPconfigurations)
-
Log file:
/var/log/beaker.log - The service is configured to append all standard output to this file via the
StandardOutput=append:/var/log/beaker.logdirective in the service file.
To view the logs in real time:
tail -f /var/log/beaker.logDue to the StandardOutput=append:/var/log/beaker.log configuration, there are two different types of logs:
-
tail -f /var/log/beaker.log- Shows the actual application output (Beaker server logs, API requests, etc.) -
journalctl -u biome.service- Shows only systemd's own messages about the service (start/stop events, resource usage, etc.)
Application logs (tail -f /var/log/beaker.log):
[I 2025-06-23 13:07:40.481 BeakerServerApp] 200 GET /api (127.0.0.1) 0.37ms userid=none
[I 2025-06-23 13:07:59.710 BeakerServerApp] 200 GET /api (127.0.0.1) 0.38ms userid=none
Systemd logs (journalctl -u biome.service):
Jun 17 06:20:04 ip-172-31-7-226 systemd[1]: Started biome.service - Biome service.
Jun 17 06:20:04 ip-172-31-7-226 systemd[1]: biome.service: Consumed 33.088s CPU time, 372.3M memory peak
To change how the service is started or where it logs:
- Open the service file for editing:
sudo nano /etc/systemd/system/biome.service
- Make your changes (e.g., modify
ExecStart, change log file path, etc.). - Save and exit the editor.
- Reload systemd to pick up changes:
sudo systemctl daemon-reload
- Restart the service:
sudo systemctl restart biome.service
-
Check service status:
systemctl status biome.service
-
View systemd logs (service start/stop events):
journalctl -u biome.service
-
View systemd logs in real-time:
journalctl -u biome.service -f
-
View application logs (file):
tail -f /var/log/beaker.log
-
Edit the service file:
sudo nano /etc/systemd/system/biome.service
-
Reload systemd after editing:
sudo systemctl daemon-reload
-
Restart the service:
sudo systemctl restart biome.service
- If the service does not start, check
/var/log/beaker.logfor errors. - Ensure the service file syntax is correct and that the specified Python path and module exist (especially
/opt/biome-python/bin/python3.12). - After any changes to the service file, always reload systemd and restart the service.
- For development or debugging, refer to the
~/biomerepository for source code and installation scripts.
Biome is built on Beaker (Jupyter) and uses a multi-user architecture for security and isolation.
-
Systemd Service User:
The main Biome service (biome.service) runs asroot(seeUser=rootin the service file). -
Kernel Management User:
Thebeakeruser is used to launch and manage kernel processes (beaker_kernel.kernel). This user is a system user and does not have a login shell. -
Notebook Kernel User:
When you execute code in a Biome notebook, the kernel process (which runs your code) is started as the restricteduseruser.- For example, running
!whoamiinside a notebook will returnuser. - This user is configured with
/usr/sbin/nologinto prevent interactive logins and is used only for code execution.
- For example, running
In both a systemd and docker setup, the agent needs to be able to write to the filesystem. It's important to note that the user for this in docker differs from on the STRIDES server (jupyter vs. beaker) and this may cause some complications.
| Role/Function | Systemd/Server | Docker |
|---|---|---|
| Main service process | root | root |
Kernel manager/agent (BEAKER_AGENT_USER) |
beaker | jupyter |
Notebook code runner (BEAKER_SUBKERNEL_USER) |
user | user |