Skip to content

Comments

Update pre-run hook for dev init command#1856

Merged
pritt20 merged 3 commits intomainfrom
fix_dev_init
May 23, 2025
Merged

Update pre-run hook for dev init command#1856
pritt20 merged 3 commits intomainfrom
fix_dev_init

Conversation

@pritt20
Copy link
Contributor

@pritt20 pritt20 commented May 22, 2025

Description

It has been observed that we look for container runtime binary even when initializing the astro project with command astro dev init. The users who do not have any container runtime installed on their machine due to organisation policies were unable to make use of astro CLI to create new projects that can be executed remotely in different environment.

This PR updates the Pre-run hook for dev init command and allow users to initialize the astro project without needing to install any container runtime on their machine.

🎟 Issue(s)

Related #1857

🧪 Functional Testing

Tested on local environment:

  • Before:
astro dev init

Error: Failed to find a container runtime. See the Astro CLI prerequisites for more information. https://www.astronomer.io/docs/astro/cli/install-cli
Usage:
  astro dev init [flags]

Examples:

# Initialize a new Astro project with the latest version of Astro Runtime
astro dev init

# Initialize a new Astro project with Astro Runtime 4.1.0
astro dev init --runtime-version 4.1.0

# Initialize a new Astro project with the latest Astro Runtime version based on Airflow 2.2.3
astro dev init --airflow-version 2.2.3

# Initialize a new template based Astro project with the latest Astro Runtime version
astro dev init --from-template


Flags:
  -a, --airflow-version string                     Version of Airflow you want to create an Astro project with. If not specified, latest is assumed. You can change this version in your Dockerfile at any time.
  -t, --from-template string[="select-template"]   Provides a list of templates to select from and create the local astro project based on the selected template. Please note template based astro projects use the latest runtime version, so runtime-version and airflow-version flags will be ignored when creating a project with template flag
  -h, --help                                       help for init
  -n, --name string                                Name of Astro project
  -v, --runtime-version string                     Specify a version of Astro Runtime that you want to create an Astro project with. If not specified, the latest is assumed. You can change this version in your Dockerfile at any time.

Global Flags:
      --verbosity string   Log level (debug, info, warn, error, fatal, panic (default "warning")
  • After:
astro dev init
Initialized empty Astro project in /tmp/test

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

@pritt20 pritt20 marked this pull request as ready for review May 22, 2025 11:54
@pritt20 pritt20 merged commit 9333f72 into main May 23, 2025
4 of 5 checks passed
@pritt20 pritt20 deleted the fix_dev_init branch May 23, 2025 11:41
neel-astro pushed a commit that referenced this pull request May 26, 2025
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.

2 participants