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

[CI] Package elastic agent job #38011

Merged
merged 44 commits into from
Mar 19, 2024
Merged

[CI] Package elastic agent job #38011

merged 44 commits into from
Mar 19, 2024

Conversation

pazone
Copy link
Contributor

@pazone pazone commented Feb 14, 2024

Proposed commit message

Externally triggered job for elastic-agent packaging and publishing

Our release team is going to trigger this job from their pipeline

Relates #2644

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 14, 2024
@mergify mergify bot assigned pazone Feb 14, 2024
@pazone pazone added the Team:Elastic-Agent Label for the Agent team label Feb 14, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 14, 2024
@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 14, 2024

💚 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: 2024-03-14T18:57:13.970+0000

  • Duration: 130 min 27 sec

Test stats 🧪

Test Results
Failed 0
Passed 20613
Skipped 1421
Total 22034

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@pazone pazone requested a review from a team as a code owner March 11, 2024 16:50
@pazone pazone requested review from AndersonQ and faec and removed request for a team March 11, 2024 16:50
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@pazone pazone requested review from belimawr and DaveSys911 and removed request for a team March 11, 2024 16:50
os.Setenv(snapshotEnv, "true")
mage.Snapshot = true
}
os.Setenv("BEAT_VERSION", parsedVersion.CoreVersion())
Copy link
Member

Choose a reason for hiding this comment

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

Why does the 7.17 branch need to set the version from a manifest file? Can't it always use the version in the branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean to hardcode 7.17?

Copy link
Member

Choose a reason for hiding this comment

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

No I don't understand what this manifest file block is doing. Is this something that applies to all DRA built projects?

Mostly I want to double check that this isn't something from the elastic-agent repository that was done support early agent releases that isn't actually needed here. The early agent releases work flow can't work for 7.17 as it is missing the changes the agent itself needed to support it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was introduced before the faster agent release project was started. If I understand correctly, it get the version from a provided manifest(specified in build params) and just sets it to BEAT_VERSION

Copy link
Member

Choose a reason for hiding this comment

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

Got it, it came from here and is used to know which dependency versions to download. elastic/elastic-agent#2727

I still don't really understand why it sets BEAT_VERSION since I doubt that ever doesn't match the version in the branch.

dev-tools/mage/artifacts/artifacts_api.go Outdated Show resolved Hide resolved
dev-tools/mage/crossbuild.go Outdated Show resolved Hide resolved
dev-tools/mage/manifest/manifest.go Outdated Show resolved Hide resolved
dev-tools/mage/manifest/manifest.go Outdated Show resolved Hide resolved
dev-tools/mage/manifest/manifestspecs.go Outdated Show resolved Hide resolved
dev-tools/mage/settings.go Outdated Show resolved Hide resolved
"strings"
)

// regexp taken from https://semver.org/ (see the FAQ section/Is there a suggested regular expression (RegEx) to check a SemVer string?)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would github.com/Masterminds/semver work here? Could it be used instead of this regexp to parse the semver?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it would be better to use the semver. I just brought this code from the elastic-agent repo just for consistency

Copy link
Member

Choose a reason for hiding this comment

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

We can move this code from elastic-agent to elastic-agent-libs so you can just import it instead of copying it.

dev-tools/mage/version/version_parser.go Outdated Show resolved Hide resolved
if devtools.PackagingFromManifest {
fmt.Println(">>>> Using manifest to package Agent")
if manifestResponse, err := manifest.DownloadManifest(devtools.ManifestURL); err != nil {
log.Panicf("failed to download remote manifest file %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why panic here instead of returning an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see we often use panic in our magefiles instead of returning an error. Honestly, I don't know why we do that. Perhaps for simplification

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @pazone

@elasticmachine
Copy link
Collaborator

💔 Build Failed

Failed CI Steps

History

cc @pazone

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @pazone

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 14, 2024

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 14, 2024

💔 Build Failed

Failed CI Steps

History

cc @pazone

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 14, 2024

💔 Build Failed

Failed CI Steps

History

cc @pazone

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @pazone

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @pazone

@AndersonQ AndersonQ removed their request for review March 18, 2024 13:28
@pazone
Copy link
Contributor Author

pazone commented Mar 18, 2024

@belimawr @cmacknz most of the code is just copied here from 8.x. I fixed as many lint issues as I could

@DaveSys911
Copy link

@cmacknz Apologies for intruding, this PR is a blocker for the unified release 7.x migration.
Any chance we can expedite the review on this and fix noncritical issues in subsequent prs?

@pazone pazone merged commit 2bb2fcb into 7.17 Mar 19, 2024
81 of 92 checks passed
@pazone pazone deleted the packaging_elastic_agent branch March 19, 2024 10:15
@cmacknz
Copy link
Member

cmacknz commented Mar 19, 2024

This was merged with the check step failing, several of the files use the wrong license type for Beats and are showing up in other PRs. https://github.com/elastic/beats/pull/38432/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants