astronomer / astro-cli

CLI that makes it easy to create, test and deploy Airflow DAGs to Astronomer
https://www.astronomer.io
Other
334 stars 70 forks source link

Allow passing build args, not just secrets, to relevant `astro dev ...` commands #1668

Open ttzhou opened 3 weeks ago

ttzhou commented 3 weeks ago

āœļø Is your feature request related to a problem? Please describe.

Currently, we can pass secrets to various astro dev ... commands via the --build-secrets flag. However, there are times where we may want to pass "one-off" arguments at build time (which we may not want as environment variables) that we can reference via ARG. This does not currently seem possible (2024-06-14), as confirmed by this response on the community Slack

šŸ§© Describe the solution you'd like

The request is for the ability to pass build time arguments that can be referenced via ARG, via a flag --build-arg <NAME>=<VALUE> (or some equivalent).

E.g.

astro dev start \
  --build-secrets id=...,src=... \
  --build-arg XXX=FOO \
  --build-arg YYY=BAR

šŸ¤” Describe alternatives you've considered

We can get halfway there by using the --env arg and specifying a file to use (this is what we currently use as a workaround); however, some args we'd like not to be lying around in the environment, as they are for a true "one-off" usage.

Is your feature request specific to a particular Astronomer Platform?

šŸ’” Additional context

Thanks for all the incredible work Astronomer does for Airflow.

sunkickr commented 3 weeks ago

@ttzhou you could run a custom docker build --build-arg= command and then run start a project with that image astro dev start --image-name....

But I agree this solution would not be as nice as the one you have described above

ttzhou commented 3 weeks ago

@ttzhou you could run a custom docker build --build-arg= command and then run start a project with that image astro dev start --image-name....

But I agree this solution would not be as nice as the one you have described above

For sure, and I'm good to take that approach - the response on the Community Slack suggested to file this anyway though! @sunkickr