Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

merge latest from master to poc branch #232

Merged
merged 41 commits into from
Feb 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c998912
refactor event function signatures (#147)
krancour Dec 15, 2017
2d3ca2f
Firewall rule parameterization (#152)
jeremyrickard Dec 16, 2017
9f73217
Few minor corrections to the Quickstart (#136)
Dec 18, 2017
16424e8
kick of redis tests sooner (#155)
krancour Dec 18, 2017
dd62ac5
s/module lifecycle tests/service lifecycle tests/g (#156)
krancour Dec 18, 2017
a207ba1
make storage know how to deal with service-specific types (#153)
krancour Dec 18, 2017
e075ae3
don't use codec where we don't need it anymore (#161)
krancour Dec 19, 2017
d1f8446
Updating CircleCI to define DOCKER_REPO env var (#167)
jeremyrickard Dec 19, 2017
990ab39
s/context/details/g (#163)
krancour Dec 19, 2017
f397ecc
don't store credentials as their own field (#169)
krancour Dec 19, 2017
81461a5
quickstart fixes (#174)
krancour Dec 20, 2017
2a8f93c
adding missing docker pushes to release process
krancour Dec 20, 2017
9fb9902
Adding build flags to inject the version and commit (#173)
arschles Dec 29, 2017
70a0330
broker doesn't need to hang on to codec (#180)
krancour Dec 29, 2017
18cda9b
remove quotes from devel pseudo-version string (#184)
krancour Dec 29, 2017
da3ea07
fix bug decoding tags (#183)
krancour Dec 29, 2017
d795eab
move version info to avoid import cycle later (#185)
krancour Dec 29, 2017
6a8a319
Adding user-agent string to requests to ARM (#172)
arschles Dec 29, 2017
7d717af
use separate redis clients for storage and async engine (#182)
krancour Dec 29, 2017
241d527
Adding ability to filter lifecycle tests (#181)
jeremyrickard Jan 2, 2018
c45571c
use redis namespaces (#188)
krancour Jan 2, 2018
404bf21
start using lightweight-docker-go image for development tasks (#190)
krancour Jan 4, 2018
4fe64fe
simplify ci config (#194)
krancour Jan 4, 2018
d4a3e3f
README work (#196)
mmacy Jan 8, 2018
d594f77
append instead of replacing user-agent (#198)
joshgav Jan 9, 2018
bd6b030
add deferred task execution to async package (#208)
krancour Jan 15, 2018
b35216b
reorganize async pakage/sub-packages more sanely (#210)
krancour Jan 16, 2018
4fd29e8
change provision/deprovision task names (#211)
krancour Jan 17, 2018
6a99996
Add async support for "follow-up" tasks (#212)
krancour Jan 17, 2018
d304ae2
ignore .vscode/ (#221)
krancour Jan 22, 2018
abdfdf8
more async refactoring (#219)
krancour Jan 23, 2018
4fd4bf4
add svc and plan to instance during retrieval (#220)
krancour Jan 24, 2018
610b1e5
Changes to mysql bind. (#222)
jeremyrickard Jan 24, 2018
7977f7d
Initial roadmap submission (#226)
jeremyrickard Jan 24, 2018
b21f173
Refactor for generic filter capabilities (#218)
jeremyrickard Jan 25, 2018
d5d1f7c
Change how the database name for cosmos db is generated (#228)
jeremyrickard Jan 26, 2018
7e288b4
merge master
krancour Feb 5, 2018
eaa297e
fix async cleaner (#233)
krancour Feb 5, 2018
dc91cd8
Merge branch 'master' into poc-merge-master
krancour Feb 6, 2018
13a55a1
bug fix: fix wait again on children not deprovisioned
krancour Feb 6, 2018
370524c
bug fix: it's ok for an instance's parent to not be found
krancour Feb 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.glide/
.vscode/
bin/
_vendor-*/
vendor.orig/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[Open Service Broker](https://www.openservicebrokerapi.org/)-compatible API
server that provisions managed services in the Microsoft Azure public cloud.

|![](https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Warning.svg/150px-Warning.svg.png) | This software is under heavy development. Releases observe [semantic versioning](https://semver.org), but the project is in an ALPHA status and no assurances are made regarding backwards compatibility or stability. All releases prior to v1.0.0 will remain subject to the possibility of breaking changes when the MINOR version number has been incremented. |
|![](https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Warning.svg/150px-Warning.svg.png) | This software is under heavy development. Releases observe [semantic versioning](https://semver.org), but the project is in an ALPHA status and no assurances are made regarding backwards compatibility or stability. All releases prior to v1.0.0 will remain subject to the possibility of breaking changes when the MINOR version number has been incremented. Please see the offical [roadmap](docs/roadmap.md) for more information. |
|---|---|

![Open Service Broker for Azure GIF](docs/images/demovideo.gif)
Expand Down
16 changes: 11 additions & 5 deletions cmd/broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import (
"syscall"
"time"

"github.com/Azure/open-service-broker-azure/pkg/api/authenticator/basic"
apiFilters "github.com/Azure/open-service-broker-azure/pkg/api/filters"
"github.com/Azure/open-service-broker-azure/pkg/broker"
"github.com/Azure/open-service-broker-azure/pkg/crypto/aes256"
"github.com/Azure/open-service-broker-azure/pkg/http/filter"
"github.com/Azure/open-service-broker-azure/pkg/http/filters"
"github.com/Azure/open-service-broker-azure/pkg/version"
log "github.com/Sirupsen/logrus"
"github.com/go-redis/redis"
Expand Down Expand Up @@ -95,13 +97,17 @@ func main() {
log.Fatal(err)
}

// Assemble the filter chain
basicAuthConfig, err := getBasicAuthConfig()
if err != nil {
log.Fatal(err)
}
authenticator := basic.NewAuthenticator(
basicAuthConfig.Username,
basicAuthConfig.Password,
filterChain := filter.NewChain(
filters.NewBasicAuthFilter(
basicAuthConfig.Username,
basicAuthConfig.Password,
),
apiFilters.NewAPIVersionFilter(),
)

modulesConfig, err := getModulesConfig()
Expand All @@ -119,7 +125,7 @@ func main() {
storageRedisClient,
asyncRedisClient,
codec,
authenticator,
filterChain,
modules,
modulesConfig.MinStability,
azureConfig.DefaultLocation,
Expand Down
12 changes: 7 additions & 5 deletions cmd/compliance-test-broker/compliance-test-broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import (
"time"

"github.com/Azure/open-service-broker-azure/pkg/api"
"github.com/Azure/open-service-broker-azure/pkg/api/authenticator/basic"
apiFilters "github.com/Azure/open-service-broker-azure/pkg/api/filters"
fakeAsync "github.com/Azure/open-service-broker-azure/pkg/async/fake"
"github.com/Azure/open-service-broker-azure/pkg/crypto/noop"
"github.com/Azure/open-service-broker-azure/pkg/http/filter"
"github.com/Azure/open-service-broker-azure/pkg/http/filters"
"github.com/Azure/open-service-broker-azure/pkg/services/fake"
memoryStorage "github.com/Azure/open-service-broker-azure/pkg/storage/memory"
log "github.com/Sirupsen/logrus"
Expand All @@ -29,17 +31,17 @@ func main() {
username := "username"
password := "password"

authenticator := basic.NewAuthenticator(
username,
password,
filterChain := filter.NewChain(
filters.NewBasicAuthFilter(username, password),
apiFilters.NewAPIVersionFilter(),
)

noopCodec := noop.NewCodec()
server, err := api.NewServer(
8080,
memoryStorage.NewStore(fakeCatalog, noopCodec),
fakeAsync.NewEngine(),
authenticator,
filterChain,
fakeCatalog,
" ",
" ",
Expand Down
37 changes: 37 additions & 0 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Roadmap

This is the official roadmap for the Open Service Broker for Azure (OSBA) project. OSBA is currently available as an alpha release and this roadmap represents our plan to deliver (OSBA) and the services it provides in a stable form.

This roadmap addresses stability in terms of two dimensions:

* Services/Plans
* Database Schemas

These aspects of the broker can mature out of step and need to be considered independently. For example, the broker currently uses Redis to store all data and orchestrate asynchronous queues. As the broker matures, we may make changes that require additional information to be persisted for provisioned services or change table or collection names. These will result in incompatibilities with previously populated Redis instances. As we make these changes to mature the broker and work toward a stable release, we are not able to guarantee backward compatibility or migration paths for previous broker installations. Once we declare services and our broker have reached preview status, we will begin to ensure backward compatibility for future releases.

See below for more information concerning stability plans for each.

# Services and Plans

As services are developed, the plans available and features of the service may change and are not guaranteed to exist in the final stable release. When a service is promoted to stable, we will ensure backward compatibility. Services/Plans have three stability tiers:

- `experimental` - We have an idea for a new service that we want to support, but don't have a good idea how it should look. We are essentially “throwing something against the wall” to see if it'll stick. Experimental services may be radically changed or removed at any time
- `preview` - We have a better understanding how a service should look, but we don't yet guarantee backward compatibility. We do guarantee that this service won't go back to `experimental`, so we are committing to making it exist in some shape or form
- `stable` - We now understand usage patterns of the service very well and we guarantee full backward compatibility

Here are our timelines for service stabilities:

- SQL Server: `preview` by the end of February 2018
- MySQL: `preview` by the end of February 2018
- PostgreSQL: `preview` by the end of February 2018

We aren't yet setting timelines on other service stabilities, but will continue to mature additional services once we promote the service modules above to preview. Promotion from preview to stable will depend on the maturity of the underlying service. For example, the [Azure Database for PostgreSQL](https://azure.microsoft.com/en-us/services/postgresql/) service offering is currently in `Preview`. We will not promote the OSBA PostgreSQL offering to `stable` until the service itself is promoted out of `Preview` status.

# Database Schemas

There are two tiers of database schemas to consider:

1. General outline: the broker currently uses Redis to store all data and orchestrate asynchronous queues. General outline means the names and arrangement of the "tables" and layout of asynchronous queues
1. Individual services: the broker stores provisioning and binding data for each service/plan in a "table" in Redis. Individual services means the layout of each provisioning & binding record. When a service is marked `stable`, its individual service schema will be backward compatible.

In both areas, maturation of the broker may result in changes to the schema that will be incompatible with previous broker and Redis deployments. Our goal is to have a few services into `preview` before we declare the General outline (#1 above) as backward compatible. Since we're declaring three of them (see above) in `preview` at the end of February 2018, *we are aiming at Mid-march 2018 for a stable general database schema (#1 above)*.
21 changes: 0 additions & 21 deletions pkg/api/authenticator/always/authenticator.go

This file was deleted.

15 changes: 0 additions & 15 deletions pkg/api/authenticator/authenticator.go

This file was deleted.

62 changes: 0 additions & 62 deletions pkg/api/authenticator/basic/authenticator.go

This file was deleted.

16 changes: 1 addition & 15 deletions pkg/api/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,7 @@ func (s *server) bind(w http.ResponseWriter, r *http.Request) {
return
}

// At this point, there's absolute agreement on what service we're dealing
// with. We can go ahead and find the Service itself to get the
// ServiceManager.
svc, ok := s.catalog.GetService(instance.ServiceID)
if !ok {
// If we don't find the Service in the catalog, something is really wrong.
// (It should exist, because an instance with this serviceID exists.)
logFields["serviceID"] = instance.ServiceID
log.WithFields(logFields).Error(
"pre-binding error: no Service found for serviceID",
)
s.writeResponse(w, http.StatusInternalServerError, responseEmptyJSON)
return
}
serviceManager := svc.GetServiceManager()
serviceManager := instance.Service.GetServiceManager()

// Unpack the parameter map in the request to a struct
bindingParameters := serviceManager.GetEmptyBindingParameters()
Expand Down
3 changes: 1 addition & 2 deletions pkg/api/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ func TestBindingWithInstanceThatIsNotFullyProvisioned(t *testing.T) {
s, _, err := getTestServer("", "")
assert.Nil(t, err)
instanceID := getDisposableInstanceID()
planID := getDisposablePlanID()
err = s.store.WriteInstance(service.Instance{
InstanceID: instanceID,
ServiceID: fake.ServiceID,
PlanID: planID,
PlanID: fake.StandardPlanID,
Status: service.InstanceStateProvisioning,
})
assert.Nil(t, err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package api
import (
"fmt"

"github.com/Azure/open-service-broker-azure/pkg/api/authenticator/always"
fakeAsync "github.com/Azure/open-service-broker-azure/pkg/async/fake"
"github.com/Azure/open-service-broker-azure/pkg/crypto/noop"
"github.com/Azure/open-service-broker-azure/pkg/http/filter"
"github.com/Azure/open-service-broker-azure/pkg/services/fake"
memoryStorage "github.com/Azure/open-service-broker-azure/pkg/storage/memory"
uuid "github.com/satori/go.uuid"
Expand Down Expand Up @@ -60,7 +60,7 @@ func getTestServer(
8080,
memoryStorage.NewStore(fakeCatalog, noop.NewCodec()),
fakeAsync.NewEngine(),
always.NewAuthenticator(),
filter.NewChain(),
fakeCatalog,
defaultAzureLocation,
defaultAzureResourceGroup,
Expand Down
37 changes: 7 additions & 30 deletions pkg/api/deprovision.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"time"

"github.com/Azure/open-service-broker-azure/pkg/async/model"
"github.com/Azure/open-service-broker-azure/pkg/async"
"github.com/Azure/open-service-broker-azure/pkg/service"
log "github.com/Sirupsen/logrus"
"github.com/gorilla/mux"
Expand Down Expand Up @@ -84,32 +84,9 @@ func (s *server) deprovision(w http.ResponseWriter, r *http.Request) {
// or has failed provisioning. We need to kick off asynchronous
// deprovisioning.

svc, ok := s.catalog.GetService(instance.ServiceID)
if !ok {
// If we don't find the Service in the catalog, something is really wrong.
// (It should exist, because an instance with this serviceID exists.)
logFields["serviceID"] = instance.ServiceID
log.WithFields(logFields).Error(
"pre-deprovisioning error: no Service found for serviceID",
)
s.writeResponse(w, http.StatusInternalServerError, responseEmptyJSON)
return
}
plan, ok := svc.GetPlan(instance.PlanID)
if !ok {
// If we don't find the Service in the catalog, something is really wrong.
// (It should exist, because an instance with this serviceID exists.)
logFields["serviceID"] = instance.ServiceID
logFields["planID"] = instance.PlanID
log.WithFields(logFields).Error(
"pre-deprovisioning error: no Plan found for planID in Service",
)
s.writeResponse(w, http.StatusInternalServerError, responseEmptyJSON)
return
}
serviceManager := svc.GetServiceManager()
serviceManager := instance.Service.GetServiceManager()

deprovisioner, err := serviceManager.GetDeprovisioner(plan)
deprovisioner, err := serviceManager.GetDeprovisioner(instance.Plan)
if err != nil {
logFields["serviceID"] = instance.ServiceID
logFields["planID"] = instance.PlanID
Expand Down Expand Up @@ -153,10 +130,10 @@ func (s *server) deprovision(w http.ResponseWriter, r *http.Request) {
s.writeResponse(w, http.StatusInternalServerError, responseEmptyJSON)
}

var task model.Task
var task async.Task
if childCount > 0 {
logFields["provisionedChildren"] = childCount
task = model.NewDelayedTask(
task = async.NewDelayedTask(
"checkChildrenStatuses",
map[string]string{
"instanceID": instanceID,
Expand All @@ -165,8 +142,8 @@ func (s *server) deprovision(w http.ResponseWriter, r *http.Request) {
)
log.WithFields(logFields).Debug("children not deprovisioned, waiting")
} else {
task = model.NewTask(
"deprovisionStep",
task = async.NewTask(
"executeDeprovisioningStep",
map[string]string{
"stepName": firstStepName,
"instanceID": instanceID,
Expand Down
Loading