-
Notifications
You must be signed in to change notification settings - Fork 13
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
api/equinixmetal: do not exclusively rely on Google Cloud Storage #340
Conversation
platform/api/equinixmetal/api.go
Outdated
// created for a test. | ||
type Storage interface { | ||
// Upload the []byte data to the implemented storage. | ||
Upload(string, string, []byte) (string, string, 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.
This could use a bit of doc about what the string parameters and returns are expected to mean.
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.
Or can one add names?
7c4ffd4
to
26dfd4f
Compare
@pothos thanks for your review - comments have been addressed:
|
cmd/kola/options.go
Outdated
@@ -197,8 +197,11 @@ func init() { | |||
sv(&kola.EquinixMetalOptions.InstallerImageKernelURL, "equinixmetal-installer-image-kernel-url", "", "EquinixMetal installer image kernel URL, (default equinixmetal-installer-image-base-url/flatcar_production_pxe.vmlinuz)") | |||
sv(&kola.EquinixMetalOptions.InstallerImageCpioURL, "equinixmetal-installer-image-cpio-url", "", "EquinixMetal installer image cpio URL, (default equinixmetal-installer-image-base-url/flatcar_production_pxe_image.cpio.gz)") | |||
sv(&kola.EquinixMetalOptions.ImageURL, "equinixmetal-image-url", "", "EquinixMetal image URL (default board-dependent, e.g. \"https://alpha.release.flatcar-linux.net/amd64-usr/current/flatcar_production_packet_image.bin.bz2\")") | |||
sv(&kola.EquinixMetalOptions.StorageURL, "equinixmetal-storage-url", "gs://users.developer.core-os.net/"+os.Getenv("USER")+"/mantle", "Google Storage base URL for temporary uploads") | |||
sv(&kola.EquinixMetalOptions.StorageURL, "equinixmetal-storage-url", "gs://users.developer.core-os.net/"+os.Getenv("USER")+"/mantle", "Storage URL for temporary uploads (supported: gs, ssh+http, ssh+https, ssh") |
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.
sv(&kola.EquinixMetalOptions.StorageURL, "equinixmetal-storage-url", "gs://users.developer.core-os.net/"+os.Getenv("USER")+"/mantle", "Storage URL for temporary uploads (supported: gs, ssh+http, ssh+https, ssh") | |
sv(&kola.EquinixMetalOptions.StorageURL, "equinixmetal-storage-url", "gs://users.developer.core-os.net/"+os.Getenv("USER")+"/mantle", "Storage URL for temporary uploads (supported: gs, ssh+http, ssh+https, or ssh which defaults to https for download)") |
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.
Looks good to me, thanks
this interface defines three methods: * `Upload` * `Delete` * `Close` To respectively upload and delete content on implemented storage. Close can be used to close any created connections. Signed-off-by: Mathieu Tortuyaux <[email protected]>
`gcs` implements the `Storage` interface to upload and delete data on Google Cloud Storage. Signed-off-by: Mathieu Tortuyaux <[email protected]>
this defines a ssh storage implementing the Storage interface. This implementation can be used if the `--equinixmetal-storage-url` used the following schemes: * ssh * ssh+http * ssh+https In the Upload method, a SSH connection is made and the file is uploaded on the document root of the remote server. The returned URL is built from the storage URL scheme (http or https) and the document root. It's up to the operator to deploy and configure Webserver and SSH setup. Signed-off-by: Mathieu Tortuyaux <[email protected]>
based on the StorageURL value, we dispatch the storage creation to instantiate the correct implementation based on the URL scheme. Signed-off-by: Mathieu Tortuyaux <[email protected]>
Signed-off-by: Mathieu Tortuyaux <[email protected]>
Signed-off-by: Mathieu Tortuyaux <[email protected]>
Signed-off-by: Mathieu Tortuyaux <[email protected]>
Signed-off-by: Mathieu Tortuyaux <[email protected]>
this can be used to close eventual underlying connections. Signed-off-by: Mathieu Tortuyaux <[email protected]>
93d9f44
to
754f050
Compare
In this PR, we abstract the temporary storage used by Equinix Metal tests and we bring the possibility to implement another ones (like SSH).
Related to: flatcar/Flatcar#720
How to use
./kola run --platform=equinixmetal ... --equinixmetal-storage-url="ssh+https://my-server"
Testing done
(Voluntary obfuscated the server name)
Also tested with regular GCS (default behavior)
changelog/
directory (user-facing change, bug fix, security fix, update)