EC2: sandbox start waits ~2.5 min on instance status checks

Open Beginner friendly
#4,322 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
aws, python

Research direction

Start in the EC2 sandbox provider and read _wait_for_instance_ready alongside _wait_for_ssh; confirm that the SSH waiter already polls, then check git history for why the instance_status_ok wait was added. Before changing anything, get a maintainer answer on the issue's question, since removing a guard is a behavior change. Done means the status-check wait is dropped or gated behind an option, with the ~205s vs ~53s timings reproduced on m7i-flex and any provider tests updated.

Written by the indexing model from the issue text.

Description

Every EC2 sandbox sits idle for about two and a half minutes before Harbor starts using it, and it doesn't seem to need to.

_wait_for_instance_ready waits for instance_status_ok before it tries SSH. In practice sshd is up well before the status checks pass, and _wait_for_ssh polls anyway, so the sandbox just sits there.

Numbers from m7i-flex in us-east-2: environment setup is ~205s as is, ~53s if I only wait for instance_running.

Is the status check wait there for a reason I'm missing? If not, I can PR dropping it or putting it behind an option.

Side note: both waiters go through asyncio.to_thread, so the default thread pool caps how many sandboxes can be starting at once (32 on a 32-core box).

Dominant language
Python
Stars
5.6k
Forks
1.9k
Avg merge
1d 17h
Merged PRs (30d)
156

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from harbor-framework/harbor

All issues in harbor-framework/harbor

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.