Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add official support for Java 21 #1940

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/bats-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@ on:

jobs:
bats-tests:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
services:
registry:
image: registry:2
ports:
- 5000:5000

strategy:
matrix:
platform: [rpi4, amd64]
include:
- platform: rpi4
buildx_platform: linux/arm64
continue-on-error: true # We want to test platforms independently
- platform: amd64
buildx_platform: linux/amd64
continue-on-error: true # We want to test platforms independently

steps:
- name: Checkout repository
Expand All @@ -69,13 +71,12 @@ jobs:
context: .
file: ./tests/Dockerfile.${{ matrix.platform }}-BATS
builder: ${{ steps.buildx.outputs.name }}
tags: localhost:5000/openhabian/${{ matrix.platform }}-openhabian:latest
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: openhabian/${{ matrix.platform }}-openhabian:latest
platforms: ${{ matrix.buildx_platform }}
load: true
- name: BATS tests on ${{ matrix.platform }} platform
run: |
docker run --rm --name "openhabian-${{ matrix.platform }}" -d localhost:5000/openhabian/${{ matrix.platform }}-openhabian
docker run --rm --name "openhabian-${{ matrix.platform }}" --platform ${{ matrix.buildx_platform }} -d openhabian/${{ matrix.platform }}-openhabian
docker exec -i "openhabian-${{ matrix.platform }}" bash -c 'bats --tap --recursive --filter "development-." .'
docker exec -i "openhabian-${{ matrix.platform }}" bash -c 'bats --tap --recursive --filter "unit-." .'
docker exec -i "openhabian-${{ matrix.platform }}" bash -c 'bats --tap --recursive --filter "installation-." .'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-update-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
triggerWorkflowDispatch:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
Expand Down
39 changes: 21 additions & 18 deletions .github/workflows/installation-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,39 @@ on:

jobs:
installation-tests:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
services:
registry:
image: registry:2
ports:
- 5000:5000

strategy:
matrix:
platform: [rpi5-openjdk17, rpi3-openjdk17, amd64-openjdk17, rpi3-bellsoft21]
platform: [rpi5-openjdk17, rpi3-openjdk17, amd64-openjdk17, rpi5-openjdk21, rpi5-temurin21]
include:

- platform: rpi5-openjdk17
dockerfile: ./tests/Dockerfile.rpi5-installation
qemu_platform: arm64
buildx_platform: linux/arm64
java_opt: "17"
- platform: rpi3-openjdk17
dockerfile: ./tests/Dockerfile.rpi3-installation
qemu_platform: arm
buildx_platform: linux/arm/v7
java_opt: "17"
- platform: amd64-openjdk17
dockerfile: ./tests/Dockerfile.amd64-installation
qemu_platform: ""
buildx_platform: linux/amd64
java_opt: "17"
- platform: rpi3-bellsoft21
dockerfile: ./tests/Dockerfile.rpi3-installation
qemu_platform: arm
java_opt: "BellSoft21"
- platform: rpi5-openjdk21
dockerfile: ./tests/Dockerfile.rpi5-installation
qemu_platform: arm64
buildx_platform: linux/arm64
java_opt: "21"
continue-on-error: true # Experimental currently
- platform: rpi5-temurin21
dockerfile: ./tests/Dockerfile.rpi5-installation
qemu_platform: arm64
buildx_platform: linux/arm64
java_opt: "Temurin21"
continue-on-error: true # Experimental currently

steps:
Expand All @@ -67,7 +71,7 @@ jobs:
- name: Setup environment
run: |
sudo -E ./tests/ci-setup.bash github
sed -i 's|^java_opt=.*$|java_opt=${{ matrix.java_opt }}|' build-image/openhabian.conf
sed -i 's|java_opt=.*$|java_opt='"${{ matrix.java_opt }}"'|' build-image/openhabian.conf
- name: Set up QEMU
if: ${{ matrix.qemu_platform != '' }}
uses: docker/[email protected]
Expand All @@ -84,12 +88,11 @@ jobs:
context: .
file: ${{ matrix.dockerfile }}
builder: ${{ steps.buildx.outputs.name }}
tags: localhost:5000/openhabian/${{ matrix.platform }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: openhabian/${{ matrix.platform }}:latest
platforms: ${{ matrix.buildx_platform }}
load: true
- name: openHABian installation test with ${{ matrix.platform }}
run: |
docker run --privileged --rm --name "openhabian-${{ matrix.platform }}" -d localhost:5000/openhabian/${{ matrix.platform }}
docker run --privileged --rm --platform ${{ matrix.buildx_platform }} --name "openhabian-${{ matrix.platform }}" -d openhabian/${{ matrix.platform }}
docker exec -i "openhabian-${{ matrix.platform }}" bash -c './build.bash local-test && /boot/first-boot.bash'
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/shellcheck-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
shellcheck:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name

steps:
Expand Down
20 changes: 15 additions & 5 deletions build-image/first-boot.bash
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if ! is_bookworm; then
rfkill unblock wifi # Wi-Fi is blocked by Raspi OS default since bullseye(?)
fi
webserver=/boot/webserver.bash
ln -s /boot/firmware/webserver.bash "$webserver"
ln -sfn /boot/firmware/webserver.bash "$webserver"

if [[ "${debugmode:-on}" == "on" ]]; then
unset SILENT
Expand Down Expand Up @@ -93,7 +93,7 @@ hotSpot=${hotspot:-enable}
wifiSSID="$wifi_ssid"
# shellcheck source=/etc/openhabian.conf disable=SC2154
wifiPassword="$wifi_password"
if is_bookworm; then
if ! running_in_docker && is_bookworm; then
echo -n "$(timestamp) [openHABian] Setting up NetworkManager and Wi-Fi connection... "
systemctl enable --now NetworkManager

Expand All @@ -105,7 +105,7 @@ if is_bookworm; then
#elif [[ -z $wifiSSID ]]; then
elif grep -qs "up" /sys/class/net/eth0/operstate; then
# Actually check if ethernet is working
echo -n "$(timestamp) [openHABian] Setting up Ethernet connection... OK"
echo "$(timestamp) [openHABian] Setting up Ethernet connection... OK"
elif [[ -n $wifiSSID ]] && grep -qs "openHABian" /etc/wpa_supplicant/wpa_supplicant.conf && ! grep -qsE "^[[:space:]]*dtoverlay=(pi3-)?disable-wifi" /boot/config.txt; then
echo -n "$(timestamp) [openHABian] Checking if WiFi is working... "
if iwlist wlan0 scan |& grep -qs "Interface doesn't support scanning"; then
Expand Down Expand Up @@ -219,7 +219,7 @@ fi

# shellcheck disable=SC2154
echo -n "$(timestamp) [openHABian] Updating myself from ${repositoryurl:-https://github.com/openhab/openhabian.git}, ${clonebranch:-openHAB} branch... "
if [[ $(eval "$(openhabian_update "${clonebranch:-openHAB}" &> /dev/null)") -eq 0 ]]; then
if running_in_docker || [[ $(eval "$(openhabian_update "${clonebranch:-openHAB}" &> /dev/null)") -eq 0 ]]; then
echo "OK"
else
echo "FAILED"
Expand Down Expand Up @@ -254,7 +254,17 @@ if running_in_docker; then
ps -auxq "$(cat "$PID")" | awk '/openhab/ {print "size/res="$5"/"$6" KB"}'
else
echo -e "\\n${COL_RED}Karaf PID missing, openHAB process not running (yet?).${COL_DEF}"
exit 1
cat /var/log/openhab/openhab.log
systemctl restart openhab.service
systemctl status openhab.service
journalctl -xeu openhab.service
sleep 30
if [[ -f "$PID" ]]; then
ps -auxq "$(cat "$PID")" | awk '/openhab/ {print "size/res="$5"/"$6" KB"}'
else
echo -e "\\n${COL_RED}Karaf PID still missing, openHAB process not running.${COL_DEF}"
exit 1
fi
fi
echo -e "$COL_DEF"
fi
Expand Down
4 changes: 2 additions & 2 deletions build-image/openhabian.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ clonebranch=openHAB

# debug verbosity mode
# off, on (verbose output in log) or maximum (show every command)
debugmode=off
debugmode=maximum

# the framebuffer on RPi is enabled by default
framebuffer=enable
Expand All @@ -74,7 +74,7 @@ apttimeout=60
# osrelease=

# Java version to install
# Valid arguments: 11, 17, Zulu11-32, Zulu11-64, Zulu21-64
# Valid arguments: 17, 21, Temurin17, Temurin21, 11 (legacy)
java_opt=17

# install zram per default, set to "disable" to skip installation
Expand Down
4 changes: 2 additions & 2 deletions functions/influxdb+grafana.bash
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ influxdb_install() {
else
myOS="$(lsb_release -si)"
fi
myRelease="$(lsb_release -sc)"
if [[ "$myRelease" == "n/a" ]]; then
myRelease="$(lsb_release -sc | head -1)"
if [[ "$myRelease" == "n/a" ]] || running_in_docker; then
myRelease=${osrelease:-bookworm}
fi

Expand Down
Loading
Loading