Skip to content

Conversation

@v1v
Copy link
Member

@v1v v1v commented Feb 7, 2022

What does this PR do?

  • Enable automation for the AWS lambda publishing.
  • Create ARN table with the details in each region.
  • Add two parameters:
    • whether to publish the AWS lambda, to support the old releases without lambda support.
    • build number for the release job where the AWS zip file is stored.

Follow ups

  • This PR is the very first attempt to support the automated publishing. We will merge it and test and if it works then:
    • re-enable the disabled steps
    • test a full release
  • Upload the aws-lambda zip file in the GiHub release, so far disabled but we can revisit
  • Publish the ARN details somewhere else rather than in the GitHub releases

Issues

Superseedes #2452

Test

image

@ghost
Copy link

ghost commented Feb 7, 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-03-21T18:39:23.766+0000

  • Duration: 46 min 38 sec

Test stats 🧪

Test Results
Failed 0
Passed 2490
Skipped 16
Total 2506

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

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

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark tests.

  • run jdk compatibility tests : Run the JDK Compatibility tests.

  • run integration tests : Run the Agent Integration tests.

  • run end-to-end tests : Run the APM-ITs.

  • run windows tests : Build & tests on windows.

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

@v1v v1v changed the title Feature/support arn automation within release pipeline ci: support arn automation within release pipeline Feb 7, 2022
}
steps {
setEnvVar('ELASTIC_LAYER_NAME', "elastic-apm-java${env.RELEASE_AWS_LAMBDA_VERSION}")
withAWSEnv(secret: 'secret/observability-team/ci/service-account/apm-aws-lambda', forceInstallation: true, version: '2.4.10') {
Copy link
Member Author

Choose a reason for hiding this comment

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

probably this requires the role_vault and so on....

env.RELEASE_ID = ret['id']
env.RELEASE_NOTES_URL = finalUrl
}
sh(label: 'make upload-lambda-asset', script: 'make -C .ci upload-lambda-asset')
Copy link
Member Author

Choose a reason for hiding this comment

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

this required to exclude if publish_aws_lambda is false

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't need this for this iteration

fingerprintArtifacts: true,
flatten: true,
projectName: 'elastic+apm-agent-java+release',
selector: lastSuccessful()
Copy link
Member Author

Choose a reason for hiding this comment

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

Enable the UI parameter to use in this selector.

selector: lastSuccessful()
)
sh(label: 'make publish-in-all-aws-regions', script: 'make -C .ci publish-in-all-aws-regions')
sh(label: 'make create-arn-file', script: 'make -C .ci create-arn-file')
Copy link
Member Author

Choose a reason for hiding this comment

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

Archive the file to see the look%feel

@v1v v1v marked this pull request as ready for review February 10, 2022 18:32
@v1v v1v requested review from a team February 10, 2022 18:32
@github-actions
Copy link

/test

@v1v v1v self-assigned this Feb 10, 2022
Co-authored-by: Alexander Wert <AlexanderWert@users.noreply.github.com>
Comment on lines 204 to 212
// NOTE: copy the file from the last successful build. Therefore, this is a hard requirement
copyArtifacts(
filter: "src/github.com/elastic/apm-agent-java/elastic-apm-agent/target/${SOURCE_AWS_FILE}",
target: 'elastic-apm-agent/target',
fingerprintArtifacts: true,
flatten: true,
projectName: 'elastic+apm-agent-java+release',
selector: specific(params.release_build)
)
Copy link
Member Author

Choose a reason for hiding this comment

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

image

Comment on lines +203 to +206
dir ('elastic-apm-agent/target') {
// TODO: copy file from a google bucket
sh(label: 'fetch AWS lambda file', script: "wget https://github.com/elastic/apm-agent-java/releases/download/v${RELEASE_VERSION}/${SOURCE_AWS_FILE} -O ${SOURCE_AWS_FILE}")
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This should be changed!

Copy link
Contributor

Choose a reason for hiding this comment

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

We agreed to manually provide the build number, but this can also work, no objection 🙂

Copy link
Member Author

Choose a reason for hiding this comment

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

We agreed to manually provide the build number

It does not work, unfortunately, the internal controller does not allow to copy artifacts between different jobs.

I think we are now forced to merge the release pipeline with the post-release one. I'll poke you in the internal issue that contains further detials

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines 20 to 21
RELEASE_AWS_LAMBDA_VERSION = '-ver-1-29-0'
RELEASE_VERSION = '1.29.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder - don't forget to remove when restoring all release steps

Comment on lines +203 to +206
dir ('elastic-apm-agent/target') {
// TODO: copy file from a google bucket
sh(label: 'fetch AWS lambda file', script: "wget https://github.com/elastic/apm-agent-java/releases/download/v${RELEASE_VERSION}/${SOURCE_AWS_FILE} -O ${SOURCE_AWS_FILE}")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We agreed to manually provide the build number, but this can also work, no objection 🙂

Co-authored-by: Alexander Wert <AlexanderWert@users.noreply.github.com>
@SylvainJuge SylvainJuge added the await-release Mark issues that depend on next release, or PRs that are planned to be included label Feb 21, 2022
echo "|${f}|${LAYER_VERSION_ARN}|" >> "${ARN_FILE}"
done

echo '' >> "${ARN_FILE}"
Copy link
Contributor

Choose a reason for hiding this comment

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

A trap here so this cleanup always runs, perhaps?

@v1v
Copy link
Member Author

v1v commented Mar 22, 2022

In order to test this we need to merge it, and these changes are not validated in the apm-ci as they are not executed as part of the main pipeline. I'll proceed and merge to be able to move forward with the release

@v1v v1v merged commit e09b6a8 into elastic:main Mar 22, 2022
@v1v v1v deleted the feature/support-arn-automation-within-release-pipeline branch March 22, 2022 10:09
@SylvainJuge SylvainJuge removed the await-release Mark issues that depend on next release, or PRs that are planned to be included label May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants