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

CSHARP-4962: Fix package build script on CI to produce 472 binaries #1264

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions evergreen/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ functions:
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: ${PROJECT_DIRECTORY}/artifacts/nuget/${PACKAGE_ID}.${PACKAGE_VERSION}.nupkg
local_file: mongo-csharp-driver/artifacts/nuget/${PACKAGE_ID}.${PACKAGE_VERSION}.nupkg
Copy link
Member Author

Choose a reason for hiding this comment

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

Windows hosts were not happy with the absolute path, it was threated it as relative.

Copy link
Contributor

Choose a reason for hiding this comment

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

We use ${PROJECT_DIRECTORY} throughout evergreen.yml and it runs successfully on Windows hosts. Any idea why it is problematic when used for the local_file argument?

Copy link
Member Author

Choose a reason for hiding this comment

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

As it was discussed offline: s3.put command somehow does not work very well with absolute path on Windows hosts. So will go with relative path as per proposed code.

remote_file: ${UPLOAD_BUCKET}/${revision}/${PACKAGE_ID}.${PACKAGE_VERSION}.nupkg
bucket: mciuploads
permissions: public-read
Expand All @@ -953,7 +953,7 @@ functions:
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: ${PROJECT_DIRECTORY}/artifacts/nuget/${PACKAGE_ID}.${PACKAGE_VERSION}.snupkg
local_file: mongo-csharp-driver/artifacts/nuget/${PACKAGE_ID}.${PACKAGE_VERSION}.snupkg
remote_file: ${UPLOAD_BUCKET}/${revision}/${PACKAGE_ID}.${PACKAGE_VERSION}.snupkg
bucket: mciuploads
permissions: public-read
Expand All @@ -964,14 +964,14 @@ functions:
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: ${PROJECT_DIRECTORY}/artifacts/nuget/${PACKAGE_ID}.${PACKAGE_VERSION}.nupkg
local_file: mongo-csharp-driver/artifacts/nuget/${PACKAGE_ID}.${PACKAGE_VERSION}.nupkg
remote_file: ${UPLOAD_BUCKET}/${revision}/${PACKAGE_ID}.${PACKAGE_VERSION}.nupkg
bucket: mciuploads
- command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: ${PROJECT_DIRECTORY}/artifacts/nuget/${PACKAGE_ID}.${PACKAGE_VERSION}.snupkg
local_file: mongo-csharp-driver/artifacts/nuget/${PACKAGE_ID}.${PACKAGE_VERSION}.snupkg
remote_file: ${UPLOAD_BUCKET}/${revision}/${PACKAGE_ID}.${PACKAGE_VERSION}.snupkg
bucket: mciuploads

Expand Down Expand Up @@ -2331,22 +2331,24 @@ buildvariants:
- matrix_name: build-packages
matrix_spec:
build-target: "release"
os: "windows-64" # should produce package on Windows to make sure full framework binaries created.
Copy link
Member Author

Choose a reason for hiding this comment

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

Setting host as a matrix_spec axis also set env variable, so platform detection works properly in sh-files.

Copy link
Contributor

Choose a reason for hiding this comment

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

matrix_name allows us to run all combinations of the specified matrix_spec. Given that the package step is a single action, we can simply use buildvariants/name with run_on similar to gssapi-auth-tests-windows or driver-performance-tests. No need to invoke the matrix_* machinery.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was unable to properly set the OS expansion/env variable without axis, so the platform detection was not working properly. Also we already have a matrix there for "build-target" variable (it's a convenient way to pass this variable and ensure it's enum-like variable with limited number of allowed values).

display_name: "Package Pack"
run_on: ubuntu2004-small
tags: ["build-packages", "release-tag"]
tasks:
- name: build-packages
git_tag_only: true
priority: 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.

When someone starting a release, he/she have to wait for it's completion to move forward with after release manual steps. So I've decided to prioritize package-related steps.


- matrix_name: generate-apidocs
matrix_spec:
build-target: "release"
os: "ubuntu-2004"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we moving from ubuntu2004-small to ubuntu2004 for these variants?

Copy link
Member Author

Choose a reason for hiding this comment

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

Basically I've removed explicit run_on by using the matrix_spec (so it would set OS env variable and for consistency). Setting OS axis to "ubuntu-2004" is to be run on the ubuntu2004-small.

      - id: "ubuntu-2004"
        display_name: "Ubuntu 20.04"
        variables:
          OS: "ubuntu-2004"
          python3_binary: "/opt/python/3.8/bin/python3"
        run_on: ubuntu2004-small

display_name: "Generate API Documentation"
run_on: ubuntu2004-small
tags: ["build-apidocs", "release-tag"]
tasks:
- name: generate-apidocs
git_tag_only: true
priority: 10
depends_on:
- name: build-packages
variant: ".build-packages"
Expand All @@ -2355,12 +2357,13 @@ buildvariants:
- matrix_name: push-packages
matrix_spec:
build-target: "release"
os: "ubuntu-2004"
display_name: "Package Push"
run_on: ubuntu2004-small
tags: ["push-packages", "release-tag"]
tasks:
- name: push-packages
git_tag_only: true
priority: 10
depends_on:
- name: build-packages
variant: ".build-packages"
Expand Down