Skip to content

chore(NODE-6890): add AWS variables to env from expansions #4500

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

Merged
merged 2 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .evergreen/ci_matrix_constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const versions = [
{ codeName: 'gallium', versionNumber: 16, npmVersion: 9 },
{ codeName: 'hydrogen', versionNumber: 18, npmVersion: 10 },
{ codeName: 'iron', versionNumber: 20, npmVersion: 'latest' },
{ codeName: 'jod', versionNumber: 22, npmVersion: 'latest' },
{ codeName: 'jod', versionNumber: 22, npmVersion: 'latest' }
];
const NODE_VERSIONS = versions.map(({ versionNumber }) => versionNumber).sort();
const LOWEST_LTS = NODE_VERSIONS[0];
Expand Down
54 changes: 41 additions & 13 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ functions:
working_dir: src
binary: bash
env:
AUTH: 'auth'
SSL: 'ssl'
AUTH: "auth"
SSL: "ssl"
add_expansions_to_env: true
args:
- .evergreen/run-serverless-tests.sh
Expand Down Expand Up @@ -454,6 +454,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: regular
working_dir: "src"
Expand All @@ -469,6 +472,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: assume-role
working_dir: "src"
Expand All @@ -484,9 +490,12 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: ec2
IS_EC2: 'true'
IS_EC2: "true"
working_dir: src
binary: bash
args:
Expand All @@ -500,6 +509,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: env-creds
working_dir: "src"
Expand All @@ -515,6 +527,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: session-creds
working_dir: "src"
Expand All @@ -530,6 +545,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: web-identity
AWS_ROLE_SESSION_NAME: test
Expand All @@ -546,6 +564,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: web-identity
working_dir: "src"
Expand All @@ -562,6 +583,9 @@ functions:
- MONGODB_AWS_SDK
- PROJECT_DIRECTORY
- MONGODB_BINARIES
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: web-identity
working_dir: "src"
Expand Down Expand Up @@ -601,7 +625,7 @@ functions:
- DRIVERS_TOOLS
env:
AWS_CREDENTIAL_TYPE: env-creds
MONGODB_AWS_SDK: 'true'
MONGODB_AWS_SDK: "true"
working_dir: "src"
binary: bash
args:
Expand Down Expand Up @@ -734,12 +758,12 @@ functions:
- .evergreen/docker/alpine.sh

tasks:
- name: 'test-atlas-data-lake'
- name: "test-atlas-data-lake"
tags: ["datalake", "mongohouse"]
commands:
- func: 'install dependencies'
- func: 'bootstrap mongohoused'
- func: 'run data lake tests'
- func: "install dependencies"
- func: "bootstrap mongohoused"
- func: "run data lake tests"

- name: "test-serverless"
tags: ["serverless"]
Expand Down Expand Up @@ -840,7 +864,8 @@ tasks:
ENVIRONMENT: k8s
K8S_VARIANT: eks
SCRIPT: run-oidc-prose-tests.sh
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
include_expansions_in_env:
["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
args:
- .evergreen/run-oidc-tests-k8s.sh

Expand All @@ -858,7 +883,8 @@ tasks:
ENVIRONMENT: k8s
K8S_VARIANT: gke
SCRIPT: run-oidc-prose-tests.sh
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
include_expansions_in_env:
["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
args:
- .evergreen/run-oidc-tests-k8s.sh

Expand All @@ -876,7 +902,8 @@ tasks:
ENVIRONMENT: k8s
K8S_VARIANT: aks
SCRIPT: run-oidc-prose-tests.sh
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
include_expansions_in_env:
["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
args:
- .evergreen/run-oidc-tests-k8s.sh

Expand Down Expand Up @@ -1143,11 +1170,12 @@ task_groups:
- command: subprocess.exec
params:
binary: bash
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
include_expansions_in_env:
["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
env:
MONGODB_VERSION: "8.0"
args:
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/setup.sh
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/setup.sh
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800
tasks:
Expand Down
24 changes: 24 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: regular
working_dir: src
Expand All @@ -411,6 +414,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: assume-role
working_dir: src
Expand All @@ -425,6 +431,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: ec2
IS_EC2: 'true'
Expand All @@ -440,6 +449,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: env-creds
working_dir: src
Expand All @@ -454,6 +466,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: session-creds
working_dir: src
Expand All @@ -468,6 +483,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: web-identity
AWS_ROLE_SESSION_NAME: test
Expand All @@ -483,6 +501,9 @@ functions:
- MONGODB_URI
- DRIVERS_TOOLS
- MONGODB_AWS_SDK
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: web-identity
working_dir: src
Expand All @@ -498,6 +519,9 @@ functions:
- MONGODB_AWS_SDK
- PROJECT_DIRECTORY
- MONGODB_BINARIES
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
AWS_CREDENTIAL_TYPE: web-identity
working_dir: src
Expand Down
40 changes: 19 additions & 21 deletions .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ for (const {
display_name: `${osDisplayName} Node Latest`,
run_on,
expansions: { NODE_LTS_VERSION: 'latest' },
tasks: tasks.map(({ name }) => name),
tasks: tasks.map(({ name }) => name)
};
if (clientEncryption) {
buildVariantData.expansions.CLIENT_ENCRYPTION = true;
Expand Down Expand Up @@ -728,26 +728,24 @@ const coverageTask = {
SINGLETON_TASKS.push(coverageTask);
SINGLETON_TASKS.push(...customDependencyTests);

SINGLETON_TASKS.push(
{
name: `test-alpine-fle`,
tags: ['alpine-fle'],
commands: [
updateExpansions({
NODE_VERSION: '16.20.1',
VERSION: 'latest',
TOPOLOGY: 'replica_set',
CLIENT_ENCRYPTION: true,
TEST_CSFLE: true,
MONGODB_BINARIES: '${PROJECT_DIRECTORY}/mongodb/bin',
}),
{ func: 'install dependencies' },
{ func: 'bootstrap mongo-orchestration' },
{ func: 'assume secrets manager rule' },
{ func: 'build and test alpine FLE' }
]
}
)
SINGLETON_TASKS.push({
name: `test-alpine-fle`,
tags: ['alpine-fle'],
commands: [
updateExpansions({
NODE_VERSION: '16.20.1',
VERSION: 'latest',
TOPOLOGY: 'replica_set',
CLIENT_ENCRYPTION: true,
TEST_CSFLE: true,
MONGODB_BINARIES: '${PROJECT_DIRECTORY}/mongodb/bin'
}),
{ func: 'install dependencies' },
{ func: 'bootstrap mongo-orchestration' },
{ func: 'assume secrets manager rule' },
{ func: 'build and test alpine FLE' }
]
});

function addPerformanceTasks() {
const makePerfTask = (name, MONGODB_CLIENT_OPTIONS) => ({
Expand Down
5 changes: 3 additions & 2 deletions .evergreen/perf_send.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const {
const orderSplit = revision_order_id?.split('_');
const order = Number(orderSplit ? orderSplit[orderSplit.length - 1] : undefined);

if (!Number.isInteger(order)) throw new Error(`Failed to parse integer from order, revision_order_id=${revision_order_id}`);
if (!Number.isInteger(order))
throw new Error(`Failed to parse integer from order, revision_order_id=${revision_order_id}`);

const results = JSON.parse(await fs.readFile(resultFile, 'utf8'));

Expand Down Expand Up @@ -53,7 +54,7 @@ const resp = await fetch(API_PATH, {
const responseText = await resp.text();
let jsonResponse = null;
try {
jsonResponse = JSON.parse(responseText)
jsonResponse = JSON.parse(responseText);
} catch (cause) {
console.log('Failed to parse json response', cause);
}
Expand Down
3 changes: 3 additions & 0 deletions .evergreen/run-lint-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ if ! git diff --exit-code ./.evergreen/config.yml; then
fi
set -o xtrace

npx prettier --check --single-quote=false .evergreen/config.in.yml
npx prettier --check .evergreen/*.js .evergreen/*.mjs

## Checks typescript, eslint, and prettier
npm run check:lint