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: automate regular SAR #758

Merged
merged 10 commits into from
Sep 11, 2024
Merged

Conversation

v1v
Copy link
Member

@v1v v1v commented Aug 6, 2024

What does this PR do?

  • Enable the release automation to run the deployments to the regular SAR by using .internal/aws/scripts/dist.sh
  • It uses the trusted OIDC to AWS.
  • It uses aws-actions/setup-sam to install SAM cli in the worker.

Why is it important?

Remove the manual step to deploy in `elastic-observability-prod

Follow-ups

To support GovCloud - However, AFAIK we don't admin that AWS account and we are using OIDC/Keyless for simplicity.

Questions

  • Configure the parameters for internal/aws/scripts/dist.sh
  • Test - I plan to use the elastic-observability AWS account to validate if this works in my forked repository.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.md

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Part of #279

Use cases

Screenshots

Logs

@v1v v1v mentioned this pull request Aug 6, 2024
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.release.outputs.tag }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid surprises and use the tag that has been created earlier

@v1v v1v requested a review from constanca-m August 27, 2024 16:11
@v1v v1v self-assigned this Aug 27, 2024
@v1v v1v marked this pull request as ready for review August 27, 2024 16:11
@v1v v1v requested review from a team and zmoog August 27, 2024 16:11
.github/workflows/release.yml Outdated Show resolved Hide resolved
sha: context.sha
})

regular-sar:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run this job only if there is a new tag and in a separate job so we can see if things work as expected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this.

We also only upload dependencies to the bucket when this workflow succeeds:

on:
workflow_run:
workflows: [release]
types:
- completed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, there is a corner case in

and it could use a wrong version if 2 or more commits happened in a row in share/version.py while upload-dependencies.yml has not been executed yet.

We can do a follow-up and see if that's a genuine reason

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you. There is also another problem: if a commit happens and the tag is not updated (so no version upgrade). I don't see why a commit would not cause a version upgrade, but we do not check that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

.github/workflows/release.yml Outdated Show resolved Hide resolved

- name: Build and package
run: |
.internal/aws/scripts/dist.sh \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It runs the same command in #279 (comment)

reakaleek
reakaleek previously approved these changes Aug 27, 2024
.github/workflows/release.yml Outdated Show resolved Hide resolved
reakaleek
reakaleek previously approved these changes Aug 28, 2024
kaiyan-sheng
kaiyan-sheng previously approved these changes Sep 9, 2024
.github/workflows/release.yml Outdated Show resolved Hide resolved
@v1v v1v dismissed stale reviews from kaiyan-sheng and reakaleek via ad43b31 September 11, 2024 07:15
@v1v v1v requested a review from reakaleek September 11, 2024 07:16
@v1v v1v merged commit e0323b6 into elastic:main Sep 11, 2024
4 checks passed
@v1v v1v deleted the feature/support-sar-automation branch September 11, 2024 07:44
@zmoog
Copy link
Contributor

zmoog commented Sep 23, 2024

@v1v, we tried to release 1.17.1, but the release workflow failed. Can you help me understand what's going wrong? 🙇

@v1v
Copy link
Member Author

v1v commented Sep 23, 2024

Notice: Latest version is 1.17.0.
Notice: Current version is 1.17.1.
/home/runner/work/_temp/cc8c3fc9-[91](https://github.com/elastic/elastic-serverless-forwarder/actions/runs/10997750457/job/30535666467#step:4:92)c5-4f06-b7c2-fa7795ebfb06.sh: line 32: unexpected EOF while looking for matching `"'

I think

echo "enabled=${CREATE_TAG}"" >> "$GITHUB_OUTPUT"
. there is an extra "

#805 should help

@zmoog
Copy link
Contributor

zmoog commented Sep 23, 2024

Yeah! You've been faster than me! Closing https://github.com/elastic/elastic-serverless-forwarder/pull/806/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants