-
-
Notifications
You must be signed in to change notification settings - Fork 983
Fix worker images, code-upload git dependency, and CI/Cloud Agent Docker bootstrap #5141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
RishabhJain2018
merged 8 commits into
master
from
cursor/fix-worker-py39-image-resolution-d2c6
Jul 8, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4b74a3f
Fix worker image resolution when worker_python_version differs from s…
cursoragent 30c940e
Code Upload Worker: install git for kubectl kustomize remote bases
cursoragent 9290a8f
Fix CI worker image builds and Cloud Agent Docker bootstrap
cursoragent 56c8d97
Fix Cloud Agent Docker bootstrap for Ubuntu Noble and black formatting
cursoragent 8b593b6
Move Cloud Agent install script to cloud-agent/install.sh
cursoragent b0db0c9
Worker py3.9: pin PyYaml for runtime import verification
cursoragent eb9e4c5
Address remaining CodeRabbit review feedback
cursoragent 0bd75ac
Fix black formatting in worker image refresh test
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "install": "docker compose build db sqs django", | ||
| "install": "bash cloud-agent/install.sh && docker compose build db sqs django", | ||
| "start": "docker compose up -d db sqs django" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| ensure_docker_compose_package() { | ||
| if apt-cache show docker-compose-plugin >/dev/null 2>&1; then | ||
| echo "docker-compose-plugin" | ||
| return 0 | ||
| fi | ||
| if apt-cache show docker-compose-v2 >/dev/null 2>&1; then | ||
| echo "docker-compose-v2" | ||
| return 0 | ||
| fi | ||
| echo "No docker compose package found in apt repositories." >&2 | ||
| return 1 | ||
| } | ||
|
|
||
| configure_iptables_legacy_if_available() { | ||
| if update-alternatives --list iptables 2>/dev/null | grep -q legacy; then | ||
| sudo update-alternatives --set iptables /usr/sbin/iptables-legacy | ||
| else | ||
| echo "Skipping iptables-legacy setup (not available on this image)." | ||
| fi | ||
|
|
||
| if update-alternatives --list ip6tables 2>/dev/null | grep -q legacy; then | ||
| sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy | ||
| else | ||
| echo "Skipping ip6tables-legacy setup (not available on this image)." | ||
| fi | ||
| } | ||
|
|
||
| configure_docker_daemon() { | ||
| sudo mkdir -p /etc/docker | ||
| if [ ! -f /etc/docker/daemon.json ]; then | ||
| sudo tee /etc/docker/daemon.json >/dev/null <<'EOF' | ||
| { | ||
| "storage-driver": "fuse-overlayfs", | ||
| "cgroup-parent": "system.slice" | ||
| } | ||
| EOF | ||
| fi | ||
| } | ||
|
|
||
| start_docker_daemon() { | ||
| local dockerd_log | ||
| dockerd_log="$(mktemp)" | ||
|
|
||
| if sudo docker info >/dev/null 2>&1; then | ||
| echo "Docker daemon is already running." | ||
| rm -f "${dockerd_log}" | ||
| return 0 | ||
| fi | ||
|
|
||
| if command -v systemctl >/dev/null 2>&1 && [ -d /run/systemd/system ]; then | ||
| if sudo systemctl enable --now docker 2>/dev/null; then | ||
| rm -f "${dockerd_log}" | ||
| return 0 | ||
| fi | ||
| echo "systemctl could not start docker; falling back to dockerd." | ||
| fi | ||
|
|
||
| if ! pgrep -x dockerd >/dev/null 2>&1; then | ||
| echo "Starting dockerd in the background..." | ||
| sudo dockerd >"${dockerd_log}" 2>&1 & | ||
| fi | ||
|
|
||
| for _ in $(seq 1 30); do | ||
| if sudo docker info >/dev/null 2>&1; then | ||
| rm -f "${dockerd_log}" | ||
| return 0 | ||
| fi | ||
| sleep 1 | ||
| done | ||
|
|
||
| echo "Docker daemon failed to start. Recent dockerd logs:" >&2 | ||
| tail -50 "${dockerd_log}" >&2 || true | ||
| rm -f "${dockerd_log}" | ||
| return 1 | ||
| } | ||
|
|
||
| if command -v docker >/dev/null 2>&1; then | ||
| echo "Docker client is already installed." | ||
| else | ||
| echo "Installing Docker for Cloud Agent VM..." | ||
| if ! compose_package="$(ensure_docker_compose_package)"; then | ||
| echo "Cannot install Docker without a compose package." >&2 | ||
| exit 1 | ||
| fi | ||
| sudo apt-get update | ||
| sudo apt-get install -y fuse-overlayfs iptables docker.io "${compose_package}" | ||
| configure_iptables_legacy_if_available | ||
| configure_docker_daemon | ||
| if getent group docker >/dev/null 2>&1; then | ||
| sudo usermod -aG docker "${USER}" || true | ||
| fi | ||
| fi | ||
|
|
||
| start_docker_daemon | ||
|
|
||
| sudo docker --version | ||
| sudo docker compose version | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.