adobe / aquarium-fish

Your best secure distributed heterogeneous dynamic compute resource manager for CI
Other
7 stars 3 forks source link

Explore adding native windows and linux driver #79

Open solvingj opened 2 months ago

solvingj commented 2 months ago

This was mostly an exercise to familiarize myself with the codebase and test suite.

Stopping for discussion with @sparshev because it seemed likely to me the intention was to have the single existing Native driver service all platforms with conditionals around platform-specific behavior, and not using any abstractions like polymorphism. Need to ask and confirm, and if/so, would like specific guidance on how to handle the awkward implications in the native drivers Config.go, Driver.go, without the code becoming very bloated and hard to reason about.

This work also raised questions about how we might implement the configuration of the native driver to perform a limited subset of the current behavior, like "don't create new user', or alternative behaviors like "git clean workspace" and then "reboot after use". The goal here would be to implement native driver which just adds precise new features to our existing bare metal without changing anything fundamental like creating new users/etc.

Related Issue

https://github.com/adobe/aquarium-fish/issues/78

Motivation and Context

Add windows support for the Native Driver

How Has This Been Tested?

Testing incomplete, thus far, only exploratory work

Screenshots (if appropriate):

Here's output of new fish_native_windows_test.go unit test on windows:

GOROOT=C:\tools\go-1.23.0\go #gosetup
GOPATH=C:\tools\go-1.23.0\go\bin #gosetup
C:\tools\go-1.23.0\go\bin\go.exe test -c -o C:\Users\jwiltse\AppData\Local\JetBrains\GoLand2024.2\tmp\GoLand\___fish_native_windows_test_go.test.exe github.com/adobe/aquarium-fish/tests/drivers #gosetup
C:\tools\go-1.23.0\go\bin\go.exe tool test2json -t C:\Users\jwiltse\AppData\Local\JetBrains\GoLand2024.2\tmp\GoLand\___fish_native_windows_test_go.test.exe -test.v=test2json -test.paniconexit0 -test.run ^\QTest_fish_native_win\E$ #gosetup
=== RUN   Test_fish_native_win
=== PAUSE Test_fish_native_win
=== CONT  Test_fish_native_win
2024/09/05 18:21:23 INFO:   NativeWin: Created user for Application execution: fish-pzdvqr
2024/09/05 18:21:23 INFO:   NativeWin: The images are processed.
2024/09/05 18:21:27 INFO:   NativeWin: Started environment for user "fish-pzdvqr"
--- PASS: Test_fish_native_win (4.05s)
PASS

Process finished with the exit code 0

Types of changes

Checklist:

solvingj commented 2 months ago

After discussion with @sparshev:

New questions for @sparshev :

solvingj commented 2 months ago

Ok i've re-implemented using embedded structs and go build pragmas, and some shared functions. Theres a bunch of error handling and return-value cleanup that still needs to happen, but submitting this now to make sure it matches @sparshev goal structurally.

sparshev commented 2 months ago

Yep, structurally looks very nice)