GithubHelp home page GithubHelp logo

sap-samples / cf-mta-examples Goto Github PK

View Code? Open in Web Editor NEW
111.0 19.0 42.0 8.98 MB

The repository contains multitarget application (MTA) examples for SAP BTP, Cloud Foundry environment. Examples demonstrate how to achieve different goals using MTAs and show the capabilities of MTA deployment service in the Cloud Foundry environment.

License: Apache License 2.0

Java 100.00%
sample sample-code mta cloud-foundry sap-cloud-platform sap-btp

cf-mta-examples's Introduction

Description

REUSE status

The repository contains Multitarget Application (MTA) examples for SAP Business Technology Platform Cloud Foundry environment. Examples demonstrate how to achieve different goals using MTAs and what are the capabilities of SAP Cloud Deployment service in Cloud Foundry environment.

Before you start with the examples, please make sure that:

  • You are familiar with the basic concepts of Cloud Foundry, such as Cloud Foundry applications, services, service bindings

  • You are familiar with the basic concepts of MTA modeling, such as MTA modules, resources and dependencies between them. For more information, you may refer to official documentation for Multitarget Applications for the Cloud Foundry Environment on the SAP Help Portal: Multitarget Applications for the Cloud Foundry Environment

Requirements

  • Access to SAP Business Technology Platform Cloud Foundry environment. There you need to have account. MTA examples will be deployed in some of the account’s organization and space.

  • Installed CloudFoundry CLI - ensure that CloudFoundry CLI is installed and working. For more information about installation of CloudFoundry CLI, please visit the official CloudFoundry Documentation. For the examples, CloudFoundry CLI v8 is supported.

  • Installed MultiApps CF CLI Plugin - ensure that MultiApps CF CLI Plugin is installed and working. For more information, please visit the official GitHub Page

  • [Optional] Installed Cloud MTA Build Tool - the tool is used in some of the listed use cases. For more information please visit the official Cloud MTA Build Tool Documentation

Download and Installation

Clone the repository, following the instructions.

MTA use case examples

Share configuration values between MTAs via a configuration registry

Parallel deployment

Optimize deploy time by executing deploy operations in parallel

Sequential resource processing

Zero downtime update

Solution development efficiency

Deploy a remote MTAR

Limitations

Most examples are generic for MultiApps Controller that is the standard MTA Deployment service for Cloud Foundry. Some, however are runnable only on SAP Business Technology Platform Cloud Foundry, because of speciffic service offerings or functionalities available only there.

Known Issues

Not detected issues

How to obtain support

Create an issue, following the instructions.

License

Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the [LICENSE](LICENSES/Apache-2.0.txt) file.

cf-mta-examples's People

Contributors

ajinkyapatil8190 avatar boyan-velinov avatar btbernard avatar christiansavchev avatar ddonchev avatar ikasarov avatar ivanborislavovdimitrov avatar katunin-ng avatar philippthiele avatar radito3 avatar theghost5800 avatar vaskobozhurski avatar vkalapov avatar yavor16 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  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  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  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

cf-mta-examples's Issues

Partial deploy - link deployed CF app to MTA version

Hello,
I am looking to use the partial deploy feature.
The problem we face is when trying to map the CF applications to the last MTA version with which it was deployed.

e.g.
Lets say an MTA has 5 modules - A, B, C, D, E

  • MTA version 1.0 - deploys all 5 to CF
  • Code change 1
  • Deploy A, B to CF. MTA version 1.1
  • Code change 2
  • Deploy B, C, D to CF. MTA version 1.2

Now looking at the apps in CF,
how do I identify that A was deployed on MTA version 1.1, but E is still on version 1, while B,C,D were updated with version 1.2

The 'cf mta' command only prints out the associated apps, but without any information on the version.

Thanks,
Yogesh

Example: Content deployment - no information on the structure of the content.zip archive

The readme file only mentions that there should be a zip archive containing the web apps but it doesn't specify more. I went ahead and downloaded the archive from https://github.com/SAP-samples/cf-mta-examples/tree/master/content-deployment/content to investigate its internal structure.

I saw that it uses the following structure:

content.zip
|── webapp1.zip
|── webapp2.zip
|── webapp3.zip
|   |── manifest.json
|   |── xs-app.json
|   |──  ...

My ask would be to add this information to the readme to make it easier to find.

Example: SAP CP Destinations

Create an example showing the modelling & creation of SAP CP "destinations" with an mta deploy.
The example should cover both:

  • instance level destinations and sub-account level destinations
  • destinations to service instances (keys) & destinations to a route of an app within the same MTA

Hide Role Collections From Subscriber Subaccount

Dear Colleagues, 
 
I am part of the SAP ETD-Cloud team which is working on a multi-tenant application that is deployed  in Cloud Foundry.
 
For authentication, authorization, application routing and role generation we use XSUAA. The roles are created from the mta.yaml which resides in the SAP Application Router. The application is part of the Cloud Foundry subscription and it is multi-tenant based.
 
Is there any possibility to hide custom roles for the subscribed accounts? We would like to have certain roles visible only to our central tenant while others should be available for all the subscribers, including us.
 
Regards,
Borcea Cristian.

How to bind route to a user-provided service?

Hi guys, this is a very helpful repo to better understand MTA implementation. I looked through the examples, but couldn't find any example for my particular case. I'm creating this issue so future devs that have the same problem can search and hopefully find a solution in this issue.

I have a user-provided app rate-limiter that is bound to the route of a route service. It serves as a proxy to add rate limiting to multiple applications. I can bind my application to this route service by running cf bind-route-service and I do get the rate limited. My question is how can I do this via the MTA file?

I've tried adding the service under requires and adding the rate-limiter as a resource:

modules:
  - name: my-app
    type: java
    path: /
    requires:
      - name: rate-limiter

resources:
  - name: rate-limiter
    type: org.cloudfoundry.user-provided-service

This does bind the service to the app as I get this in the deployment output:

Binding service instance "rate-limiter" to application "my-app"...

However, it doesn't actually bind the route. My app doesn't get rate limited and when I run cf unbind-route-service it outputs this:

➜  ~ cf unbind-route-service my-app-domain rate-limiter --hostname my-app-host

Unbinding may leave apps mapped to route my-app-host.my-app-domain vulnerable; e.g. if service instance rate-limiter provides authentication. Do you want to proceed?> y
Unbinding route my-app-host.my-app-domain from service instance rate-limiter in org * / space * as [email protected]...
Route my-app-host.my-app-domain was not bound to service instance rate-limiter.
OK

Thanks 🙏

remove property using extension descriptor

Hi,
I have tried to make use of the feature to remove a property/parameter using the extension descriptor.
Following the sample https://github.com/SAP-samples/cf-mta-examples/tree/main/parameter-and-property-metadata#deploy-mta-with-not-null-property-and-remove-it-in-the-extension-descriptor
I haven't succeeded to remove the property "not-null-property".

What I did:
1.modified the mtar archive and edited inside the mtad.yml file, saved the archive
2. deploy
3. redeploy using an extension.yaml with
properties:
not-null-property:

Can you please test and confirm?

I'm using the latest plugin version 3.2.2.

Example for: Placeholder and reference resolution order

  • Document case when required dependencies have properties and parameters which of them are visible in the consumer 
  • Document case when MTA reference point to parameter of the same module, if it is visible
  • Document case when MTA reference point to property of the same module, if it is visible
  • Document restrictions when read-only parameters default-xxx are used in combination with host, domain

Example for: Parameters & properties, overwriting and extension descriptor resolution chain

features docs:

The tutorial should feature how extension descriptors can be chained, the rules/order of overwriting values. The parameters-metadata features for controlling overwriting (optional/overwritable) should be featured.

Example: Content deployment - Invalid webapps in content.zip

It seems that all web apps in https://github.com/SAP-samples/cf-mta-examples/tree/master/content-deployment/content specify destinations in the xs-app.json file. If these destinations are not set up, the webapps cannot be used as the approuter will throw an exception.

So the sample is ok if it should only be used to demonstrate the cf deploy ./ but it's not suited to show how to use the html5 app repo.

My ask would be to remove the destinations from the xs-app.json files

Example for: consuming a single service instance in multiple MTA deployments in a single space

In some specific scenarios such capabilities are required:

  • e.g. in development a single (and costly) service instance may need to be shared by multiple apps consuming it for the purpose of testing
  • in production, when defined by architecture, a few MTA solutions are sharing consumption of a service instance but have otherwise independent lifecycle

In MTA modelling one can achieve this by:
A: ignoring the validations for ownership: each MTA's operations would "manage" (create/update/...) the service instance
B: Determining a single MTA to own the service instance, and all others would expect it to be already existing when deployed

blue-green strategy does not keep existing service bindings

Hello,

I tried blue-green deployment strategy with

modules:
  - name: myName
    parameters:
      keep-existing:
        service-bindings: true

but service bindings were not transferred to the new "-idle" instance of the app.

When I try the same without "blue-green" strategy the existing, manually created service bindings are unbound and rebound as expected.

Example for development flow - deploying a small code change of an MTA module in development

this example should feature initial environment configuration with 'cf deploy' & consequent app updates with cf push --no-manifest -p <path to built app bits>

Consider splitting this topic to multiple examples in which the build is orhcestrated:

  • with mbt
    Showcase partial mbt module build+ mtad.yaml generation; partial deploy along with cf push;
  • with standard tooling (maven/grunt/gradle/..)
    Showcase deploy from directory cf deploy ./ along with cf push

How to set parameter to update credentails for a service

Hi Team,

This is more of a question.

I want to know, how can I use the parameters to update service credentials.

UseCase:
There are a few services for which when we deploy using the mta.yaml, the credentials gets updated eg: Object Store, Credential Store Service on BTP.
I want to have the same behavior for the Hana service as well.
Basically on every deployment, it should update the schema password.

Hence I wanted to know, is there an option to do this using some parameter?

Thanks,
Nitin

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.