Contenu connexe
Similaire à Re-Platforming Legacy .Net Applications to PCF Using Modernized Techniques (20)
Plus de VMware Tanzu (20)
Re-Platforming Legacy .Net Applications to PCF Using Modernized Techniques
- 1. Replatforming Legacy .NET Applications
to PCF Using modernized (Steeltoe)
techniques
Alfus Inigo Jaganathan
Advisory Solutions Architect
Pivotal
Poornima Varadhan
Global Engagement Lead
Cognizant
By -
- 2. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Disclaimer
- 3. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Safe Harbor Statement
The following is intended to outline the general direction of Pivotal's offerings. It is intended for information
purposes only and may not be incorporated into any contract. Any information regarding pre-release of Pivotal
offerings, future updates or other planned modifications is subject to ongoing evaluation by Pivotal and is
subject to change. This information is provided without warranty or any kind, express or implied, and is not a
commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing
decisions regarding Pivotal's offerings. These purchasing decisions should only be based on features currently
available. The development, release, and timing of any features or functionality described for Pivotal's offerings
in this presentation remain at the sole discretion of Pivotal. Pivotal has no obligation to update forward looking
information in this presentation.
- 4. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Agenda
- 5. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
What to expect in the next 30 mins?
• Quick introduction to PCF & Steeltoe
• Understanding 15 Factors, run through the relevant ones for this talk
• Migration Patterns, a high level overview
• Replatforming in detail with code snippets
• Demo the Replatformed .NET Webform app to PCF
• Pivotal AppTx and Tools
• Partner talk on "Partner & Accelerate to operate at scale” - Cognizant
- 6. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Pivotal Cloud Foundry
- 7. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
PCF – A modern cloud native platform
• Supports multi-languages -
buildpacks
• Supports Hybrid Cloud (On-Prem
& public)
• Supports Multi Cloud (IaaS –
Azure, AWS, GCP, etc.) -
Portability
• 4 Levels of HA
• Zero downtime deployment
support
• Elastic scalability
• Developer focus on delivering
business value
• Reduce Operations/DevOps cost
- 8. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Steeltoe.io
- 9. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Steeltoe.io for .NET developers
9
• Open source
• Industry standard best practices building microservices
• Available as .NET Standard NuGet libraries
• Supports .NET Core and Full Framework
• Helps leveraging
• Netflix Eureka (Service Discovery)
• Hystrix (Circuit Breaker)
• Spring Cloud Config Server
• Cloud Connectors
• Cloud Security Providers
• Monitoring and Management
• What's new in 2.1
• Additional Spring boot compatible endpoints
• Out-of-the-box Health contributors
• Application Metrics
• Distributed Tracing
• Additional .NET 4.x support
- 10. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
15 Factors
- 11. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
15 FACTOR PCF Steeltoe
1
One codebase,
one application
• Single codebase
• Any number of immutable releases
N/A N/A
2 API first
• Contract first development
• Server mocks (e.g. Apiary)
N/A N/A
3
Dependency
management
• Isolate dependencies as NuGet packages
• Bundle dependencies together with build artifacts
• Self Contained
• Buildpacks N/A
4
Design, build,
release, and run
• CI/CD Pipeline
• Iterative
• Zero downtime
• Integration with Concourse,
Jenkins, etc.
• Blue-Green & Canary deploy
N/A
5
Configuration,
credentials, and
code
• Code - Single artifact for multi environment
• Externalize configuration and credentials
• Treat configuration as ENV variables
• ENV variables
• User Provided Services
• Structured ENV variables from
bounded services
• Config Server (Git & Vault)
• .NET
Configuration
Extensions NuGet
packages
Understanding 15 Factors (Ref: https://content.pivotal.io/blog/beyond-the-twelve-factor-app)
- 12. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
15 FACTOR PCF Steeltoe
6 Logs
• Treat as event streams
• Sequence of time-ordered emitted events
• STDOUT and STDERR
• Loggregator-Firehose (cf logs)
• CF Syslog Drain – stream to external
aggregation/analytics service
• Apps Manager
• Dynamic Logging
• Management – Actuators
(Integration with Apps
Manager)
7 Disposability
• Maximize Robustness
• Fast startup & Graceful shutdown
• Externalize using backing services (e.g. Cache)
• High Availability (Health
Management of App Instances)
• Maintain capacity
• Management – Health
Contributors
8
Backing
Services
• Treat as attached resources.
• Loose coupling, flexibility
• E.g. data store, caching, etc.
• Market Place services (Redis, Rabbit,
MySql, etc.)
• Circuit Breaker as MP service
• Open Service Brokers
• cf bind-service, cf unbind-service
• Implementation of Netflix
Hystrix (Circuit breaker,
Netflix Eureka (Service
Discovery)
• Connectors
9
Environment
Parity
• Keep all environments including development
as similar as possible
• Application “will work everywhere”
• Every commit, a deployment candidate
• PCF Dev
• Similar experience to developers
• Logical separation called ‘Spaces’,
on single foundation
N/A
10
Administrative
Processes
• Run admin/management tasks as one-off,
scheduled processes • CF Tasks and Task scheduler N/A
Understanding 15 Factors (Ref: https://content.pivotal.io/blog/beyond-the-twelve-factor-app)
- 13. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
15 FACTOR PCF Steeltoe
11 Port Binding
• Avoid micromanaging port assignments
• Allow externalized runtime port binding
• 1 : 1 (App instance : App
Server)
• PCF GoRouter routes to App
instances
N/A
12
Stateless
Processes
• All long-lasting state to be externalized using
backing services (e.g. session)
• Share-Nothing (containers are highly disposable)
• Externalize data caching
• MP services like Gemfire,
Redis, etc.
• File System as service
• Connectors as NuGet
packages
• Seamless integration
with backing services
13 Concurrency
• Scale out horizontally rather than vertical scaling
• Should be able to run multiple concurrent instances
• Elastic scaling made easy
• Auto scaler (scale by demand
automatically)
• cf scale
N/A
14 Telemetry
• Application Performance Monitoring(APM) –
Wellness
• Domain specific telemetry– Analytics & Reporting
• Health & System logs – Stream of events
• PCF Metrics
• cf events & cf logs
• Syslog Drains and Nozzles
• Management/Actuators
• Apps Manager
15
Authentication
& Authorization
• Security should be never be an after thought
• Should be backed in from day one
• UAA Server
• Pivotal Single Sign-on
• CredHub
• Platform provided security,
firewalls, etc.
• Security provider
packages for seamless
integration with security
providers
Understanding 15 Factors (Ref: https://content.pivotal.io/blog/beyond-the-twelve-factor-app)
- 14. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Migration Patterns
- 15. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Migration Patterns
15
• Replatforming to start
with…
• Start small
• Less cost involved
• Faster time to value
• In longer term, based on
business value/criticality
of the app, move towards
modernization
- 16. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Replatforming
- 17. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Replatforming
17
• Minimal Efforts
• Less cost
• Sometimes called Lift & Shift
• Run natively in PAS (Pivotal Application
Service)
• Cloud Ready/Friendly
• Critical 12/15 factors
• Configuration, Credentials & Code
• Logs
• Stateless Processes
• Concurrency
• Dependency Management
• Port binding
• Authentication & Authorization
• One Codebase One Application*
• Build, Release and Run*
* Recommended, but not critical
- 18. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
.NET Apps – PCF Readiness
18
• High level .NET to PCF
• 4 categories
• *Out of scope includes
• Apps being retired within
6-12 months
• Vendor/3rd party apps
• Databases
• Reporting/BI Front end
apps
- 19. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Replatforming (Steps)
19
• Create and move to a separate repository (15F - One Codebase One
Application)
• Upgrade to latest .NET framework preferably 4.6.1 or above
• Helps leveraging .NET Standard libraries like Steeltoe.io
• Build CI-CD pipeline (15F – Design, Build, Release and Run)
• Bring all the dependencies (Registry, GAC, 3rd party) to Bin, with the
publish artifacts (15F – Dependency Management)
- 20. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Replatforming (Steps)
20
• Remove any code that micromanages the port, let the platform take
care of port binding (15F – Port Binding)
• Verify if application access any File system. In that case, modify the
code to access either s3 object storages or NoSQL database or Pivotal
volume services. (15F – Disposability)
• Make use of Steeltoe.io libraries and other techniques (following
slides) to implement remaining of critical factors one by one
- 21. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Leveraging Steeltoe.io
21
• Prerequisite: framework must be updated to 4.6.1 or above
• 3 types of packages (Samples https://github.com/SteeltoeOSS/Samples)
• Autofac - Autofac dependency injection (e.g. Steeltoe.Extensions.Configuration.CloudFoundryAutofac)
• Base - No dependency injection (e.g. Steeltoe.Extensions.Configuration.CloudFoundryBase)
• Core - ASP.NET Core dependency injection (e.g. Steeltoe.Extensions.Configuration.CloudFoundryCore)
• Here we use Core package for the demo and sample, with a simple
technique using Generic Host Builder
• Add appSettings.json, to have a .NET Core kind of…
- 22. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Leveraging Steeltoe using Generic Host Builder
22
• CoreServiceConfig.cs under App_Start
• Packages used
o Microsoft.AspNetCore.Hosting
o Microsoft.Extensions.DependencyInjection
o Microsoft.Extensions.Logging
• CoreServiceConfig.Register() from
Global.ascx.cs, entry point of the
application
Ask the container for injected services from
anywhere in the application
- 23. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Configuration (15F - Configuration, Credentials and Code)
23
• Packages
o Steeltoe.Extensions.Configuration.CloudFoundryCore
(User-Provided-Services & Bounded Services)
o Pivotal.Extensions. Configuration.ConfigServerBase
(Config Server)
• Config Server backed by vault and git (vault for
secrets and credentials & git for non-sensitive
configuration
o Recipe ref: https://dotnet-cookbook.cfapps.io/config/config-
server-vault-git-dotnet-core/
• Bounded services
configuration and User-
Provided services can be
pulled via
• Structured ENV variable
• CloudFoundryServicesOptions, a
JSON representation of
VCAP_SERVICES configuration
- 24. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Configuration (15F - Configuration, Credentials and Code)
As an example, Connect to SQL Server using Steeltoe connector
24
• Package(s)
Steeltoe.CloudFoundry.ConnectorCore
• This includes base and almost all connectors.
Alternatively you can use specific connector packages
like Steeltoe.CloudFoundry.Connector.SqlServer
- 25. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Externalize Session (15F – Backing Services & 15F – Concurrency)
As an example, Redis as the persistent store
25
Additional reference: https://dotnet-cookbook.cfapps.io/aspnet/redis-
session-full-framework/
- 26. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Externalize Caching (15F – Backing Services & 15F – Concurrency)
As an example, Connect to Redis using Steeltoe connector
26
- 27. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Logging (15F – Logs)
27
• STDOUT/STDERR
• Simply write à
Console.{Out/Error}.WriteLine(“Something…”);
• If using 3r party like log4net, Nlog, etc., modify
their Appender config to type “Console”
• Replace with Microsoft.Extensions.Logging
Ilogger, but a bit more of a work
• Enhance using Steeltoe’s dynamic logging
feature, lets you change the log levels without
restarting the application (next slide)
Ref: https://steeltoe.io/docs/steeltoe-logging/
- 28. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Enable Steeltoe Management Actuators
Health Contributors, Dynamic Logging and much more… (https://steeltoe.io/docs/steeltoe-management/)
28
In Global.ascx, call out as below to activate
the actuators
appSettings.json should
have this configuration
- 29. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Security (15F – Authentication and Authorization)
29
• Straight forward, if using Forms Authentication
• Windows Authentication
• Not-supported, so use Pivotal Single Sign-on or UAA or similar Identity providers
• Leverage Steeltoe middleware and OWIN request pipeline to integrate with any identity
provider supporting OAuth & OpenID Connect
• Package Steeltoe.Security.Authentication.CloudFoundryOwin
• Ref: https://steeltoe.io/docs/steeltoe-security/ & https://github.com/SteeltoeOSS/Samples/tree/dev/Security
• Optionally, you can create your own HttpModule which can intercept on
HttpContext.AuthenticateRequest, set httpApplication.Context.User from newly generated
GenericPrincipal using JWT, etc.
- 30. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
.NET Apps - Buildpacks
30
• Buildpacks-
• Provides framework and
runtime support
• Determines, what
dependencies to download
• Configures the apps so as to
communicate with bound
services
Learn more about buildpacks? https://pivotal.io/platform/pcf-components/buildpacks
- 31. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Demo – Replatformed App (with
Steeltoe Actuators) in PCF
Recording link https://1drv.ms/v/s!AhnjuwdpuapykJI7M_KFmmgwlezG7A
- 32. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Pivotal AppTx & Tools
- 33. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Pivotal Application Transformation Team (AppTx)
https://pivotal.io/application-transformation
33
Who we are?
ü Team of Solutions Architects and
Strategists
ü Jump start App Tx to quickly show
measured wins
ü Simple tools, Start small & Scale fast
ü Redefine current systems to achieve cloud
native speed, resiliency and economics
What we believe?
ü Should move Apps to PCF
ü Plan just enough to start
ü Define hard goals and measure them
ü Automate everything you can
ü Build skills by pairing and doing
ü Let real work inform strategy
- 34. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Pivotal Tools (Get Started, Measure Incremental, Learn as You Do)
https://www.youtube.com/watch?v=neL3OQ1GRhY
34
- 35. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Partner Talk
https://www.cognizant.com/cognizant-digital-business/digital-engineering-services
- 36. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Partner & Accelerate to operate at scale
• Deeper domain knowledge
• Deeper services knowledge
• Application expertise/ Digital Engineering skills
36
+
enabling clients to accelerate their digital transformation journey with rapid application
portfolio migration and cloud-native development at scale.
• Market leading s/w development methodology
• Technology & Tool offerings
• Cloud Native Innovation
• App Tx & Labs
- 37. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Scale better yet be more sustainable - How we do it?
PEOPLE
• Talent pool of 1/5 of workforce skilled as engineers and Full Stack developers.
• Put the right work in the right place at the right cost for scale
o Working with customers on premise alongside with Pivotal as needed
o Leveraging Cognizant Labs
o Operating in On/off model as appropriate.
• Training - PAL , T skilled
PROCESS
• Adoption of Product-engineering principles to build or modernize S/W -(Lean Engineering , XP , Build
test and learn methodologies etc.)
TECHNOLOGY
• Empower Engineering and Product Development teams with Tools and accelerators (like VSM) to
automate the tasks / processes. - VSM : Evaluates application code to identify changes needed (like
antipatterns etc.) to help determine the type of remediation needed.
- 38. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Driving change & adoption - Top Challenges
38
• Inadequately equipped from a skill, culture, mindset, inclination, and talent perspective -
Increasing education, skill building, and drive culture change
• Top-down communication is a gap in ensuring teams are aware, coordinated, & are able to
actively support digital change efforts at each level of the organization - Addressing missed
leadership communications opportunities
• Buy-in with Stake-holders for adoption of newer application delivery model - discussing
adequately with Business / IT customer teams on the need for right agile practices for right
work
• Operating with the old measures , metrics & governance – stressing the importance to
Redefine / Revamp the tools , processes , automation & metrics
- 39. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
In summary, transformation journey’s continued success is on…
• How quickly enterprise embrace change , drive culture shift and be agile
• Learning & Sharing among Digital leaders
• How to do it @scale repeatably and sustainably.
Jeff Bezos - Amazon Founder
In today's era of Volatility , there is no other way but to re-invent ,
the only sustainable advantage you can have over others is AGILITY ,
that's it. Because nothing else is sustainable , everything else you create ,
somebody else will replicate