{"id":19095706,"url":"https://github.com/insei/asbdds","last_synced_at":"2025-02-22T08:28:07.614Z","repository":{"id":49206137,"uuid":"378502659","full_name":"Insei/ASBDDS","owner":"Insei","description":"ARM Single Board Devices Deployment System","archived":false,"fork":false,"pushed_at":"2021-07-08T00:59:51.000Z","size":2424,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-03T00:14:21.068Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Insei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-19T20:52:36.000Z","updated_at":"2021-07-08T00:59:53.000Z","dependencies_parsed_at":"2022-09-14T19:52:02.646Z","dependency_job_id":null,"html_url":"https://github.com/Insei/ASBDDS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insei%2FASBDDS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insei%2FASBDDS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insei%2FASBDDS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insei%2FASBDDS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Insei","download_url":"https://codeload.github.com/Insei/ASBDDS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240145972,"owners_count":19755191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T03:34:51.641Z","updated_at":"2025-02-22T08:28:07.596Z","avatar_url":"https://github.com/Insei.png","language":"Python","readme":"# ASBDDS - is a simple ARM Single Board Devices Deployment System API.\nThis set of software and devices is used to automate the deployment of systems on arm single board devices.\n\n#### The system includes: \n* HTTP server with API (running on 5000 port)\n* TFTP server (running on 69 port)\n\n#### The system needs:\n* DHCP server in network\n* Suported POE switch\n\n#### Suported arm single board devices:\n* Raspberry pi 4 (with POE power HAT)\n\n#### Supported POE Swithes:\n* TP-Link TL-SG2210MP\n\n# We use:\n\n## Fake database:\nThere is a preconfigured JSON pool of [devices](https://github.com/Insei/ASBDDS/blob/main/jsondb/devices.json) and JSON pool [poe switches](https://github.com/Insei/ASBDDS/blob/main/jsondb/switches.json). Devices and swithes in this pools adds manualy by editing files, this is our fake db now.\nEach device has a record to which switch and to which port it is [connected](https://github.com/Insei/ASBDDS/blob/main/jsondb/devices.json#L13).\n\n## U-boot (as Bootloader and Storage cleaner)\nWe use 3 different build of u-boot for each device. Each build has a different boot command.\n* [Storage cleaner](https://github.com/Insei/asbdds-u-boot/blob/asbds/configs/asbds_sdcard_erase_config#L5)\n* [Default](https://github.com/Insei/asbdds-u-boot/blob/asbds/configs/asbds_config#L5)\n* [IPXE booting](https://github.com/Insei/asbdds-u-boot/blob/asbds/configs/asbds_provisioning_config#L5)\n\n## IPXE\nWe use ipxe in two variants:\n* Default (For OS Installation)\n* For API callbacks. (As example: u-boot after erasing storage boot via ipxe, and get ipxe.cfg from the API at this moment we check the device state and if state is erasing - we switch device power to off on ethernet port switch and remove device uuid(makes device not in use))\n\n## TFTP\nWe use TFTP server for provision bootloaders and ipxe to devices.\nFor each device in use we create folter in tftp root with device serial number and in this folder will be placed firmware, ipxe and bootloader files.\nWe switch bootloaders build's if this needed via api.\n\n## DHCP\nFrom DHCP devices get their IP address and get TFTP address. TFTP IP address is also IP address with our API.\n\n## POE Switches\nWe use switches as power DC for single board arm devices. We manage POE power on ports via cli.\n\n# Description of the processes of each API method.\n## PUT /device/\nMark device from the pool of unused devices as used.\n*parameters:* model, name and ipxe_url\n\n1) Create device from the pool of devices, if unused device with this model exist in the pool.\n2) Setup new uuid for this device for accessing to this device by uuid.\n3) Copy firmware(if exist), bootloaders(u-boot ipxe build) and ipxe to folder with named as device serial in tftp root.\n4) Setup ipxe url in the ipxe.efi.cfg in device root tftp folder.\n5) Power on device via switch.\n5) Setup state to \"creating\".\n6) Return JSON response object with device data.\n7) Device boot via PXE booting and load firmware(if exist) -\u003e bootloader(u-boot).\n8) Bootloader boot ipxe -\u003e ipxe get serial number of device from SMBIOS and get TFTP address(via DHCP).\n9) IPXE use serial and TFTP address to generate HTTP link to our API for getting IPXE cfg(TFTP server IP is also HTTP server IP).\n10) After success installation OS from IPXE, device will be rebooted(This must be done by the operating system).\n\n## GET /device/{UUID}/\nGet device from the pool of used devices.\n\n1) Return JSON device data with specified uuid if exist.\n\n## POST /device/{UUID}/reboot\nReboot device from the pool of used devices.\n\n1) Get device with specified uuid if exist.\n2) Check that device state is allowing reboot, if not - return try later code.\n3) Power OFF POE on port via cli on switch, then switch power to ON.\n4) Setup device state to \"poweron\".\n5) Return JSON response object with device data.\n\n## POST /device/{UUID}/poweroff\nReboot device from the pool of used devices.\n\n1) Get device with specified uuid if exist.\n2) Check that device state is allowing poweroff, if not - return try later code.\n3) Power OFF POE on port via cli on switch.\n4) Setup device state to \"poweroff\".\n5) Return JSON response object with device data.\n\n## POST /device/{UUID}/poweron\nReboot device from the pool of used devices.\n\n1) Get device with specified uuid if exist.\n2) Check that device state is allowing power on, if not - return try later code.\n3) Power ON POE on port via cli on switch.\n4) Setup device state to \"poweron\".\n5) Return JSON response object with device data.\n\n## DELETE /device/{UUID}/\nRemove device from the pool of used devices.\n\n1) Get device with specified uuid if exist.\n2) Copy firmware(if exist), bootloaders(u-boot clean storage build) to folder with name as device serial in tftp root.\n3) Reboot device via POE.\n4) Device boot to u-boot and erasing storage -\u003e u-boot boot ipxe.\n5) IPXE get serial number of device from SMBIOS and get TFTP address(via DHCP).\n9) IPXE use serial and TFTP address to generate HTTP link to our API for getting IPXE cfg(TFTP server IP is also HTTP server IP).\n5) The device will shutdown when trying to get ipxe.cfg from our API.\n\n## GET /ipxe/{serial}/ipxe.efi.cfg\nGet ipxe.efi.cfg for device with specified serial.\n\n1) Get device in use with specified serial if exist.\n2) IF state of device \"creating\" \u003e switch device state to \"provisioning\" and send ipxe.efi.cfg from tftp folder.\n3) IF state of device \"provisioning\" \u003e switch bootloader to normal mode and return reboot-ipxe.efi.cfg file from images/ipxe/ folder -\u003e switch device state to \"poweron\" -\u003e device will be rebooted by ipxe.\n3) IF state of device \"erasing\" \u003e remove device from device in use pool, clean uuid, clean ipxe url, and power off device by POE switch.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsei%2Fasbdds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsei%2Fasbdds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsei%2Fasbdds/lists"}