-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 / FIPS] Dynamic agent selection. Add FIPS agents #183777
Merged
Merged
Changes from 46 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
ac74d72
use fips agent
Ikuni17 16483da
hack node.options
Ikuni17 3a737cd
use qa image repo
Ikuni17 9c06df1
Merge remote-tracking branch 'upstream/main' into fips-agent-test
Ikuni17 45032e4
debug
Ikuni17 9c71a44
fix exit status
Ikuni17 eed2097
set env var
Ikuni17 cfca864
qa image for ftr
Ikuni17 7c161ac
remove fips debug
Ikuni17 ee8ca0b
single agent config
Ikuni17 5874016
remove echo debug
Ikuni17 90f763c
add fips verify to checks
Ikuni17 fa22987
cleanup
Ikuni17 54e07ae
fix script permissions. change order
Ikuni17 835713c
fix config path
Ikuni17 545cb59
out fips status
Ikuni17 2373529
dynamic agent selection
Ikuni17 704fded
add annotation
Ikuni17 0a4e784
fix export
Ikuni17 a0f9f25
fix yml linting
Ikuni17 7e98c33
only add env when necessary
Ikuni17 831c2fb
fix comment config
Ikuni17 86e0520
fix var
Ikuni17 6181646
only check for fips if it is enabled
Ikuni17 bf820e0
fix import
Ikuni17 a558aff
adjust annotation
Ikuni17 630158c
fix verification
Ikuni17 a829ca1
fix compare
Ikuni17 d62746d
trim newline
Ikuni17 62feca4
dynamically adjust node.options
Ikuni17 1e1b4e6
string
Ikuni17 fc88586
ignore node.options changes
Ikuni17 ea9b302
ignore node.options on git add
Ikuni17 36ae373
check for node.options. cleanup
Ikuni17 9f39895
Merge remote-tracking branch 'upstream/main' into fips-agent-test
Ikuni17 23275dc
cleanup
Ikuni17 1406c2f
adjust fips verification check
Ikuni17 7fc2de6
remove all invisible characters
Ikuni17 3764367
debug
Ikuni17 0006d78
remove ansi char
Ikuni17 ea75be1
Merge branch 'main' into fips-agent-test
Ikuni17 e544957
Merge remote-tracking branch 'upstream/main' into fips-agent-test
Ikuni17 8342e13
fix potential bug. add sed comment
Ikuni17 1441214
Merge branch 'main' into fips-agent-test
Ikuni17 76e2373
Merge remote-tracking branch 'upstream/main' into fips-agent-test
Ikuni17 91f1425
Merge remote-tracking branch 'upstream/main' into fips-agent-test
Ikuni17 c7a9aa0
Merge remote-tracking branch 'upstream/main' into fips-agent-test
Ikuni17 4b4616f
increase build timeout
Ikuni17 63f8540
Merge remote-tracking branch 'upstream/main' into fips-agent-test
Ikuni17 ef391d0
Revert "increase build timeout"
Ikuni17 8bd94f9
fix node path
Ikuni17 5a6fa91
rename agent images
Ikuni17 5e8f1bc
change env variable flow
Ikuni17 fff6902
Merge remote-tracking branch 'upstream/main' into fips-agent-test
Ikuni17 3a33141
Merge branch 'main' into fips-agent-test
Ikuni17 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { dump } from 'js-yaml'; | ||
import { BuildkiteClient, BuildkiteCommandStep } from './buildkite'; | ||
|
||
type AgentImageConfig = BuildkiteCommandStep['agents']; | ||
|
||
const DEFAULT_AGENT_IMAGE_CONFIG: AgentImageConfig = { | ||
provider: 'gcp', | ||
image: 'family/kibana-ubuntu-2004', | ||
imageProject: 'elastic-images-prod', | ||
}; | ||
|
||
const FIPS_AGENT_IMAGE_CONFIG: AgentImageConfig = { | ||
provider: 'gcp', | ||
image: 'family/kibana-fips-ubuntu-2004', | ||
imageProject: 'elastic-images-qa', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once elastic/ci-agent-images#686 is merged this can be updated to |
||
}; | ||
|
||
const GITHUB_PR_LABELS = process.env.GITHUB_PR_LABELS ?? ''; | ||
const FTR_ENABLE_FIPS_AGENT = process.env.FTR_ENABLE_FIPS_AGENT?.toLowerCase() === 'true'; | ||
|
||
// Narrow the return type with overloads | ||
function getAgentImageConfig(): AgentImageConfig; | ||
function getAgentImageConfig(options: { returnYaml: true }): string; | ||
function getAgentImageConfig({ returnYaml = false } = {}): string | AgentImageConfig { | ||
const bk = new BuildkiteClient(); | ||
let config: AgentImageConfig; | ||
|
||
if (FTR_ENABLE_FIPS_AGENT || GITHUB_PR_LABELS.includes('ci:enable-fips-agent')) { | ||
config = FIPS_AGENT_IMAGE_CONFIG; | ||
|
||
bk.setAnnotation( | ||
'agent image config', | ||
'warning', | ||
'#### FIPS Agents Enabled<br />\nFIPS mode can produce new test failures. If you did not intend this remove ```FTR_ENABLE_FIPS_AGENT``` environment variable and/or the ```ci:enable-fips-agent``` Github label.' | ||
); | ||
} else { | ||
config = DEFAULT_AGENT_IMAGE_CONFIG; | ||
} | ||
|
||
if (returnYaml) { | ||
return dump({ agents: config }); | ||
} | ||
|
||
return config; | ||
} | ||
|
||
export { getAgentImageConfig }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, looks like most of the files are snake case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5a6fa91