Skip to content

Commit 019b72c

Browse files
Merge remote-tracking branch 'origin/main' into beta-releases
2 parents 728ca28 + 9e81eb4 commit 019b72c

File tree

56 files changed

+2062
-2220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2062
-2220
lines changed

.evergreen/compass_package.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
#! /usr/bin/env bash
2-
32
set -e
3+
set -x
44

55
if [[ "$OSTYPE" == "cygwin" ]]; then
66
echo "Starting Installer Service..."
77
net start MSIServer
88
fi
99

10+
# Ensure .sbom is always created with fresh data
11+
rm -rvf .sbom && mkdir -pv .sbom
12+
1013
echo "Creating signed release build..."
1114
npm run package-compass $COMPASS_DISTRIBUTION;
1215

.evergreen/create-sbom.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#! /usr/bin/env bash
2+
set -e
3+
set -x
4+
5+
# create SBOM
6+
CRYPT_SHARED_VERSION=$(cat packages/compass/src/deps/csfle/version)
7+
8+
set +x
9+
echo "${ARTIFACTORY_PASSWORD}" > /tmp/artifactory_password
10+
set -x
11+
12+
trap_handler() {
13+
rm -f /tmp/artifactory_password
14+
}
15+
trap trap_handler ERR EXIT
16+
17+
scp -i "$SIGNING_SERVER_PRIVATE_KEY_CYGPATH" -P "$SIGNING_SERVER_PORT" .sbom/dependencies.json /tmp/artifactory_password "$SIGNING_SERVER_USERNAME"@"$SIGNING_SERVER_HOSTNAME":/tmp/
18+
ssh -i "$SIGNING_SERVER_PRIVATE_KEY_CYGPATH" -p "$SIGNING_SERVER_PORT" "$SIGNING_SERVER_USERNAME"@"$SIGNING_SERVER_HOSTNAME" \
19+
"(cat /tmp/dependencies.json | jq -r '.[] | "'"pkg:npm/" + .name + "@" + .version'"' > /tmp/purls.txt) && \
20+
echo "pkg:generic/mongo_crypt_shared@${CRYPT_SHARED_VERSION}" >> /tmp/purls.txt && \
21+
(cat /tmp/artifactory_password | docker login artifactory.corp.mongodb.com --username '${ARTIFACTORY_USERNAME}' --password-stdin ; rm -f /tmp/artifactor_password ) && \
22+
docker pull artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 && \
23+
docker run --rm -v /tmp:/tmp artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 update \
24+
--purls /tmp/purls.txt --sbom_out /tmp/sbom.json"
25+
scp -i "$SIGNING_SERVER_PRIVATE_KEY_CYGPATH" -P "$SIGNING_SERVER_PORT" "$SIGNING_SERVER_USERNAME"@"$SIGNING_SERVER_HOSTNAME":/tmp/{sbom.json,purls.txt} .sbom/

.evergreen/functions.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,14 @@ functions:
378378
379379
# Write the host info so that it can be used by the signing tool
380380
if [[ $OSTYPE == "cygwin" ]]; then
381-
identity_file=$(cygpath -wa "$identity_file")
381+
identity_file_ospath=$(cygpath -wa "$identity_file")
382382
else
383-
identity_file=$(eval echo "$identity_file")
383+
identity_file_ospath=$(eval echo "$identity_file")
384384
fi
385385
cat <<EOL > signing_host_info.yml
386386
SIGNING_SERVER_HOSTNAME: $hostname
387-
SIGNING_SERVER_PRIVATE_KEY: $identity_file
387+
SIGNING_SERVER_PRIVATE_KEY: $identity_file_ospath
388+
SIGNING_SERVER_PRIVATE_KEY_CYGPATH: $identity_file
388389
SIGNING_SERVER_USERNAME: $user
389390
SIGNING_SERVER_PORT: 22
390391
EOL
@@ -405,13 +406,30 @@ functions:
405406
COMPASS_DISTRIBUTION: ${compass_distribution}
406407
SIGNING_SERVER_HOSTNAME: ${SIGNING_SERVER_HOSTNAME}
407408
SIGNING_SERVER_PRIVATE_KEY: ${SIGNING_SERVER_PRIVATE_KEY}
409+
SIGNING_SERVER_PRIVATE_KEY_CYGPATH: ${SIGNING_SERVER_PRIVATE_KEY_CYGPATH}
408410
SIGNING_SERVER_USERNAME: ${SIGNING_SERVER_USERNAME}
409411
SIGNING_SERVER_PORT: ${SIGNING_SERVER_PORT}
410412
script: |
411413
set -e
412414
413415
eval $(.evergreen/print-compass-env.sh)
414416
.evergreen/compass_package.sh
417+
- command: shell.exec
418+
params:
419+
working_dir: src
420+
shell: bash
421+
env:
422+
ARTIFACTORY_USERNAME: ${artifactory_username}
423+
ARTIFACTORY_PASSWORD: ${artifactory_password}
424+
SIGNING_SERVER_HOSTNAME: ${SIGNING_SERVER_HOSTNAME}
425+
SIGNING_SERVER_PRIVATE_KEY: ${SIGNING_SERVER_PRIVATE_KEY}
426+
SIGNING_SERVER_PRIVATE_KEY_CYGPATH: ${SIGNING_SERVER_PRIVATE_KEY_CYGPATH}
427+
SIGNING_SERVER_USERNAME: ${SIGNING_SERVER_USERNAME}
428+
SIGNING_SERVER_PORT: ${SIGNING_SERVER_PORT}
429+
script: |
430+
set -e
431+
432+
.evergreen/create-sbom.sh
415433
416434
publish:
417435
- command: shell.exec
@@ -738,6 +756,20 @@ functions:
738756
remote_file: ${project}/${revision}_${revision_order_id}/${linux_tar_sign_filename}
739757
content_type: application/pgp-signature
740758
optional: true
759+
- command: s3.put
760+
params:
761+
<<: *save-artifact-params-public
762+
local_file: src/.sbom/purls.txt
763+
remote_file: ${project}/${revision}_${revision_order_id}/${task_id}/purls.txt
764+
content_type: text/plain
765+
optional: true
766+
- command: s3.put
767+
params:
768+
<<: *save-artifact-params-public
769+
local_file: src/.sbom/sbom.json
770+
remote_file: ${project}/${revision}_${revision_order_id}/${task_id}/sbom.json
771+
content_type: application/json
772+
optional: true
741773

742774
get-all-artifacts:
743775
- command: shell.exec
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This evergreen .yml is intentionally left empty.
2+
# We want the compass-generative-ai-accuracy evergreen project to run
3+
# daily on the latest commit. This file is here so that we have a
4+
# .yml config to point the evergreen project to so that
5+
# it can uses the most recent commits when the daily run happens.
6+
7+
# The .yml that runs those tests is `generative-ai-accuracy-test.yml`.
8+
# We don't want it to run on every commit as that would be too many
9+
# requests to our ai model (expensive).

.evergreen/generative-ai-accuracy-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This evergreen .yml is only used in periodic builds.
2-
# We don't want it to run on every patch as that would be too many
3-
# requests to our ai model (expensive).
2+
# We don't want it to run on every commit as that would be
3+
# too many requests to our ai model (expensive).
44

55
unset_function_vars: true
66
stepback: false

0 commit comments

Comments
 (0)