Open TB-1993 opened 1 week ago
Below is a rough design of the yaml database and endpoints required
xts alloc/allocate --id --platform --tags --duration --server
xts allocator list
xts allocator search --platform --description --tags --server
xts deallocate --id
xts allocator add
xts allocator remove --id
xts allocator server add
xts allocator server remove
xts allocator login
xts:
servers:
name:
url:
description:
name2:
url:
description:
XTS Allocator Server
id: 123
state: free/allocated/offline/maintenance/reservable
owner:
# Separate table with history maintained
allocated:
user:
email:
name:
duration:
start:
end:
devices: rackB03slot1.yaml
# Populated from yaml
name:
description:
tags:
- pi2
- remoteController
- HDMICECController
- powerController
rackB03slot1.yaml
name:
description:
tags:
- pi2
- remoteController
- HDMICECController
- powerController
devices:
- dut:
ip: "127.0.0.1" # IP Address of the ADA Hub
platform: "linux PC"
consoles:
- default:
type: "serial"
port: "/dev/ttyUSB0"
- ssh:
port: 22
username: "root"
ip: "192.168.99.1"
remoteController:
type: "none"
map: "skyq_map"
config: "example_remote_commander.yml"
outbound:
download_url: "tftp://tftp-server.com/rack1/slot1/" # download location for the CPE device
upload_url: "sftp://server-address/home/workspace/tftp/rack1/slot1/" # upload location
upload_url_base_dir: "sftp://server-address/home/workspace/tftp/rack1/slot1" # alternative upload location
httpProxy: 'socks5h://localhost:1234' # Local Proxy if required
workspaceDirectory: './logs/workspace' # Local working directory
powerSwitch:
type: "HS100"
ip: "192.168.1.7"
port: 9999
# hdmiCECController: Specific hdmiCECController for the slot
# supported types:
# [type: "cec-client", adaptor: "/dev/ttycec"]
- pi2:
ip: "192.168.99.1"
description: "local pi4"
platform: "pi4"
consoles:
- ssh:
type: "ssh"
port: 22
username: "root"
xts allocate --id --platform --tags --duration --server POST /allocate_slot
xts allocator list GET /list_slots
xts allocator search --platform --description --tags --server POST /search_slots
xts deallocate --id POST /deallocate_slot
// Out of scope for first release xts allocator add POST /add_slot
xts allocator remove --id POST /remove_slot
I have begun looking into this, I'm currently thinking for simplicity, using Flask, and it's built in development server would be the quickest route to getting this out. This on top of a simple database backing (possibly just pickling dictionaries).
Description:
Problem/Opportunity: Sharing test devices requires close management to prevent users from interrupting each other's tests.
Proposed Solution: Having a service to manage the allocation of shared devices would prevent users from attempting to use the same test device at the same time, preventing test interruptions. This would have the additional benefits of simplifying device management and promoting device sharing among the testing team.
Acceptance Criteria: