Skip to content

Conversation

v1v
Copy link
Member

@v1v v1v commented Oct 17, 2022

What

Ensure the lambda is always pointing to the version 1.

Why

Version and releases will be predictable.

Further details

@AlexanderWert provided some feedback in the past:

One think that I observed is, that it would be nice and less confusion for the users if all the Layers we are publishing would always have version 1 as the layer version. (Sometimes it's not, when something fails and we retrigger publishing).
Do you think we could add a layer deletion step (if a layer with a certain name already exists) before we do the publishing? In this way we could guarantee that the layer ARNs always have the suffix / version 1
I think this would improve experience a lot, since we then won't need to link to the GitHub table but could provide a generic pattern and maybe even writing a small HTML / Javascript tool embedded in the docs to pick the right ARNhis will ensure the version is always 1 per release

Test

  • Verify it works as expected

Use case: delete-in-all-aws-regions doesn't fail when no versions available

$ AWS_SECRET_ACCESS_KEY="*" \
AWS_ACCESS_KEY_ID="*" \
ELASTIC_LAYER_NAME=v1v-lambda-test-0-0-1 \
BRANCH_NAME=duplicated-entries \
make  delete-in-all-aws-regions                       

delete 'v1v-lambda-test-0-0-1-x86_64' in af-south-1
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-north-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-south-1
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-west-3
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-west-2
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-south-1
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-west-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-northeast-3
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-northeast-2
delete 'v1v-lambda-test-0-0-1-x86_64' in me-south-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-northeast-1
delete 'v1v-lambda-test-0-0-1-x86_64' in sa-east-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ca-central-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-east-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-southeast-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-southeast-2
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-southeast-3
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-central-1
delete 'v1v-lambda-test-0-0-1-x86_64' in us-east-1
delete 'v1v-lambda-test-0-0-1-x86_64' in us-east-2
delete 'v1v-lambda-test-0-0-1-x86_64' in us-west-1
delete 'v1v-lambda-test-0-0-1-x86_64' in us-west-2
$ echo $?
0

Use case: delete-in-all-aws-regions deletes all the previous versions

$ AWS_SECRET_ACCESS_KEY="*****" \
AWS_ACCESS_KEY_ID="******" \
ELASTIC_LAYER_NAME=v1v-lambda-test-0-0-1 \
BRANCH_NAME=duplicated-entries \
make  delete-in-all-aws-regions                       

delete 'v1v-lambda-test-0-0-1-x86_64' in af-south-1
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-north-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-south-1
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-west-3
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-west-2
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-south-1
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-west-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-northeast-3
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-northeast-2
delete 'v1v-lambda-test-0-0-1-x86_64' in me-south-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-northeast-1
delete 'v1v-lambda-test-0-0-1-x86_64' in sa-east-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ca-central-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-east-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-southeast-1
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-southeast-2
delete 'v1v-lambda-test-0-0-1-x86_64' in ap-southeast-3
delete 'v1v-lambda-test-0-0-1-x86_64' in eu-central-1
delete 'v1v-lambda-test-0-0-1-x86_64' in us-east-1
delete 'v1v-lambda-test-0-0-1-x86_64' in us-east-2
delete 'v1v-lambda-test-0-0-1-x86_64' in us-west-1
delete 'v1v-lambda-test-0-0-1-x86_64' in us-west-2
$ echo $?
0
...

this will ensure the version is always 1 per release

release are coming from tag releases

tag releases are immutable
@github-actions github-actions bot added the aws-λ-extension AWS Lambda Extension label Oct 17, 2022
@ghost
Copy link

ghost commented Oct 17, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-10-17T12:45:56.311+0000

  • Duration: 8 min 50 sec

Test stats 🧪

Test Results
Failed 0
Passed 164
Skipped 2
Total 166

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@v1v v1v marked this pull request as ready for review October 17, 2022 12:45
@v1v v1v requested review from a team and AlexanderWert October 17, 2022 12:46
@v1v v1v added the Team:Automation Label for the Observability productivity team label Oct 17, 2022
@v1v v1v merged commit 0bc20ee into elastic:main Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws-λ-extension AWS Lambda Extension Team:Automation Label for the Observability productivity team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants