Skip to content

Commit ea054f7

Browse files
committed
Remove Tomee and Implement fresh Python GUI
1 parent 7e5fea9 commit ea054f7

File tree

138 files changed

+12659
-4763
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+12659
-4763
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# Top Level Software Ownership
99
/Software/ @jamespilgrim
1010

11-
# Java Ownership files
12-
/Software/LMSourceCode/ImageProcessing/golfsim_tomee_webapp/ @jeshernandez
11+
# Python Web Server
12+
/Software/web-server/ @connorgallopo
1313

1414
# Yolo Model + Tooling
1515
/Software/GroundTruthAnnotator/ @connorgallopo

.github/workflows/java_build.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Web Server Tests
2+
3+
on:
4+
push:
5+
paths:
6+
- 'Software/web-server/**'
7+
- '.github/workflows/web-server-tests.yml'
8+
pull_request:
9+
paths:
10+
- 'Software/web-server/**'
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ['3.10', '3.11', '3.12']
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Cache pip packages
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.cache/pip
31+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
32+
restore-keys: |
33+
${{ runner.os }}-pip-
34+
35+
- name: Install dependencies
36+
working-directory: Software/web-server
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install -r requirements.txt
40+
pip install -r requirements-test.txt
41+
42+
- name: Run tests with coverage
43+
working-directory: Software/web-server
44+
run: |
45+
python -m pytest --tb=short --cov=. --cov-report=xml --cov-report=term
46+
47+
- name: Upload coverage to Codecov
48+
uses: codecov/codecov-action@v3
49+
with:
50+
file: Software/web-server/coverage.xml
51+
flags: webserver
52+
name: web-server-coverage
53+
fail_ci_if_error: false

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,11 @@ HELP.md
2727
out/
2828
**/target/
2929
!.mvn/wrapper/maven-wrapper.jar
30-
*.war
3130
!**/src/main/**/target/
3231
!**/src/test/**/target/
3332
.DS_Store
3433
**/.DS_Store
3534
# Package Files #
36-
/Software/ImageProcessing/golfsim_tomee_webapp/target
37-
/Software/ImageProcessing/golfsim_tomee_webapp/.codesight
38-
**/LMSourceCode/ImageProcessing/golfsim_tomee_webapp/target
39-
**/.war
4035

4136
### STS ###
4237
.apt_generated

Credits/CONTRIBUTORS AND ATTRIBUTION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The PiTrac team is grateful for everyone who has authored, supported, maintained
2121
17. [Prusa MK4S](https://www.prusa3d.com/product/original-prusa-mk4s-3d-printer-kit/) and [PrusaSlicer](https://www.prusa3d.com/page/prusaslicer_424/)(3D Printer and Slicer)
2222
18. [Raspberry Pi](https://www.raspberrypi.com/) Single-Board Computers
2323
19. [Shedskin](https://shedskin.readthedocs.io/en/latest/index.html) (Certain colorsys elements)
24-
20. [Tomee and other Apache products](https://tomee.apache.org/) (hosts the web-based interface)
24+
20. [Python Flask](https://flask.palletsprojects.com/) (hosts the web-based interface)
2525
21. [KiCad](https://www.kicad.org/) (Schematic and PCB software)
2626

2727
We are also thankful for individual contributors who—even if we haven’t used their code—have answered questions and who have spent a lot of their time making groups such as the Raspberry Pi community a smarter, better place. In particular,

Dev/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ declare -A PACKAGES=(
217217
["libcamera"]="Libcamera & RpiCam Apps"
218218
["java"]="Java 17 OpenJDK"
219219
["maven"]="Apache Maven"
220-
["tomee"]="Apache TomEE 10.1.0"
220+
# Python web server is now used instead of TomEE
221221
["pitrac-deps"]="PiTrac Dependencies"
222222
)
223223

@@ -422,7 +422,7 @@ install_all_dependencies() {
422422
# Define the complete dependency chain
423423
local all_packages=(
424424
"java" "maven" "boost" "activemq-broker" "activemq-cpp"
425-
"msgpack" "lgpio" "opencv" "libcamera" "tomee" "pitrac-deps"
425+
"msgpack" "lgpio" "opencv" "libcamera" "pitrac-deps"
426426
)
427427

428428
for package in "${all_packages[@]}"; do

Dev/scripts/build_pitrac.sh

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -368,52 +368,19 @@ build_pitrac() {
368368
fi
369369
}
370370

371-
# Setup GUI if TomEE is installed
371+
# Setup GUI (Python web server is now used instead of TomEE)
372372
setup_gui() {
373373
if [ "$SETUP_GUI" != "1" ]; then
374374
log_info "Skipping GUI setup (SETUP_GUI=0)"
375375
return 0
376376
fi
377377

378-
if ! [ -d "/opt/tomee" ]; then
379-
log_info "TomEE not installed, skipping GUI setup"
380-
return 0
381-
fi
382-
383-
log_info "Setting up PiTrac GUI..."
384-
385-
local webapp_dir="$HOME/Dev/WebAppDev"
386-
mkdir -p "$webapp_dir"
387-
cd "$webapp_dir"
378+
log_info "Python web server is now used for the GUI (available in packaging/build.sh dev mode)"
379+
log_info "The web interface has been migrated from Java/TomEE to Python Flask"
388380

389-
if [ -f "${PITRAC_ROOT}/ImageProcessing/golfsim_tomee_webapp/refresh_from_dev.sh" ]; then
390-
cp "${PITRAC_ROOT}/ImageProcessing/golfsim_tomee_webapp/refresh_from_dev.sh" .
391-
chmod +x refresh_from_dev.sh
392-
393-
log_info "Running refresh script..."
394-
./refresh_from_dev.sh
395-
396-
if need_cmd mvn; then
397-
log_info "Building web application with Maven..."
398-
mvn package
399-
400-
if [ -f "target/golfsim.war" ]; then
401-
$SUDO cp target/golfsim.war /opt/tomee/webapps/
402-
log_success "GUI deployed to TomEE"
403-
404-
local ip_addr
405-
ip_addr=$(hostname -I | awk '{print $1}')
406-
log_info "Access the GUI at: http://${ip_addr}:8080/golfsim/monitor"
407-
else
408-
log_error "WAR file not created"
409-
fi
410-
else
411-
log_warn "Maven not installed, skipping GUI build"
412-
log_info "Install Maven with: sudo apt-get install maven"
413-
fi
414-
else
415-
log_warn "Refresh script not found in repository"
416-
fi
381+
local ip_addr
382+
ip_addr=$(hostname -I | awk '{print $1}')
383+
log_info "After installation, access the GUI at: http://${ip_addr}:8080"
417384
}
418385

419386
is_pitrac_built() {
@@ -459,6 +426,7 @@ main() {
459426
return 1
460427
fi
461428

429+
# GUI setup is now handled by Python web server
462430
setup_gui
463431

464432
log_success "=== PiTrac Build Complete ==="

Dev/scripts/config/install_pitrac_environment.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ else
3939
DETECTED_WEB_DIR="$(detect_lm_shares_dir "WebShare")"
4040
DEFAULT_WEB_DIR="${PITRAC_WEB_DIR:-$DETECTED_WEB_DIR}"
4141
fi
42-
DEFAULT_MSG_BROKER_IP="${PITRAC_MSG_BROKER_IP:-localhost}"
42+
DEFAULT_MSG_BROKER_IP="${PITRAC_MSG_BROKER_IP:-127.0.0.1}"
4343
DEFAULT_E6_HOST="${PITRAC_E6_HOST:-}"
4444
DEFAULT_GSPRO_HOST="${PITRAC_GSPRO_HOST:-}"
4545
DEFAULT_SLOT1_CAMERA="${PITRAC_SLOT1_CAMERA:-4}"
@@ -90,10 +90,10 @@ prompt_network_config() {
9090

9191
# ActiveMQ Broker Address
9292
# Default to localhost for single-machine setups
93-
local default_broker="localhost"
93+
local default_broker="127.0.0.1"
9494

9595
echo ""
96-
echo "For single-machine setup (most common): use 'localhost' or '127.0.0.1'"
96+
echo "For single-machine setup (most common): use '127.0.0.1'"
9797
echo "For multi-machine setup: use the broker machine's IP address"
9898

9999
PITRAC_MSG_BROKER_IP=$(prompt_with_default "ActiveMQ Broker IP address" "$default_broker")
@@ -333,7 +333,7 @@ setup_default_environment() {
333333
PITRAC_ROOT="$DEFAULT_PITRAC_ROOT"
334334
PITRAC_IMAGE_DIR="$DEFAULT_IMAGE_DIR"
335335
PITRAC_WEB_DIR="$DEFAULT_WEB_DIR"
336-
PITRAC_MSG_BROKER_IP="localhost"
336+
PITRAC_MSG_BROKER_IP="127.0.0.1"
337337
PITRAC_E6_HOST=""
338338
PITRAC_GSPRO_HOST=""
339339
PITRAC_SLOT1_CAMERA="4"

Dev/scripts/defaults/tomee.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

Dev/scripts/deps.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ python3-pip:SYSTEM:apt:
2020
meson:SYSTEM:apt:
2121
ninja-build:SYSTEM:apt:
2222

23-
# Java stack
24-
java:SYSTEM:apt:openjdk-17-jdk,openjdk-17-jre
25-
maven:java:apt:maven
23+
# Java stack (legacy - no longer used)
24+
# java:SYSTEM:apt:openjdk-17-jdk,openjdk-17-jre
25+
# maven:java:apt:maven
2626

2727
# Base libraries needed by multiple components
2828
boost:SYSTEM:apt:libboost1.81-all-dev
@@ -50,8 +50,8 @@ opencv:build-essential,cmake:function:install_opencv.sh
5050
# Camera stack (depends on opencv for some features)
5151
libcamera:build-essential,cmake,python3,python3-pip,meson,ninja-build:function:install_libcamera.sh
5252

53-
# Application server
54-
tomee:java:function:install_tomee.sh
53+
# Application server (legacy - replaced by Python web server)
54+
# tomee:java:function:install_tomee.sh
5555

5656
# PiTrac specific packages
5757
pitrac-deps:boost,cmake:apt:raspberrypi-kernel-headers

0 commit comments

Comments
 (0)