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

Set cache option on setup-go action in workflows #8280

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

brooke-hamilton
Copy link
Member

@brooke-hamilton brooke-hamilton commented Jan 23, 2025

Description

This PR sets the cache: true option on the setup-go actions in the workflows. Previously we used a common caching technique to cache the go install and modules folders, but this feature is now built into the setup-go action. This change was tested with PR #8276. Following that, this PR updates the remaining workflows to use the new caching feature.

The default value for the cache option is true on the setup-go@v5 action. This PR explicitly sets the value to true on the action where it is not specified so that the option will be obvious, even though it will not change the behavior of the action for cases when the option was not set.

  • build.yaml: Explicitly set cache option to true, which is the same as the default value.
  • functional-test-cloud.yaml: Changed the cache option from false to true and removed the original caching actions.
  • lint.yaml: Explicitly set cache option to true, which is the same as the default value.
  • long-running-azure.yaml: Explicitly set cache option to true, which is the same as the default value.
  • publish-docs.yaml: Explicitly set cache option to true, which is the same as the default value.

NOTE: This PR is created from a branch in this repo instead of a fork from an external repo to allow us to run the cloud test workflows.

Type of change

  • This pull request adds or changes features of Radius and has an approved issue (issue link required).

Related to issue: #8274
Related to PR #8276

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
  • A design document PR is created in the design-notes repository, if new APIs are being introduced.
  • If applicable, design document has been reviewed and approved by Radius maintainers/approvers.
  • A PR for the samples repository is created, if existing samples are affected by the changes in this PR.
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.

Signed-off-by: Brooke Hamilton <[email protected]>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 23, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref 127b30b
Unique ID funca0795240f2
Image tag pr-funca0795240f2
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funca0795240f2
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funca0795240f2
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funca0795240f2
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funca0795240f2
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funca0795240f2
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ corerp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded

Copy link

github-actions bot commented Jan 23, 2025

Unit Tests

3 612 tests  +61   3 610 ✅ +65   6m 9s ⏱️ -2s
  295 suites ± 0       2 💤 ± 0 
    1 files   ± 0       0 ❌  -  4 

Results for commit 106e56c. ± Comparison against base commit 5d5a634.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.93%. Comparing base (835abb0) to head (106e56c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8280      +/-   ##
==========================================
- Coverage   59.94%   59.93%   -0.02%     
==========================================
  Files         596      596              
  Lines       40432    40432              
==========================================
- Hits        24238    24232       -6     
- Misses      14367    14371       +4     
- Partials     1827     1829       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Brooke Hamilton <[email protected]>
@brooke-hamilton brooke-hamilton marked this pull request as ready for review January 23, 2025 16:08
@brooke-hamilton brooke-hamilton requested review from a team as code owners January 23, 2025 16:08
@radius-functional-tests

This comment has been minimized.

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 23, 2025

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
❌ corerp-cloud functional test failed. Please check the logs for more details
⌛ Starting corerp-cloud functional tests...
✅ corerp-cloud functional tests succeeded

Copy link
Contributor

@superbeeny superbeeny left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for finding this

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 24, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref 6496f73
Unique ID func1efcb77582
Image tag pr-func1efcb77582
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func1efcb77582
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func1efcb77582
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func1efcb77582
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func1efcb77582
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func1efcb77582
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this not being used anymore?

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 could not find any references to this action in the radius-project GitHub org.

@@ -101,6 +101,7 @@ jobs:
with:
go-version: ${{ env.GOVER }}
cache-dependency-path: go.sum
cache: true
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is true by default and does not need to be set explicitly.

Copy link
Contributor

Choose a reason for hiding this comment

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

When this wasn't added, which means that it was true, we were getting the same error.

Copy link
Contributor

Choose a reason for hiding this comment

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

I added some information here: #8147. Maybe you can find the missing link.

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 think this is true by default and does not need to be set explicitly.

Yes you are right: setting cache: true does not change the behavior because it is true by default. I put it here to be explicit because in some of our other workflows we had additional caching logic that was created before the caching feature was available on the setup-go action. I removed the additional caching logic from functional-test-cloud.yaml, and from the non-cloud tests in a previous PR #8280. Setting this value makes it clear that we are doing caching, in case someone looks at the workflow and thinks "why aren't we doing caching like we had before?" But if you prefer to not have this value set explicitly I will remove it.

When this wasn't added, which means that it was true, we were getting the same error.

This workflow wasn't having an error, but the functional-test-cloud.yaml workflow was having occasional errors with cache conflicts, so I removed the cache@v4 action, which I think is now unnecessary due to caching being built into the setup-go action.

I added some information here: #8147. Maybe you can find the missing link.

I think that PR made sense where we did caching with the cache@v4 action, but I still saw cache file conflicts with that step, so with this PR we can try using the built-in caching with the setup-go action. If we don't see good results we can revert, but so far with PR #8280 things seem OK.

However, one caveat on what I said above, after PR #8280 we are still seeing caching errors with the setup-go action. Here is an example. I found two related issues here and here. They recommend updating our go version to > 1.23.0. We need to standardize our go version on the version set in go.mod anyway (because each workflow has a hard coded version that is separate from go.mod). So let's discuss which version and do that in a separate PR.

What do you think about this plan?

  1. Remove separate caching steps that used cache@v4 and set the setup-go action property cache: true. (this pr)
  2. Update our go.mod to use a version greater than 1.23.0 and remove hard coded go versions from the workflow. (next pr)
  3. If we still see caching errors after doing the above two steps, set cache: false on the setup-go action.

I really appreciate your feedback on this - I know you have a lot of knowledge in this area having spent significant cycles on it. ❤️

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 30, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref 106e56c
Unique ID func6c6bdb5a23
Image tag pr-func6c6bdb5a23
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func6c6bdb5a23
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func6c6bdb5a23
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func6c6bdb5a23
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func6c6bdb5a23
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func6c6bdb5a23
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants