cloudfoundry / bosh-openstack-cpi-release

BOSH OpenStack CPI
Apache License 2.0
36 stars 59 forks source link

Introduce a new job with a golang CPI skeleton #278

Closed a-hassanin closed 3 weeks ago

a-hassanin commented 1 month ago

As mentioned before in the community meeting, we are currently developing and started using a new Golang-based Openstack CPI. Over the course of the next weeks/months we will follow up with many small PRs that you can easily follow and review, hoping that we catch up with the our internal implementation and use/develop directly from this upstream code-base.

Outcome of this PR

With this PR, we are introducing a new independent job for the Bosh release which can be used instead to use the Golang version of the CPI. Instead of doing a big bang rollout, we are developing and improving the Go-based implementation one CPI method at a time. With the help of the cpi.erb template we navigate unimplemented/erroneous cpi method calls to the the ruby or go implementations.

In this PR, we introduce the skeleton of the src folder, and only an implementation of the 'info' CPI method call.

Background

Maintaining the existing Ruby CPI implies sustaining the used openstack-fog and fog core libraries. But that would be very problematic since the communities for these libraries do not seem to be active since some years now.

Fog isn't just a thin wrapper around the OpenStack API. On the contrary, Fog returns rich modules and classes that need to be refreshed, updated, ... . That means, replacing Fog calls by REST calls isn't a trivial task and will finally end up in a more or less complete re-implementation of the CPI.

A Golang based CPI reimplementation would profit from the existence of an actively maintained Golang SDK for OpenStack (see: https://github.com/gophercloud/gophercloud)

Worth to mention, this is not a 1:1 implementation of the Ruby CPI. We try to improve and change the structure as we best see fit. Deprecated APIs are not supported by this CPI, hence we only support the Octavia APIs, Compute APIs, Networking APIs ... and not the neutron/networking endpoints.

aramprice commented 1 month ago

This looks great, congratulations on starting the conversion to golang.

You may want to add a linter, either as part of CI or using github actions. There are a few examples in CF including:

jpalermo commented 3 weeks ago

Do you want us to cut a new release of the CPI with this in it? Or do you want to wait for more changes?

a-hassanin commented 3 weeks ago

Do you want us to cut a new release of the CPI with this in it? Or do you want to wait for more changes?

Thanks for merging. We do not need a release right now, still a lot of subsequent PRs are following ;)