Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Application Starter: the entry point for your application

133 vues

Publié le

by Ines Sosa

  • Identifiez-vous pour voir les commentaires

  • Soyez le premier à aimer ceci

Application Starter: the entry point for your application

  1. 1. Application Starter The entrypoint for your application ba-st/ApplicationStarter
  2. 2. Hello! I am Inés Sosa I will present a talk because Julián Maestri was afraid. He sent a little girl instead. 2
  3. 3. What does it do? What is it? It’s a tool that provides facilities to start applications in from the command line. ◎ Parameter management ◎ Simple logging ◎ Startup error handling (Fuel) It’s especially useful in applications deployed with 3
  4. 4. Why/how does it help? ◎ Docker containers are ephemeral ◎ Not access to the running image to examine it ◎ Modifying configuration in a container can be annoying or complex 4
  5. 5. 1. How to use it 5
  6. 6. Defining the handler Load ApplicationStarter from ba-st/ApplicationStarter Subclass ApplicationStarterCommandLineHandler. Then define: 6 Class Side Instance Side #commandName #configurationDefinitions #description #basicActivate #logPrefix
  7. 7. #commandName (Class Side) Used to activate this handler from the command line. commandName ^ 'smalltalks2019' 7 ./pharo-ui Pharo.image smalltalks2019 --port=8080 ./pharo Pharo.image --list Currently installed Command Line Handlers: smalltalks2019 Example Command line handler for Smalltalks 2019, HI!
  8. 8. #description (Class Side) Describes the handler when using ./pharo <image> --list 8 ./pharo Pharo.image --list Currently installed Command Line Handlers: smalltalks2019 Example Command line handler for Smalltalks 2019, HI!
  9. 9. A string to prepend to the logs and fuel files. #logPrefix (Class Side) 9 Smalltalks 2019 Example-2019-11-08T002050.log Smalltalks 2019 Example-2019-11-08T002417.fuel
  10. 10. #configurationDefinitions (Instance Side) A collection of arguments available to the command line handler. These are logged to console when the application starts, and are accessible under self configuration on the command line handler. The arguments can be: Mandatory, Optional or Flags 10
  11. 11. #configurationDefinitions (Instance Side) 11
  12. 12. #basicActivate (Instance Side) Contains the logic to actually start your application. It should use the parameters defined in the configurationDefinitions to start the application. 12
  13. 13. 2. Example 13
  14. 14. Defining only mandatory parameters 14 ./pharo Pharo.image smalltalks2019 --port=8080 [WARNING] format option not provided. Defaulting to 'text/plain' [INFO] format: text/plain [INFO] port: 8080
  15. 15. Without mandatory arguments 15 ./pharo Pharo.image smalltalks2019 [ERROR] port option not provided. You must provide one. port option not present
  16. 16. With all arguments 16 ./pharo Pharo.image smalltalks2019 --port=8080 --format=text/html [INFO] format: text/html [INFO] port: 8080
  17. 17. 3. @ GitHub 17 ba-st/ApplicationStarter (MIT License)
  18. 18. 4. Demo with Docker 18
  19. 19. 5. Future Work 19
  20. 20. ◎ Graceful termination ◎ Use to CLAP ◎ Configuration from Environment Variables ◎ Support for sensitive parameters (passwords) ◎ Improved Logging Future Work 20
  21. 21. Thanks! Any questions? 21 i.sosa@mercapsoftware.com j.maestri@mercapsoftware.com InesSosa95 serpi90 ba-st/ApplicationStarter

×