Skip to content

Commit ea04350

Browse files
committed
Add luxonis-list-devices
1 parent d451424 commit ea04350

File tree

7 files changed

+66
-0
lines changed

7 files changed

+66
-0
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
jfrog/jfrog-cli: 'jfrog/jfrog-cli/**'
6363
jsonnet: 'jsonnet/**'
6464
ldap-utils: 'ldap-utils/**'
65+
luxonis-list-devices: 'luxonis-list-devices/**'
6566
markdownlint: 'markdownlint/**'
6667
meshcmd: 'meshcmd/**'
6768
netbox: 'netbox/**'

luxonis-list-devices/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
README.md
2+
test/

luxonis-list-devices/Containerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# syntax=docker/dockerfile:1
2+
# Arguments used in FROM need to be defined before the first build stage
3+
ARG BASE_IMAGE=docker.io/polymathrobotics/python:3.9-noble
4+
# hadolint ignore=DL3006
5+
FROM $BASE_IMAGE
6+
7+
# Install depthai
8+
RUN pip install --no-cache-dir depthai
9+
10+
# Copy your script into the image
11+
COPY list_devices.py /list_devices.py
12+
13+
# Default entrypoint
14+
CMD ["python3", "/list_devices.py"]

luxonis-list-devices/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# luxonis-list-devices
2+
3+
```
4+
docker run --rm --net=host docker.io/polymathrobotics/luxonis-list-devices
5+
```

luxonis-list-devices/docker-bake.hcl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
variable "TAG_PREFIX" {
2+
default = "docker.io/polymathrobotics/luxonis-list-devices"
3+
}
4+
5+
# There's no darwin-based Docker, so if we're running on macOS, change the platform to linux
6+
variable "LOCAL_PLATFORM" {
7+
default = regex_replace("${BAKE_LOCAL_PLATFORM}", "^(darwin)", "linux")
8+
}
9+
10+
target "_common" {
11+
dockerfile = "Containerfile"
12+
tags = [
13+
"${TAG_PREFIX}:latest"
14+
]
15+
labels = {
16+
"org.opencontainers.image.source" = "https://github.com/polymathrobotics/oci"
17+
"org.opencontainers.image.licenses" = "Apache-2.0"
18+
"org.opencontainers.image.description" = "Utility for listing all luxonis network devices on network."
19+
"org.opencontainers.image.title" = "${TAG_PREFIX}"
20+
"org.opencontainers.image.created" = "${timestamp()}"
21+
}
22+
}
23+
24+
target "local" {
25+
inherits = ["_common"]
26+
platforms = ["${LOCAL_PLATFORM}"]
27+
}
28+
29+
target "default" {
30+
inherits = ["_common"]
31+
platforms = ["linux/amd64", "linux/arm64/v8"]
32+
}

luxonis-list-devices/list_devices.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import depthai as dai
2+
3+
for device in dai.Device.getAllAvailableDevices():
4+
print(f"{device.getMxId()} {device.state}")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
describe command('python3') do
2+
it { should exist }
3+
end
4+
5+
describe command('python3 --version') do
6+
its('exit_status') { should eq 0 }
7+
its('stdout') { should match(/Python 3.9/) }
8+
end

0 commit comments

Comments
 (0)