Code Monkey home page Code Monkey logo

spring-cloud-app-broker's Introduction

Spring Cloud Connectors

Spring Cloud Connectors provides a simple abstraction that JVM-based applications can use to discover information about the cloud environment on which they are running, connect to services, and have discovered services registered as Spring beans. It provides out-of-the-box support for discovering common services on Heroku and Cloud Foundry cloud platforms, and it supports custom service definitions through Java Service Provider Interfaces (SPI).

Note
This project is in maintenance mode, in favor of the newer Java CFEnv project. We will continue to release security-related updates but will not address enhancement requests.

Learn more

Build

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.

To compile the project and run tests

./gradlew build

To build a JAR

./gradlew jar

To generate Javadoc API documentation

./gradlew api

To list all available tasks

./gradlew tasks

Contributing

Spring Cloud is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. If you want to contribute even something trivial please do not hesitate, but follow the guidelines below.

Sign the Contributor License Agreement

Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement. Signing the contributor’s agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests.

Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Code Conventions and Housekeeping

None of these is essential for a pull request, but they will all help. They can also be added after the original pull request but before a merge.

  • Use the Spring Framework code format conventions. If you use Eclipse you can import formatter settings using the eclipse-code-formatter.xml file from the Spring Cloud Build project. If using IntelliJ, you can use the Eclipse Code Formatter Plugin to import the same file.

  • Make sure all new .java files to have a simple Javadoc class comment with at least an @author tag identifying you, and preferably at least a paragraph on what the class is for.

  • Add the ASF license header comment to all new .java files (copy from existing files in the project)

  • Add yourself as an @author to the .java files that you modify substantially (more than cosmetic changes).

  • Add some Javadocs and, if you change the namespace, some XSD doc elements.

  • A few unit tests would help a lot as well — someone has to do it.

  • If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project).

  • When writing a commit message please follow these conventions, if you are fixing an existing issue please add Fixes gh-XXXX at the end of the commit message (where XXXX is the issue number).

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

Watchers

 avatar  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 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

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

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

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:
)

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

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.

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"}

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?

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 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.

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 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 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

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

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.