Skip to content

Comments

Add client deploy support for RE projects#1954

Merged
feluelle merged 2 commits intomainfrom
feature/deploy-client-image
Oct 9, 2025
Merged

Add client deploy support for RE projects#1954
feluelle merged 2 commits intomainfrom
feature/deploy-client-image

Conversation

@feluelle
Copy link
Member

@feluelle feluelle commented Oct 8, 2025

Description

Describe the purpose of this pull request.

This pull request introduces a new "remote deploy" command to support building and pushing client images to a configurable remote registry, along with improvements to Docker authentication and extensive test coverage. The changes include a new command group, a new deploy workflow for client images, enhancements to Docker login for OAuth-based registries, and comprehensive tests for the new functionality.

Major features and improvements:

New Remote Deploy Command

  • Adds a new remote command group with a deploy subcommand (cmd/cloud/remote.go) that allows users to build and deploy client images to a remote registry, supporting custom image names, platforms, and build secrets.

Client Image Deployment Workflow

  • Implements the DeployClientImage function and supporting InputClientDeploy struct in cloud/deploy/deploy.go, enabling image builds (with multi-platform support), tagging, and pushes to a configurable remote registry, with proper error handling and user feedback. [1] [2]
  • Updates CLI flags and documentation for image name usage with the new client deploy workflow.

Docker Authentication Enhancements

  • Introduces a testable DockerLogin function in airflow/docker_registry.go that performs Docker login using a shell command, supporting OAuth/Bearer tokens and integration with custom container runtimes. [1] [2]
  • Removes the "Pushing image to Astronomer registry" print statement from the Docker image push logic, delegating messaging to the caller for more flexible UX. [1] [2] [3]

Testing Improvements

  • Adds comprehensive tests for the new DeployClientImage workflow, including scenarios for successful deploys, authentication failures, missing configuration, build failures, push failures, and custom image name handling (cloud/deploy/deploy_test.go).
  • Adds unit tests for the new DockerLogin function, covering different credential and error scenarios (airflow/docker_registry_test.go).

Dependency and Import Updates

  • Updates imports across affected files to support new functionality and testing, including time handling, error wrapping, and runtime detection. [1] [2] [3]

These changes collectively enhance the CLI's ability to manage and deploy client images to remote registries, improve authentication support, and ensure robust test coverage for new workflows.

🎟 Issue(s)

closes: #1929

🧪 Functional Testing

List the functional testing steps to confirm this feature or fix.

❯ mkdir -p test-proj

❯ cd test-proj/

❯ ../astro dev init --remote-execution-enabled --remote-image-repository quay.io/astronomer/test-re-image
If you want to modify the remote repository down the line, use the `astro config set <config-name> <config-value>` command while being inside the local project
Initialized empty Astro project in /Users/felix.uellendall/Projects/astro-cli/test-proj

❯ docker login quay.io

...

❯ ../astro remote deploy
Authenticated to Astro 

Building client image for host platform
✔ Project image has been updated
Pushing client image to configured remote registry
The push refers to repository [quay.io/astronomer/test-re-image]
db1ec1396cec: Preparing 
250077b8e2f1: Preparing 
ff7ad0ed8843: Preparing 
15495de9b3c9: Preparing 
f53340173a70: Preparing 
bc08155b92b2: Preparing 
e135bfc8d962: Preparing 
d4dbe2768164: Preparing 
aed80eec9d8e: Preparing 
dc99db8fe0f7: Preparing 
5f70bf18a086: Preparing 
463ffe7c4a8c: Preparing 
a5dc7b3351fc: Preparing 
3f277a7e8af5: Preparing 
647becd00dde: Preparing 
4ebcb07c8ff5: Preparing 
8a3e3dd48e16: Preparing 
aec039246eac: Preparing 
aec039246eac: Layer already exists 
e052a77e1b4c: Layer already exists 
bfd674033216: Layer already exists 
3727986a7369: Layer already exists 
f9f463ef0ab6: Layer already exists 
3272b0f1ab5d: Layer already exists 
434f09d4c07c: Layer already exists 
12e54a87ed64: Layer already exists 
1cbba14035d1: Layer already exists 
30ea4d3c81cc: Layer already exists 
897f9bea8fc9: Layer already exists 
4db91a9800d0: Layer already exists 
3a260fc55d56: Layer already exists 
1bda2267e2a0: Layer already exists 
40c1701160ee: Layer already exists 
3fd12b3e124a: Layer already exists 
d266c3e26fa4: Layer already exists 
5db2ff227830: Layer already exists 
d8e87551fda9: Layer already exists 
07d4c428e5bd: Layer already exists 
deploy-2025-10-09T11-59: digest: sha256:48b068d8fd9130f674e1f59a667600cf4a1cb4653540133283393266ac8bafed size: 8448
Successfully pushed client image to quay.io/astronomer/test-re-image:deploy-2025-10-09T11-59

📸 Screenshots

Add screenshots to illustrate the validity of these changes.

📋 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

@coveralls-official
Copy link

coveralls-official bot commented Oct 8, 2025

Pull Request Test Coverage Report for Build daba1279-352d-4b3f-86b8-9669f3a12ad3

Details

  • 99 of 125 (79.2%) changed or added relevant lines in 6 files are covered.
  • 54 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.06%) to 38.501%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cloud/deploy/deploy.go 55 66 83.33%
cmd/cloud/remote.go 26 41 63.41%
Files with Coverage Reduction New Missed Lines %
cmd/software/deploy.go 2 89.02%
docker/docker.go 2 46.81%
airflow-client/airflow-client.go 6 90.36%
software/deploy/deploy.go 21 87.56%
software/auth/auth.go 23 84.8%
Totals Coverage Status
Change from base Build 58557133-5598-45ae-9ac0-1379a254e559: 0.06%
Covered Lines: 24125
Relevant Lines: 62661

💛 - Coveralls

@feluelle feluelle force-pushed the feature/deploy-client-image branch from 36cafb4 to 46a7b12 Compare October 8, 2025 13:42
Copy link
Contributor

@neel-astro neel-astro left a comment

Choose a reason for hiding this comment

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

Left a couple of comments, but otherwise the change is looking solid, thanks for putting this all together

@feluelle feluelle force-pushed the feature/deploy-client-image branch from 46a7b12 to 4b53722 Compare October 8, 2025 17:49
@feluelle feluelle requested a review from neel-astro October 8, 2025 17:50
Copy link
Contributor

@neel-astro neel-astro left a comment

Choose a reason for hiding this comment

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

LGTM

- add `--client` flag to deploy command
- add `--platform` flag to deploy command
@feluelle feluelle force-pushed the feature/deploy-client-image branch 3 times, most recently from 9a24bc3 to 5c0c81b Compare October 9, 2025 11:57
@feluelle feluelle requested a review from neel-astro October 9, 2025 12:03
Copy link
Contributor

@neel-astro neel-astro left a comment

Choose a reason for hiding this comment

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

Left some nits, but otherwise LGTM

@feluelle feluelle force-pushed the feature/deploy-client-image branch from 2e63d4f to 0c6c054 Compare October 9, 2025 12:54
@feluelle feluelle merged commit bf791b8 into main Oct 9, 2025
7 checks passed
@feluelle feluelle deleted the feature/deploy-client-image branch October 9, 2025 13:26
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.

Add support for remote client image push as part of astro deploy

2 participants