Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.33.0 #1583

Merged
merged 45 commits into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ba348f5
Deploy off aws cli (#1455)
sriram-mv Nov 13, 2019
250941c
design: samconfig (#1503)
sriram-mv Nov 13, 2019
c7fffc4
feat: configuration file for sam cli commands (#1502)
sriram-mv Nov 15, 2019
5854f2a
design: `sam deploy` also packages built artifacts (#1521)
sriram-mv Nov 15, 2019
0451b59
Package and deploy in one command (#1532)
sriram-mv Nov 15, 2019
036b41b
Managed S3 Bucket via optional bootstrap command (#1526)
awood45 Nov 15, 2019
31c7d35
Colors for deploy (#1535)
sriram-mv Nov 15, 2019
f0edb60
fix: deploy error on not supplying s3 bucket (#1534)
sriram-mv Nov 15, 2019
9940d27
fix: override botocore logging to a NullHandler (#1538)
jfuss Nov 15, 2019
f20fde5
Guided deployment when flag is specified
sanathkr Nov 15, 2019
0f19612
fixing linter
sanathkr Nov 15, 2019
9b4e6b7
feat: save params to config file on interactive deploy
sanathkr Nov 15, 2019
162e57e
fixing unit tests
sanathkr Nov 15, 2019
15c50d6
fix: pass `--confirm-changeset` through to deploy command
sriram-mv Nov 18, 2019
389face
ux: improvements on sam deploy --interactive
sriram-mv Nov 19, 2019
02ea704
fix: `samconfig.get_all`
sriram-mv Nov 19, 2019
8a1d190
feat: allow `--interactive` to ask for parameters
sriram-mv Nov 19, 2019
66d4e34
fix: interactive deploy specifies parameter defaults
sriram-mv Nov 19, 2019
29374d5
fix: always use a managed stack on deploy interactive
sriram-mv Nov 20, 2019
cc8cf3b
fix: smoke tests for deploy
sriram-mv Nov 20, 2019
8af8817
fix: usability fixes on deploy --guided (#1555)
sriram-mv Nov 20, 2019
23d60be
fix: stack outputs on deploy (#1556)
sriram-mv Nov 20, 2019
dc1d10c
Guided Deploy UX Improvements (#1554)
awood45 Nov 20, 2019
2e41981
fix: always showcase deploy args (#1557)
sriram-mv Nov 20, 2019
1d1e9d6
fix: parameter override prompts during guided deploy (#1558)
sriram-mv Nov 20, 2019
72f740e
fix: only create config file on write (#1559)
sriram-mv Nov 20, 2019
642f29d
fix: usability fixes on deploy error with no s3 bucket (#1561)
sriram-mv Nov 20, 2019
9d64966
Add Exception Handling for Client Misconfiguration (#1560)
awood45 Nov 20, 2019
b58ceaa
fix: helpful error message when deploy happens across regions (#1562)
sriram-mv Nov 21, 2019
6a9ba71
tests: integration tests for `sam deploy` (#1565)
sriram-mv Nov 21, 2019
4309668
Reduce guided output (#1563)
awood45 Nov 21, 2019
22fe0ce
bugfixes: `stack-name` is required on deploy (#1573)
sriram-mv Nov 22, 2019
f2272d9
feat: s3 bucket versioning - managed stack (#1579)
sriram-mv Nov 22, 2019
4be8158
Tests for samconfig use with all commands (#1575)
sanathkr Nov 22, 2019
26ad24e
fix: add version to `samconfig.toml` file (#1581)
sriram-mv Nov 23, 2019
b7dfd3f
feat: Init README Deploy Updates (#1580)
awood45 Nov 23, 2019
92a6a00
chore: release v0.33.0 (#1582)
sriram-mv Nov 23, 2019
65dd732
fix: move the sleep before applying bucket policy (#1584)
sriram-mv Nov 23, 2019
0b9d5bd
fix: managed stack (#1585)
sriram-mv Nov 23, 2019
f7b7e55
tests: close tempfile before attempting to delete (#1586)
sriram-mv Nov 23, 2019
ee13133
integ tests: throttling with cloudformation (#1587)
sriram-mv Nov 23, 2019
33c9b7f
fix: samconfig.toml links in `sam deploy --guided` (#1588)
sriram-mv Nov 23, 2019
0431602
refactor: Use communicate with a timeout for build and invoke integ t…
jfuss Nov 23, 2019
f2e66d8
fix: move tests to a `static` bucket solution (#1589)
sriram-mv Nov 23, 2019
aec0809
refactor: move all process.wait to process.communicate (#1590)
jfuss Nov 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=R0201,W0613,I0021,I0020,W1618,W1619,R0902,R0903,W0231,W0611,R0913,W0703,C0330,R0204,I0011,R0904,C0301
disable=R0201,W0613,W0640,I0021,I0020,W1618,W1619,R0902,R0903,W0231,W0611,R0913,W0703,C0330,R0204,I0011,R0904,R0914,C0301


[REPORTS]
Expand Down
26 changes: 3 additions & 23 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,8 @@ for:
- "pylint --rcfile .pylintrc samcli"
# There are some functional tests that are currently broken due to not being updated with changed code or still running with node4.3 runtimes
# We need to update those but this allows us to at least runs the ones we currently have working
- "pytest tests/functional/commands/validate tests/functional/commands/cli/test_global_config.py"
- "pytest -n 4 tests/functional/commands/validate tests/functional/commands/cli/test_global_config.py"

# Runs only in Linux
- sh: "pytest -vv tests/integration"
- sh: "/tmp/black --check setup.py tests samcli scripts"
- sh: "python scripts/check-isolated-needs-update.py"

# Smoke tests run in parallel - it runs on both Linux & Windows
# Presence of the RUN_SMOKE envvar will run the smoke tests
# Note: temporarily removing as with current dependencies we require syslog on windows
# which is not present on stdlib.
# - ps: "If ($env:RUN_SMOKE) {pytest -n 4 -vv tests/smoke}"
-
matrix:
only:
Expand Down Expand Up @@ -128,11 +118,11 @@ for:
- "pylint --rcfile .pylintrc samcli"
# There are some functional tests that are currently broken due to not being updated with changed code or still running with node4.3 runtimes
# We need to update those but this allows us to at least runs the ones we currently have working
- "pytest tests/functional/commands/validate tests/functional/commands/cli/test_global_config.py"
- "pytest -n 4 tests/functional/commands/validate tests/functional/commands/cli/test_global_config.py"

# Runs only in Linux
- sh: "pytest -vv tests/integration"
- sh: "pytest -vv -n 4 tests/regression"
- sh: "pytest -vv tests/regression"
- sh: "/tmp/black --check setup.py tests samcli scripts"

# Set JAVA_HOME to java11
Expand All @@ -142,13 +132,3 @@ for:
# Smoke tests run in parallel - it runs on both Linux & Windows
# Presence of the RUN_SMOKE envvar will run the smoke tests
- ps: "If ($env:RUN_SMOKE) {pytest -n 4 -vv tests/smoke}"

-
matrix:
only:
- ONLY_SMOKE: 1

test_script:
# Smoke tests run in parallel
- sh: "venv/Scripts/activate"
- sh: "pytest -n 4 -vv tests/smoke"
178 changes: 178 additions & 0 deletions designs/package_during_deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
Package during `sam deploy`
====================================


What is the problem?
--------------------

Today while using `sam deploy` the specified `--template-file` or `--template` is expected to have packaged artifacts references in the given template file.

This is driven by the following workflow.

`sam build` -> `sam package --s3-bucket ... --s3-prefix ... --output-template-file packaged.yaml`.

This workflow builds the requisite code and packages those built artifacts into an s3 bucket, optionally under a given s3 prefix.

If a developer can optionally cut through this process without requiring an explicit `package` command, but rather have `sam deploy` package to a given s3 bucket, it cuts the number of steps before needing to deploy and test in the cloud.

This also reduces friction in the `author` and `test` loop.

Ideal end state.

`sam build` -> `sam deploy ..... --s3-bucket ....`


What will be changed?
---------------------

Addition of extra parameters that are currently supported by `sam package` over to `sam deploy` with all of them being optional.

Additional parameters that need to be on `sam deploy` that are not on `sam package`.

* `--metadata`
* `--use-json`

Parameters that dont need to be added.

* `--output-template-file`
* An explicit `output-template-file` is created on the fly during packaging in the deploy phase.

If the expectation is to package and deploy in one command, One can now do.

`sam deploy --stack-name sam-package-on-deploy --capabilities CAPABILITY_IAM --s3-bucket sam-package-bucket`

There is no explicit need to pass in a `--template-file` or `--template` parameter, if one is not passed in it to defaults to trying to find the template.yaml that was generated by `sam build` which is located at `.aws-sam/build/template.yaml`

The old method of deploying pre-packaged artifacts will continue to work as before.

* `sam deploy --template-file packaged.yaml --stack-name sam-package-on-deploy --capabilities CAPABILITY_IAM`

If a deployment is done without running `sam build` prior we still go ahead and deploy with the given `template.yaml` in the project root. This might still result in a successful deploy, but not a deploy with the correct build artifacts.


Future of `sam package`?
---------------------

* `sam package` will continue to exist in the state it is today and will continue to be improved upon separately.

Success criteria for the change
-------------------------------

User do not require to run `sam package` as part of their author test loop, except for CI/CD purposes, where `sam package` can be run and the packaged template file can be passed to cloudformation deploy actions.


Out-of-Scope
------------

The s3 bucket where the packaged artifacts go is not abstracted in this design. In the future, the s3 bucket could be specified via a configuration file.

This is currently in design in : https://github.com/awslabs/aws-sam-cli/pull/1503

User Experience Walkthrough
---------------------------

`sam build` -> `sam deploy`

`sam build` -> `sam package` -> `sam deploy`

Provide identical experiences in terms of a deploying the same stack, with exactly same artifacts.


Implementation
==============

CLI Changes
-----------

* Add new arguments `--metadata`, `--use-json` and modify existing `--template-file` or `--template` to look for a default `template.yaml` that exists under `.aws-sam/build/`

### Breaking Change

* Not a breaking change , but there are optional behavorial changes that a user can subscribe into by supplying a non-packaged template file and an s3 bucket.

Design
------

* Changes to Deploy command's click options
* Attempt to package on every deploy if an appropriate s3 bucket is specified and deploy using the output template file during package.
* If a pre-packaged template is specified, an attempt to package does not change the template and the same template is used for deploy.
* The parameters that share the same name across package and deploy are collapsed together. eg: `--kms-key-id` , if a kms-key-id is specified that same key is used across both packaging and deploy purposes.

`.samrc` Changes
----------------

None

Security
--------

**What new dependencies (libraries/cli) does this change require?**
N/A

**What other Docker container images are you using?**
N/A

**Are you creating a new HTTP endpoint? If so explain how it will be
created & used**
N/A

**Are you connecting to a remote API? If so explain how is this
connection secured**
N/A

**Are you reading/writing to a temporary folder? If so, what is this
used for and when do you clean up?**

Possibly reading from a configuration file in the future.

**How do you validate new .samrc configuration?**

N/A

What is your Testing Plan (QA)?
===============================

Goal
----
* Regression tests on previous functionality of `sam deploy`
* Integration tests on automatic packaging on `sam deploy`

Pre-requesites
--------------
N/A

Test Scenarios/Cases
--------------------
* Re-deploy a stack that was deployed with a packaged template before hand using the new sam deploy menthod.

`sam deploy --template-file packaged.yaml --stack-name sam-stack --capabilities CAPABILITY_IAM`

`sam deploy --stack-name sam-stack --capabilities CAPABILITY_IAM`

The new stack should not have any changes.


Expected Results
----------------

* Regresssion and Integration tests pass.

Documentation Changes
=====================
* Required nature of `--template-file`, `--template` parameter has a series of defaults that are looked at during `sam deploy` similair to `sam package`.
* If `--template-file` or `--template` points to a non-packaged template-file, `--s3-bucket` becomes required to be able to effectively package and deploy in one command using `sam deploy`.

Open Issues
============

Task Breakdown
==============

- \[x\] Send a Pull Request with this design document
- \[ \] Build the command line interface
- \[ \] Build the underlying library
- \[ \] Unit tests
- \[ \] Functional Tests
- \[ \] Integration tests
- \[ \] Run all tests on Windows
- \[ \] Update documentation
Loading