question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cleanly separate Packaging and Deployment phases

See original GitHub issue

Use case description

Derived from https://github.com/serverless/serverless/issues/8364 which was narrowed down to other processing flow improvements refactor

Currently internal flow of processing commands is convoluted and confusing in many places. In result there’s a dependency between parts for which there is no reason to depend on each other (e.g. we cannot do sls deploy --package outside of service context, while after all outcome doesn’t depend in any way on the current working directory context).

Additionally we should cleanly separate Packing and Deployment phase, taking into account case reported at https://github.com/serverless/serverless/issues/3528 where’s there’s reported need for builds that can be reused for any stage or region.

Ideally internal handling should be as follows

  1. Packaging step, should package binaries and store resolved state of service configuration, but we should not generate CloudFormation template to be deployed at that stage.
  2. Deployment should consist of:
    1. Generation of ready to deploy CloudFormation template
    2. Upload artifacts
    3. Deployment of CloudFormation stack

In this context it’ll be good to also address https://github.com/serverless/serverless/issues/2202 (provide a mean to run sls remove --name <service-name> outside of service context

Proposed solution

TBA

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:15
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
nponeccopcommented, Feb 11, 2022

I understand that currently variable resolution step is performed during sls package, so essentially Serverless generates a dynamic CloudFormation file based on the SSM data during the packaging phase.

My idea is to change the process so that packaging and name resolution are separated. So as long as my project build artefacts don’t depend on data stored at SSM, there is no need to connect. The variable resolution, CloudFormation generation etc are only performed during the deployment step.

A more important change is to make the plugin architecture aware of this phase separation, so that plugins authors plan accordingly what is permitted at what stage. Some plugins may choose to work offline, some during deployment, and some both.

1reaction
medikoocommented, Nov 2, 2021

Thanks @ankon for the input. That’s a very good point. I believe we should keep ability to generate the final CF template without deploying, and/or allowing to hook in a process after the template is generated but before deployment is initialized

Read more comments on GitHub >

github_iconTop Results From Across the Web

PACKAGING AND DEPLOYMENT STRATEGIES IN AN ... - IBM
It is expected that a package will be deployed to several execution environments. Each of them being used for different testing phases.
Read more >
Introduction to the Build Lifecycle - Apache Maven
There are three built-in build lifecycles: default, clean and site. The default lifecycle handles your project deployment, the clean lifecycle ...
Read more >
Deploying Spring Boot Applications
Spring Boot's flexible packaging options provide a great deal of choice when it comes to deploying your application. You can deploy Spring ...
Read more >
Process of Building up an Application Packaging
By streamlining software install, uninstall, patching, upgrading and repairing, application packaging can help reduce costs associated with each phase of the ...
Read more >
Packaging and deploying a Red Hat Process Automation ...
This document describes how to package and deploy a project in Red Hat Process ... You cannot move a Process Server into a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found