lablup / lablup/backend.ai

Docker agent fails to generate SSH host key on macOS: Exec format error on dropbearmulti

Open
#9,798 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

When running the Docker agent on macOS (ARM64), _write_config() at docker/agent.py attempts to execute dropbearmulti.{arch}.bin on the host to generate a dropbear RSA host key. However, this binary is a Linux ELF executable, not a macOS Mach-O binary, causing:

OSError: [Errno 8] Exec format error: '.../runner/dropbearmulti.aarch64.bin'

## Fix approach

1. install-dev.sh: Add dropbear installation step for macOS (e.g. brew install dropbear). This provides a native macOS dropbearkey binary.
1. docker/agent.py (_write_config): Add platform check — if sys.platform == 'darwin', use the locally installed dropbearkey (e.g. from Homebrew at /opt/homebrew/bin/dropbearkey or via shutil.which('dropbearkey')). Otherwise, use the existing krunner dropbearmulti binary as before (default behavior for Linux).

## Affected code

- src/ai/backend/agent/docker/agent.py — _write_config method (dropbearkey invocation)
- scripts/install-dev.sh — add dropbear installation for macOS

JIRA Issue: BA-4949

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.