Skip to content

Conversation

@cmbrose
Copy link
Collaborator

@cmbrose cmbrose commented May 2, 2025

This update introduces improvements to the dev container setup by restructuring the logic for tool installation and execution:

  1. Tool Installation and Updates:

    • Moved the logic for installing tools and executables and the CLI extension from the onCreateCommand to a dedicated refreshTools script.
    • The refreshTools script is now invoked during the postStartCommand (instead of onCreateCommand, ensuring that tools are updated and initialized at both create and resume time.
    • refreshTools uses marker files to ensure that we don't keep repulling tools if the version hasn't changed
  2. Tool Invocation:

    • Tool starting is moved from the devcontainer.json into a new postStartCommand script
    • This ensures that the tool refresh always finishes before the tools are started

Copilot AI review requested due to automatic review settings May 2, 2025 20:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors how Spark tools and the Runtime CLI extension are updated and started in the dev container by introducing a unified refresh script, cleaning up duplicate logic, and updating container startup commands.

  • Introduce .devcontainer/refreshTools.sh to handle fetching and installing the latest CLI extension and Spark SDK/tools
  • Add .devcontainer/postStartCommand.sh to invoke the refresh script and launch Spark services after container start
  • Remove inline download logic from onCreate.sh and update devcontainer.json to use the new scripts and explicit port forwarding

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
.devcontainer/refreshTools.sh New script to upgrade the Runtime CLI, download the latest release, and install Spark tools with marker-based caching
.devcontainer/postStartCommand.sh New post-start script that calls refreshTools.sh and backgrounds all Spark services
.devcontainer/onCreate.sh Removed duplicated download/install logic for Spark tools
.devcontainer/devcontainer.json Switched postStartCommand to use the new script and defined forwardPorts
Comments suppressed due to low confidence (2)

.devcontainer/devcontainer.json:12

  • postStartCommand in devcontainer.json must be a string or array of strings, not an object. Replace this object with a single string (e.g. ".devcontainer/postStartCommand.sh") or an array of commands.
"postStartCommand": {

.devcontainer/devcontainer.json:13

  • The ports property is not valid inside postStartCommand. If this is intended as port forwarding, move it under the top-level forwardPorts array or remove it.
"ports": "gh cs ports visibility 5000:public -c $CODESPACE_NAME",

@cmbrose cmbrose merged commit 7c07b7f into main May 8, 2025
7 checks passed
@cmbrose cmbrose deleted the cmbrose/resumable-devcontainer branch May 8, 2025 17:00
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.

4 participants