Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use system environment variables when building docker-compose #495

Merged
merged 1 commit into from
Feb 7, 2022
Merged

Use system environment variables when building docker-compose #495

merged 1 commit into from
Feb 7, 2022

Conversation

tkmcc
Copy link
Contributor

@tkmcc tkmcc commented Feb 2, 2022

Description

Since version v0.27.2, host system environment variables are no longer able to be used in docker-compose.override.yml files for e.g. local development, this change passes along a pointer to the compose-go to use the system environment variables.

We have a local docker-compose.override.yml that tries to define volume which references a local path that includes an environment variable, like:

version: "2"
services:
  scheduler:
    volumes:
      - $HOME/myfile:/home/astro/myfile

As our team has gradually updated our astro-cli version, we noticed when running astro dev commands that we would get failures starting up because of a missing expected file and warnings that say WARN[0000] The "HOME" variable is not set. Defaulting to a blank string.

I believe the issue was introduced in the migration from libcompose, which handles parsing environment variables for you by default if you pass Environment = nil, and compose-go, which does not. Unfortunately I do not know go, but I managed to put this change together and it works locally. Please let me know if you have any pointers on how to add tests or make any further changes :) Thanks!

馃師 Issue(s)

Can't create issues on the repo externally.

馃И Functional Testing

Create docker-compose.override.yml similar to above and try running astro dev start or astro dev stop

馃摳 Screenshots

image

馃搵 Checklist

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

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.

Thanks for the contribution, lgtm 馃憤

@neel-astro
Copy link
Contributor

Adding internal issue for reference: https://github.com/astronomer/issues/issues/4203

@neel-astro neel-astro merged commit cdb731a into astronomer:main Feb 7, 2022
@tkmcc tkmcc deleted the use-os-env branch February 7, 2022 17:18
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.

None yet

3 participants