-
Notifications
You must be signed in to change notification settings - Fork 73
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds Podman Container Runtime #1750
Conversation
120d170
to
8fda48e
Compare
8fda48e
to
24eb943
Compare
b2c1aa7
to
2cec150
Compare
9d8943c
to
8c353ec
Compare
Configure() error | ||
ConfigureOrKill() error | ||
Kill() error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding 3 new lifecycle methods here. The airflow hooks call these methods depending on the situation.
bea8e70
to
c86a6da
Compare
// is running on Apple macOS. | ||
func isMac() bool { | ||
return runtime.GOOS == "darwin" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored to os_checker
20cc12b
to
8e95465
Compare
349b073
to
0c585f5
Compare
cmd/airflow_hooks.go
Outdated
// Check if the OS is Windows and create the plugins project directory if it doesn't exist. | ||
// In Windows, the compose project will fail if the plugins directory doesn't exist, due | ||
// to the volume mounts we specify. | ||
osChecker := new(runtimes.DefaultOSChecker) | ||
if osChecker.IsWindows() { | ||
pluginsDir := filepath.Join(config.WorkingPath, "plugins") | ||
if err := os.MkdirAll(pluginsDir, os.ModePerm); err != nil && !os.IsExist(err) { | ||
return fmt.Errorf(failedToCreatePluginsDir, err) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pritt20 I attempted to simplify the nesting here a little. If you have your VM running would you mind testing this again on windows? And is the comment I added here accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @schnie !
I tested this scenario on windows machine and it is working as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code was well commented making the review much easier, thanks for that ❤️.
Left some minor comments, but overall lgtm.
Co-authored-by: Neel Dalsania <neel.dalsania@astronomer.io>
f0b5a09
to
92b929c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Pritesh Arora <pritt@Priteshs-MacBook-Pro.local> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Neel Dalsania <neel.dalsania@astronomer.io>
Description
This PR adds changes specific to podman container runtime and podman machine management. These changes will allow users to create astro local project without needing to manually manage podman machines and also removes some prerequisites required to setup astro cli therefore reducing friction during installation of CLI.
Notable code changes:
docker
andpodman
commands. We don't actually run the commands during the unit tests. We should test the concrete implementations with some e2e tests in the future though. "Runtimes" contain the high-level logic around managing the specific container runtimes. "Engines" are responsible for actually executing commands and returning the output.runtimes
package have been replaced withmockery
-generated mocks for unit tests.🎟 Issue(s)
Related to https://github.com/astronomer/astro/issues/24344
🧪 Functional Testing
Tested Podman specific changes by spinning up local projects on Mac and Windows:
Mac:
Windows:
📸 Screenshots
📋 Checklist
make test
before taking out of draftmake lint
before taking out of draft