Spaces:
Sleeping
Sleeping
umgefahren
commited on
Fix some additional stuff
Browse files- Dockerfile +6 -1
- main.py +4 -1
Dockerfile
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
FROM ghcr.io/astral-sh/uv:alpine
|
| 2 |
|
| 3 |
RUN apk add curl python3
|
|
|
|
|
|
|
| 4 |
|
| 5 |
RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
|
| 6 |
|
| 7 |
-
RUN arduino-cli core install arduino:avr
|
| 8 |
|
| 9 |
RUN adduser -u 1000 -D user
|
| 10 |
|
|
@@ -13,6 +14,10 @@ USER user
|
|
| 13 |
ENV HOME=/home/user \
|
| 14 |
PATH=/home/user/.local/bin/:$PATH
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
WORKDIR $HOME/app
|
| 18 |
|
|
|
|
| 1 |
FROM ghcr.io/astral-sh/uv:alpine
|
| 2 |
|
| 3 |
RUN apk add curl python3
|
| 4 |
+
# Arduino’s avr‑gcc toolchain is linked against glibc. Install gcompat to provide the glibc‑compatible loader on Alpine.
|
| 5 |
+
RUN apk add --no-cache gcompat
|
| 6 |
|
| 7 |
RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
|
| 8 |
|
|
|
|
| 9 |
|
| 10 |
RUN adduser -u 1000 -D user
|
| 11 |
|
|
|
|
| 14 |
ENV HOME=/home/user \
|
| 15 |
PATH=/home/user/.local/bin/:$PATH
|
| 16 |
|
| 17 |
+
RUN arduino-cli core install arduino:avr
|
| 18 |
+
|
| 19 |
+
RUN chown -R user /home/user/.arduino15
|
| 20 |
+
RUN chmod -R 777 /home/user/.arduino15
|
| 21 |
|
| 22 |
WORKDIR $HOME/app
|
| 23 |
|
main.py
CHANGED
|
@@ -128,10 +128,13 @@ async def interact_with_agent(
|
|
| 128 |
for call in event.get_function_responses():
|
| 129 |
if call.name == "compile_with_arduino" and call.response["success"]:
|
| 130 |
path = call.response["project_dir"]
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
yield messages, None, None, gr.DownloadButton(
|
| 133 |
"Download ELF",
|
| 134 |
-
|
| 135 |
variant="primary",
|
| 136 |
render=False,
|
| 137 |
interactive=True,
|
|
|
|
| 128 |
for call in event.get_function_responses():
|
| 129 |
if call.name == "compile_with_arduino" and call.response["success"]:
|
| 130 |
path = call.response["project_dir"]
|
| 131 |
+
elf_path = os.path.join(path, "output", "arduino_project.ino.elf")
|
| 132 |
+
print(f"elf_path: {elf_path}")
|
| 133 |
+
os.chmod(elf_path, 0o777)
|
| 134 |
|
| 135 |
yield messages, None, None, gr.DownloadButton(
|
| 136 |
"Download ELF",
|
| 137 |
+
elf_path,
|
| 138 |
variant="primary",
|
| 139 |
render=False,
|
| 140 |
interactive=True,
|