Skip to content

Conversation

@lloyd-brown
Copy link
Collaborator

Tested (run the relevant ones):

  • Code formatting: install pre-commit (auto-check on commit) or bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: /smoke-test (CI) or pytest tests/test_smoke.py (local)
  • Relevant individual tests: /smoke-test -k test_name (CI) or pytest tests/test_smoke.py::test_name (local)
  • Backward compatibility: /quicktest-core (CI) or pytest tests/smoke_tests/test_backward_compat.py (local)

@lloyd-brown
Copy link
Collaborator Author

/build-docs

@github-actions
Copy link
Contributor

✅ ReadTheDocs build triggered for branch external-link-docs

The documentation will be available at: https://docs.skypilot.co/en/external-link-docs/

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lloyd-brown, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a significant enhancement to managed jobs by introducing a 'Custom Links' feature. This allows users to enrich their job monitoring experience by providing direct, configurable links to relevant external resources such as experiment trackers, custom dashboards, or cloud provider consoles. The implementation covers various methods for defining these links, from static configuration in YAML to dynamic updates during job execution, and integrates them seamlessly into the SkyPilot dashboard for improved observability.

Highlights

  • Custom Links Feature: Introduced the ability to associate custom URLs with managed jobs, which are displayed in the SkyPilot dashboard.
  • Flexible Link Definition: Users can define custom links in three ways: directly in the task YAML, via a new --custom-links CLI flag, or dynamically at runtime by appending to the $SKYPILOT_LINKS file.
  • Dashboard Integration: The SkyPilot dashboard now includes a dedicated section to display these custom links, with support for rendering linked images.
  • Automatic Instance Links: SkyPilot will automatically generate and display console links for the cloud instances (AWS, GCP, Azure) where managed jobs are running.
  • Database Schema Update: The database schema has been updated to store custom links associated with each managed job task.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a valuable "custom links" feature for managed jobs, allowing users to associate URLs with their jobs for display in the dashboard. The implementation is comprehensive, covering the backend, CLI, and frontend dashboard, and is accompanied by thorough documentation and tests. My review focuses on a few opportunities to improve code maintainability by refactoring duplicated logic and removing a redundant operation. Overall, this is a well-executed feature addition.

Comment on lines +179 to +184
SETUP_SKY_DIRS_COMMANDS = (
f'mkdir -p ~/sky_workdir && '
f'mkdir -p ~/.sky/sky_app && '
f'mkdir -p {SKY_RUNTIME_DIR}/.sky && '
# Create empty links file for runtime link syncing
'touch ~/.sky/links;')
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The addition of touch ~/.sky/links to SETUP_SKY_DIRS_COMMANDS appears to be redundant. The logic to create this file for managed jobs is already handled in sky/backends/cloud_vm_ray_backend.py, where it's correctly scoped to only managed jobs. This change will create the file on all clusters provisioned by SkyPilot, which is not the intended scope for this feature. Please remove the line touch ~/.sky/links; to avoid redundancy and potential confusion.

SETUP_SKY_DIRS_COMMANDS = (
    f'mkdir -p ~/sky_workdir && '
    f'mkdir -p ~/.sky/sky_app && '
    f'mkdir -p {SKY_RUNTIME_DIR}/.sky;')

Comment on lines +5865 to +5874
# For managed jobs, prepend links file creation to setup command
setup_cmd = self._setup_cmd
if task.managed_job_dag is not None:
links_path = constants.SKYPILOT_LINKS_PATH
create_links_file_cmd = (
f'mkdir -p $(dirname {links_path}) && touch {links_path}')
if setup_cmd is not None:
setup_cmd = f'{create_links_file_cmd} && {setup_cmd}'
else:
setup_cmd = create_links_file_cmd
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This logic for prepending the links file creation command is duplicated in _execute_task_n_nodes. To improve maintainability and avoid code duplication, consider refactoring this block into a helper method. This method could take self._setup_cmd and task as arguments and return the modified setup_cmd.

Comment on lines +583 to +590
for k, v in env_vars.items():
# Expand paths with ~ or $HOME for env vars that are file paths
if k == constants.SKYPILOT_LINKS_ENV_VAR:
sky_env_vars_dict_str.append(
f'sky_env_vars_dict[{k!r}] = os.path.expanduser({v!r})')
else:
sky_env_vars_dict_str.append(
f'sky_env_vars_dict[{k!r}] = {v!r}')
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This logic for processing environment variables, especially the special handling for SKYPILOT_LINKS_ENV_VAR, is duplicated in the add_task method. To reduce code duplication and improve maintainability, this logic could be extracted into a private helper method that both _add_ray_task and add_task can call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants