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

Update2025 1 #1

Open
wants to merge 11 commits into
base: master
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
75 changes: 61 additions & 14 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@
pull_request:

jobs:
lava-lab-gen-syntax:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9.20', "3.10.15", "3.11.9", "3.12.6", 3.13]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: check syntax of lavalab-gen
run: |
python -m py_compile lavalab-gen.py 2> output
if [ -s output ] ; then cat output ; exit 1 ; fi
- name: check version change
run: |
python -m pip install --upgrade pip
pip install pyyaml
export OUTDIR=$(mktemp -d --dry-run)
./lavalab-gen.py -o $OUTDIR boards-ci2.yaml
grep -q 2024.xx $OUTDIR/local/masterci1/Dockerfile || exit 1
grep -q 2024.xx $OUTDIR/local/lab-ci-0/Dockerfile || exit 1
check-lava-lab-gen:
runs-on: ubuntu-22.04
steps:
Expand All @@ -16,7 +39,7 @@
- name: Verify DNS query in docker
run: sh .github/docker-resolv.sh
- name: Build lava-docker
run: cd output/local && docker-compose build
run: cd output/local && docker compose build
check-formats:
runs-on: ubuntu-22.04
steps:
Expand All @@ -38,9 +61,9 @@
- name: Verify DNS query in docker
run: sh .github/docker-resolv.sh
- name: Build lava-docker
run: cd output/local && docker-compose build
run: cd output/local && docker compose build
- name: Launch lava-docker
run: cd output/local && docker-compose up -d
run: cd output/local && docker compose up -d
- name: Wait for LAVA to be started
run: sh .github/workflows/wait-for-docker.sh
- name: Wait for first job to be completed
Expand All @@ -50,7 +73,7 @@
- name: Run backup
run: ./backup.sh
- name: stop docker
run: cd output/local && docker-compose down
run: cd output/local && docker compose down

- name: Clean old install
run: rm -r output
Expand All @@ -59,9 +82,9 @@
- name: Run lavalab-gen
run: ./lavalab-gen.py boards-ci-2023.01.yaml
- name: Build lava-docker
run: cd output/local && docker-compose build
run: cd output/local && docker compose build
- name: Launch lava-docker
run: cd output/local && docker-compose up -d
run: cd output/local && docker compose up -d
- name: Wait for LAVA to be started
run: sh .github/workflows/wait-for-docker.sh
- name: Wait for first job to be completed
Expand All @@ -74,35 +97,35 @@
# yamllint disable-line rule:line-length
run: lavacli --uri http://admin:[email protected]:10080/RPC2 jobs logs 1 > log1 && [[ -s log1 ]] || exit 1
- name: stop docker
run: cd output/local && docker-compose down
run: cd output/local && docker compose down

- name: restart lava-docker
run: cd output/local && docker-compose up -d
run: cd output/local && docker compose up -d
- name: Wait for LAVA to be started
run: sh .github/workflows/wait-for-docker.sh

- name: Run backup of 2023.01
run: ./backup.sh
- name: stop docker
run: cd output/local && docker-compose down
run: cd output/local && docker compose down

# - name: Clean old install

Check warning on line 112 in .github/workflows/basic.yml

View workflow job for this annotation

GitHub Actions / check-formats

112:1 [comments-indentation] comment not indented like content

Check warning on line 112 in .github/workflows/basic.yml

View workflow job for this annotation

GitHub Actions / check-formats

112:1 [comments-indentation] comment not indented like content
# run: rm -r output
# - name: Copy backup
# run: cp -v backup-latest/* lava-master/backup/
# - name: Run lavalab-gen
# run: ./lavalab-gen.py boards-ci-2023.06.yaml
# - name: Build lava-docker 2023.06
# run: cd output/local && docker-compose build
# run: cd output/local && docker compose build
# - name: Launch lava-docker 2023.06
# run: cd output/local && docker-compose up -d
# run: cd output/local && docker compose up -d
# - name: Wait for LAVA 2023.06 to be started
# run: sh .github/workflows/wait-for-docker.sh
#
# - name: Run backup of 2023.06
# run: ./backup.sh
# - name: stop docker
# run: cd output/local && docker-compose down
# run: cd output/local && docker compose down

- name: Clean old install
run: rm -r output
Expand All @@ -111,8 +134,32 @@
- name: Run lavalab-gen
run: ./lavalab-gen.py boards-ci-2023.10.yaml
- name: Build lava-docker 2023.10
run: cd output/local && docker-compose build
run: cd output/local && docker compose build
- name: Launch lava-docker 2023.10
run: cd output/local && docker-compose up -d
run: cd output/local && docker compose up -d
- name: Wait for LAVA 2023.10 to be started
run: sh .github/workflows/wait-for-docker.sh
test-backup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install lavacli
run: sudo apt-get -y install lavacli
- name: test valid and invalid usage of backup.sh
run: |
./backup.sh -n && exit 1
./backup.sh -h || exit 1
./backup.sh --help || exit 1
- run: ./lavalab-gen.py boards-ci-testbackup.yaml
- name: Build lava-docker
run: cd output/local && docker compose build
- name: Launch lava-docker
run: cd output/local && docker compose up -d
- name: Wait for LAVA to be started
run: sh .github/workflows/wait-for-docker.sh central
- name: Run backup
run: ./backup.sh -n central
- name: Check backup
run: |
pwd
ls -l backup-latest
15 changes: 11 additions & 4 deletions .github/workflows/wait-for-docker.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/sh

DOCKERNAME=master
if [ ! -z "$1" ];then
DOCKERNAME=$1
echo "DEBUG: master name is $DOCKERNAME"
fi

cd output/local

TIMEOUT=0
Expand All @@ -22,15 +28,16 @@ do
fi
fi
fi
docker-compose logs --tail=60
docker compose logs --tail=60
docker ps > /tmp/alldocker
grep -q master /tmp/alldocker
grep -q $DOCKERNAME /tmp/alldocker
if [ $? -ne 0 ];then
echo "=========================================="
echo "=========================================="
echo "=========================================="
echo "ERROR: master died"
docker-compose logs
echo "ERROR: master $DOCKERNAME died"
docker ps
docker compose logs
exit 1
fi
sleep 10
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ slaves:
host_healthcheck: If true, enable the optional healthcheck container. See hosting healthchecks below
lava-coordinator: Does the slave should ran a lava-coordinator
expose_ser2net: Do ser2net ports need to be available on host
joblimit: x Add a joblimit to the worker (default 0)
rawdevices: (optional) Add devpath inside worker
- devpath
custom_volumes:
- "name:path" Add a custom volume
expose_ports: Expose port p1 on the host to p2 on the worker slave.
Expand Down Expand Up @@ -350,6 +353,8 @@ boards:
ser2net_options: (optional) A list of ser2net options to add
- option1
- option2
env:
envname: value (optional) add an udev env filter ENV{envname}=="value"
connection_command: A command to be ran for getting a serial console
pdu_generic:
hard_reset_command: commandline to reset the board
Expand Down
31 changes: 30 additions & 1 deletion backup.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,46 @@
#!/bin/sh

DOCKERNAME=master
BACKUP_DIR="backup-$(date +%Y%m%d_%H%M)"
# use /tmp by default on host (this is used by tar)
TMPDIR=${TMPDIR:-/tmp}
export TMPDIR

usage() {
echo "$0 [-h|--help] [-n dockername]"
}

while [ $# -ge 1 ]
do
case $1 in
-h)
usage
exit 0
;;
--help)
usage
exit 0
;;
-n)
shift
DOCKERNAME=$1
shift
;;
*)
usage
exit 1
;;
esac
done

mkdir -p $TMPDIR

mkdir $BACKUP_DIR
cp boards.yaml $BACKUP_DIR

DOCKERID=$(docker ps |grep master | cut -d' ' -f1)
DOCKERID=$(docker ps |grep "$DOCKERNAME" | cut -d' ' -f1)
if [ -z "$DOCKERID" ];then
echo "ERROR: unable to find docker named $DOCKERNAME"
exit 1
fi

Expand Down
26 changes: 26 additions & 0 deletions boards-ci-testbackup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
masters:
- name: central
host: local
users:
- name: admin
token: tokenforci
password: passwordforci
superuser: true
staff: true
tokens:
- username: admin
token: dfjdfkfkdjfkdsjfslforci
description: no description

slaves:
- name: lab-ci-0
host: local
remote_master: central
remote_user: admin
use_overlay_server: false
use_tftp: false

boards:
- name: qemu-01
type: qemu
30 changes: 30 additions & 0 deletions boards-ci2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
masters:
- name: masterci1
host: local
users:
- name: admin
token: tokenforci
password: passwordforci
superuser: true
staff: true
tokens:
- username: admin
token: dfjdfkfkdjfkdsjfslforci
description: no description
version: 2024.xx

slaves:
- name: lab-ci-0
host: local
remote_master: masterci1
remote_user: admin
use_overlay_server: false
use_tftp: false
version: 2024.xx
raw_devices:
- '/dev/bus/usb'

boards:
- name: qemu-01
type: qemu
2 changes: 1 addition & 1 deletion lava-master/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM lavasoftware/lava-server:2024.05
FROM lavasoftware/lava-server:2024.09

RUN apt-get update && apt-get -y install sudo git

Expand Down
3 changes: 2 additions & 1 deletion lava-slave/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM lavasoftware/lava-dispatcher:2024.05
FROM lavasoftware/lava-dispatcher:2024.09

RUN apt-get update

# telnet is for using ser2net
# git is necessary for checkout tests
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install telnet git ser2net patch lavacli
RUN if [ $(uname -m) = amd64 -o $(uname -m) = x86_64 ];then apt-get -y install linux-image-amd64 ; fi

COPY configs/lava-slave /etc/lava-dispatcher/lava-slave

Expand Down
3 changes: 3 additions & 0 deletions lava-slave/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ do
lavacli $LAVACLIOPTS workers add --description "LAVA dispatcher on $(cat /root/phyhostname)" $worker || exit $?
# does we ran 2020.09+ and worker need a token
fi

lavacli $LAVACLIOPTS workers update --job-limit $LAVA_JOBLIMIT $worker || exit $?

grep -q "TOKEN" /root/entrypoint.sh
if [ $? -eq 0 ];then
# This is 2020.09+
Expand Down
Loading
Loading