Skip to content

Conversation

@cloud-j-luna
Copy link
Member

@cloud-j-luna cloud-j-luna commented Jul 9, 2025

This PR fixes outdated and missing targets in the SSH development environment.

It will also help streamline the engineering documentation for SSH development environment.

@coderabbitai
Copy link

coderabbitai bot commented Jul 9, 2025

Walkthrough

Environment setup switched from a fixed sourced env to dynamic variables (AP_RUN_NAME, AP_RUN_DIR); AKASH_HOME now points to ${AP_RUN_DIR}/.akash. The Makefile adds prerequisites and replaces the final kind setup with kube-install-helm-charts and kube-setup-$(AP_RUN_NAME), plus two new phony targets.

Changes

Cohort / File(s) Change Summary
Envrc change
_run/ssh/.envrc
Added AP_RUN_NAME and AP_RUN_DIR; set AP_RUN_NAME=$(basename "$PWD"), AP_RUN_DIR="${DEVCACHE_RUN}/${AP_RUN_NAME}"; changed AKASH_HOME to "${AP_RUN_DIR}/.akash"; exported AP_RUN_NAME and AP_RUN_DIR.
Makefile adjustments
_run/ssh/Makefile
kube-cluster-setup-gpu now depends on $(KUBE_CREATE), kube-cluster-check-info, kube-setup-ingress, then kube-prepare-images; replaced kind-setup-$(KIND_NAME) with kube-install-helm-charts and kube-setup-$(AP_RUN_NAME); added .PHONY entries for kube-deployments-rollout and kube-setup-ssh.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer/Make
  participant Env as .envrc (shell)
  participant Make as Makefile targets
  participant Kube as Kubernetes cluster actions

  Dev->>Env: load env (.envrc)
  note right of Env #DDEFEF: AP_RUN_NAME=$(basename "$PWD")\nAP_RUN_DIR="${DEVCACHE_RUN}/${AP_RUN_NAME}"\nAKASH_HOME="${AP_RUN_DIR}/.akash"
  Env-->>Dev: exports AP_RUN_NAME, AP_RUN_DIR, AKASH_HOME

  Dev->>Make: make kube-cluster-setup-gpu
  Make->>Make: run $(KUBE_CREATE)
  Make->>Make: kube-cluster-check-info
  Make->>Make: kube-setup-ingress
  Make->>Make: kube-prepare-images
  Make->>Kube: kube-install-helm-charts
  Make->>Kube: kube-setup-$(AP_RUN_NAME)
  Make->>Kube: kube-deployments-rollout (phony)
  Make->>Make: kube-setup-ssh (phony)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

"I dug a tunnel, found a name,
A run that changes with each game.
Makefile hops, new targets play,
Helm and setup lead the way.
A rabbit cheers for paths that shift — 🐇"

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch luna/improve-ssh-dev

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cloud-j-luna cloud-j-luna linked an issue Jul 9, 2025 that may be closed by this pull request
@cloud-j-luna cloud-j-luna marked this pull request as ready for review July 10, 2025 12:45
@cloud-j-luna cloud-j-luna requested review from boz and troian as code owners July 10, 2025 12:45
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
_run/ssh/Makefile (1)

61-65: Consider adding implementation or documentation for empty targets

The new phony targets kube-deployments-rollout and kube-setup-ssh are currently empty. If these are intended as placeholders for future implementation, consider adding a comment to indicate this.

 .PHONY: kube-deployments-rollout
 kube-deployments-rollout:
+	# TODO: Implement deployment rollout logic

 .PHONY: kube-setup-ssh
 kube-setup-ssh:
+	# TODO: Implement SSH setup logic
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c39e6eb and 6b0059c.

📒 Files selected for processing (2)
  • _run/ssh/.envrc (1 hunks)
  • _run/ssh/Makefile (2 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
_run/ssh/Makefile

[warning] 64-64: Missing required phony target "all"

(minphony)


[warning] 64-64: Missing required phony target "clean"

(minphony)


[warning] 64-64: Missing required phony target "test"

(minphony)

🔇 Additional comments (5)
_run/ssh/.envrc (2)

8-8: LGTM: Dynamic AKASH_HOME configuration

The update to use AP_RUN_DIR for AKASH_HOME makes the configuration more flexible and context-sensitive, which should help address the outdated targets issue mentioned in the PR objectives.


11-12: LGTM: Proper export of new variables

The export of AP_RUN_NAME and AP_RUN_DIR ensures these variables are available to the Makefile and other scripts that depend on them.

_run/ssh/Makefile (3)

28-28: LGTM: Explicit kubeconfig specification

Adding the explicit --kubeconfig "$(AKASH_KUBECONFIG)" parameter ensures the provider uses the correct kubeconfig file, which aligns with the environment variable setup in .envrc.


50-53: LGTM: Enhanced cluster setup prerequisites

The addition of $(KUBE_CREATE), kube-cluster-check-info, and kube-setup-ingress as prerequisites provides a more comprehensive setup process for the GPU cluster.


58-59: LGTM: Dynamic target integration

The use of kube-setup-$(AP_RUN_NAME) makes the setup process context-aware and should help address the outdated targets issue mentioned in the PR objectives.

export AKASH_KUBECONFIG=$KUBECONFIG
export AP_KUBECONFIG=$KUBECONFIG
export AP_RUN_NAME
export AP_RUN_DIR
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export KUBE_SSH_NODES="root@<YOUR_CLUSTER_IP>" will still need to be manually added. CC @chainzero

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
_run/ssh/Makefile (3)

63-64: Generalize kube-setup-ssh to a pattern rule so other run names don’t break

  • The empty kube-setup-ssh stub satisfies the current AP_RUN_NAME=ssh case, but any future run-name will fail at parse time unless you add new stubs. Prefer a pattern rule.

Apply this diff to future-proof:

-.PHONY: kube-setup-ssh
-kube-setup-ssh:
+.PHONY: kube-setup-%
+kube-setup-%:
+	@echo "kube setup hook for '$*' has no additional steps; continuing"

60-64: Optional: Address checkmake minphony warnings (all/clean/test) locally or silence for run/ssh

  • Static analysis flagged missing phony targets “all”, “clean”, “test”. Given this is an environment-specific Makefile, consider lightweight aliases to satisfy linters without altering behavior:
+.PHONY: all clean test
+all: kube-cluster-setup-gpu
+clean: clean-gpu
+test:
+	@echo "No tests for SSH dev-env Makefile"
  • Alternatively, if your project standard is to only define these at the top-level, consider excluding _run/ssh/Makefile from that check in CI.

49-51: Update SSH Makefile: remove unnecessary fallback and optionally enforce sequential cluster setup

After inspecting _run/common-kube.mk, we see:

  • KUBE_CREATE := $(AP_RUN_DIR)/.kube-create is set unconditionally, so introducing a ?= fallback in _run/ssh/Makefile is redundant.
  • To guarantee that the kube-cluster-setup-gpu prerequisites run in order when users invoke make -j, you may optionally disable parallelism for this target.

Locations to update:

  • File: _run/ssh/Makefile
  • Target: kube-cluster-setup-gpu

Suggested diff:

--- a/_run/ssh/Makefile
+++ b/_run/ssh/Makefile
@@
-.PHONY: kube-cluster-setup-gpu
+kube-cluster-setup-gpu: init \
@@
    kube-setup-ssh

+# Prevent parallel execution to preserve prerequisite order under make -j
+.NOTPARALLEL: kube-cluster-setup-gpu

No changes needed for KUBE_CREATE.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6b0059c and 596c2fe.

📒 Files selected for processing (1)
  • _run/ssh/Makefile (1 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
_run/ssh/Makefile

[warning] 63-63: Missing required phony target "all"

(minphony)


[warning] 63-63: Missing required phony target "clean"

(minphony)


[warning] 63-63: Missing required phony target "test"

(minphony)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: release-dry-run
  • GitHub Check: integration-tests / crd-e2e
  • GitHub Check: build-bins
🔇 Additional comments (1)
_run/ssh/Makefile (1)

60-62: No common kube-deployments-rollout to override—local stub is the sole implementation
I’ve checked the included files and there is no kube-deployments-rollout target in _run/common-kube.mk, _run/common-commands.mk, or _run/common.mk. Each cluster-specific Makefile (_run/ssh, _run/single, run/kube) provides its own rollout logic (or stub), so removing the SSH stub would break its rollout step rather than restore common behavior.

Likely an incorrect or invalid review comment.

Copy link

@chainzero chainzero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and approve changes

@chainzero chainzero merged commit bf47737 into main Aug 22, 2025
12 checks passed
@chainzero chainzero deleted the luna/improve-ssh-dev branch August 22, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve SSH env setup

3 participants