Giter VIP home page Giter VIP logo

spring-cloud / spring-cloud-app-broker Goto Github PK

View Code? Open in Web Editor NEW
26.0 19.0 38.0 25.13 MB

Spring Cloud project for implementing service brokers that conform to the Open Server Broker API specification

Home Page: http://projects.spring.io/spring-cloud/

License: Apache License 2.0

Java 98.43% Shell 1.38% Dockerfile 0.19%
spring-cloud cloudfoundry kubernetes open-service-broker open-service-broker-api service-broker

spring-cloud-app-broker's Introduction

Gitter

Spring Cloud App Broker

Spring Cloud App Broker is a framework for building Spring Boot applications that implement the Open Service Broker API to deploy applications to a platform.

The Open Service Broker API project allows developers to deliver services to applications running within cloud native platforms such as Cloud Foundry, Kubernetes, and OpenShift. Spring Cloud App Broker provides a framework based on Spring Boot that enables you to quickly create a service broker that deploys applications and services to the platform when managed services are provisioned.

Currently, Cloud Foundry is supported as a target platform for service instance backing applications and services.

Getting Started

See the project site and reference documentation to get started building a service broker using this framework.

Take a look at this introduction blog post and to our sample apps.

Compatibility

End-of-Support

Build

This project requires Java 17 at a minimum.

The project is built with Gradle. The Gradle wrapper allows you to build the project on multiple platforms and even if you do not have Gradle installed; run it in place of the gradle command (as ./gradlew) from the root of the main project directory.

Compile the project and run tests

./gradlew build

spring-cloud-app-broker's People

Contributors

abelsromero avatar albertoimpl avatar alek-sys avatar dependabot[bot] avatar dyroberts avatar fifthposition avatar fombico avatar gberche-orange avatar gfriedrich avatar littlebaibai avatar mheath avatar ojhughes avatar patibachleda avatar pg2000 avatar raulavila avatar royclarkson avatar scottfrederick avatar spikymonkey avatar spring-builds avatar spring-operator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-cloud-app-broker's Issues

As a service author I want to describe in a manifest which component steps are used to perform the `Provision` workflow

Using a manifest, describe which components (Spring Beans) are used to perform the Provision workflow as described: https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#provisioning

The current design within App Broker is that each Workflow within OSB is decomposed into a set of actions eg. Create Service Instance, GetLastOperation. Each of these actions will be further decomposed into a pipeline, made up of many steps that are chained together. Each step is a FunctionalInterface. An example step would be generateCredential.

App Broker will provide a default for each type of step, such as a deployApp that deploys to CF. Users will be able to override each individual step by providing a Spring Bean that implements the appropriate interface. An alternative way of configuring what steps are used would be to specify the @Bean class type within a manifest. An example of what this might look like is:

actions:
  - create-service-instance
     steps:
     - CustomCredentialsGenerator
     - NoOpParameterValidator

The order of the steps is fixed, so ordering of the manifest doesn't matter. If any of the expected steps are omitted then a default will be used

Implementing async broker operations with a reactive flow

What is the best pattern for kicking off a reactive flow in a service broker operation (e.g. create service instance) to implement async behavior? Will it require the spring-cloud-open-service-broker service interfaces to return reactive types?

As a service author, I can describe in a manifest that basic auth credentials should be generated for a deployed application

GIVEN The application manifest contains:

spring:
  cloud:
    appbroker: 
      services: 
        apps:
        - name: my-app
          credentials-providers:
          - name: SpringSecurityBasicAuth

AND The application manifest contains an app named basic-auth-app
WHEN a service instance is created
THEN the application basic-auth-app has a SPRING_APPLICATION_JSON environment variable containing the values:

{"security.user.name": "ageneratedusername", "security.user.password": "ageneratedpassword"}

Deploy multiple applications asynchronously with full configuration

  • Allow multiple applications to be deployed to back a service instance
  • Applications should be deployed asynchronously, returning async:true to the OSB API and reporting status via the "get last operation" OSB API
  • Allow the deployment options of each application to be configured (memory, disk, buildpack, health check timeout, etc)

parent of #7, parent of #9, parent of #50

As a service author I can use the abstractions provided by Spring Cloud Deployer as part of a multi-flow reactive pipeline

Currently the Deployer SPI provides non reactive signatures eg String deploy(AppDeploymentRequest request) (see [https://github.com/spring-cloud/spring-cloud-deployer/blob/master/spring-cloud-deployer-spi/src/main/java/org/springframework/cloud/deployer/spi/app/AppDeployer.java]

To use Deployer effectively within a multi-flow reactive pipeline, there would need to be alternative, reactive interfaces provided by the Deployer SPI, eg Mono<String> deploy(AppDeploymentRequest request)

It should be feasible to provide reactive alternatives to the default implementations of the Reactive SPI (Cloud Foundry, Kubernetes, Local)

cc @sabbyanandan

As a service author, I want service instance creation parameters mapped to SPRING_APPLICATION_JSON on deployed applications

GIVEN that I specify a backing app with the name: mapping-app
WHEN cf create-service my-service -c '{"key": "value", "compoundKey": { "subkey1": "subvalue1", "subkey2": "subvalue2" }}'
THEN I can see the SPRING_APPLICATION_JSON environment variable for the backing app mapping-app containing the value:

"{"transformed.key": "value", "other.transformed.compoundKey"; { "subkey1": "subvalue1", "subkey2": "subvalue2" }}"

where the mapping of keys from the request parameters to backing app env is configurable by the implementing service broker

As service author, I can describe in a manifest services that get created and bound to a backing app

GIVEN The application manifest contains:

spring:
  cloud
    appbroker:
      services: 
        apps:
        - name: app-with-services
          services:
          - service-instance-name: my-db-service
            name: mysqldb
            plan: small
            parameters: 
              key: value
          - service-instance-name: my-messaging-service
            name: rabbitmq
            plan: medium
            parameters: 
              key: value

WHEN a service instance is created
THEN backing service instances with the given names and plans should be created (asynchronously if required by the service) and bound to the app-with-services app

As a service author I want to have full freedom over the data a service broker stores and the database technology used.

Provide an adapter for persistence that allows developers to provide an implementation for persisting data within their service broker. Persistence hooks will be available for each defined phase in the Open Service Broker lifecycle, eg. create , update, deprovisionetc

By default App Broker will use an in-memory model with no persistence or JPA annotations on model classes. Developers will be free to reuse these model classes and optionally provide their own supplementary model classes.

Investigate using S-C-Contract Stub Runner instead of Hoverfly for contract testing

We had previously discounted Wiremock because of issues where a set of interactions span multiple requests. Using S-C-Contracts, it should be possible to run multiple stub servers, one for each CF service eg api.cf.., login.cf...` etc.

Using S-C-Contracts should be preferred as it is a Spring project! (So Hoverfly is maybe a stop gap solution)

see https://github.com/spring-cloud/spring-cloud-contract/tree/master/spring-cloud-contract-stub-runner

As a developer I want to have full freedom over the data app broker stores and the database technology used.

Provide an adapter for persistence that allows developers to provide an implementation for persisting data within their service broker. Persistence hooks will be available for each defined phase in the Open Service Broker lifecycle, eg. create , update, deprovisionetc

By default App Broker will use an in-memory model with no persistence or JPA annotations on model classes. Developers will be free to reuse these model classes and optionally provide their own supplementary model classes.

Automate the capture and post processing of `hoverfly` request/response simulation

Scenario Hoverfly is a test tool used to capture and playback HTTP requests. App Broker uses this tool to test the contract with our deployer and the cloud platform. Currently, a manual process is needed to generate the simulation.

Given A deployer performs a deployment operation, such as cf push
When a hoverfly process is configured to act as an intercepting proxy to capture the traffic
Then a simulation JSON file is exported and and automatically processed, as described in:
)

Prototype SI-backing service instance creation workflow

Building on #31, adding service instance creation and binding

GIVEN a description of service instances to deploy
WHEN the deployment is executed
THEN the apps are deployed as described
AND the service instances are deployed as described
AND service instances are bound to appropriate apps

As a service author, I can describe in a manifest that OAuth2 credentials should be generated for a deployed application

GIVEN The application manifest contains:

spring:
  cloud:
    appbroker: 
      services: 
        apps:
        - name: my-app
          credentials-providers:
          - name: SpringSecurityOAuth2
            args: 
            - identity-zone-subdomain: my-identity-zone

WHEN a service instance is created
THEN the application my-app has a SPRING_APPLICATION_JSON environment variable containing the values:

{
"security.oauth2.client.access-token-uri: "https://my-identity-zone.uaa.example.com/oauth/token", 
"security.oauth2.client.client-id": "my-app-[SI GUID]", 
"security.oauth2.client.client-secret": "a-generated-secret"
}

AND a client with the ID and secret will be stored in UAA within the specified identity zone
AND the client will be deleted from UAA when the service instance is deleted

If the args: identity-zone-subdomain configuration property is omitted, then the client is created in the default UAA identity zone.

As a service author, I can invoke the service create endpoint to get an app pushed to CF

Given a Spring Boot application packaged in a Jar file
When a PUT request to /v2/service_instances/:instance_id is received
And configuration parameters are specified for the deployment
And the deployer implementation is specified
Then the Spring Boot application is pushed to Cloud Foundry using the configured parameters
And the deployer returns information about the deployed application

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.