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

Use Github actions/cache to cache the go deps in CI #2104

Open
viveksinghggits opened this issue Jun 13, 2023 · 4 comments
Open

Use Github actions/cache to cache the go deps in CI #2104

viveksinghggits opened this issue Jun 13, 2023 · 4 comments
Assignees
Labels
Projects

Comments

@viveksinghggits
Copy link
Contributor

We should consider caching the go mod dependencies while running tests and go mod download in CI.

@github-actions
Copy link
Contributor

Thanks for opening this issue 👍. The team will review it shortly.

If this is a bug report, make sure to include clear instructions how on to reproduce the problem with minimal reproducible examples, where possible. If this is a security report, please review our security policy as outlined in SECURITY.md.

If you haven't already, please take a moment to review our project's Code of Conduct document.

@infraq infraq added this to To Be Triaged in Kanister Jun 13, 2023
@viveksinghggits
Copy link
Contributor Author

viveksinghggits commented Jun 13, 2023

By looking at this figure

image

I thought that go mod is taking too much time (14m) and maybe we should try to cache the deps. But after further looking into that it looks like the go mod (go mod tidy) command is barely taking a minute. But the actual time that is taken in this step is while uploading the artifacts that we do here.

Below image shows the time go mod and upload artifact takes

image

@viveksinghggits
Copy link
Contributor Author

Most of the time is being taken by either upload/download-artifact step or while pulling our build image.

- uses: actions/upload-artifact@v3
      with:
        name: src
        path: ./src.tar.gz

We should see if there is a way to run the CI without using uploading and downloading the artifacts. Maybe explore https://github.com/actions/setup-go that support caching as well.

@github-actions github-actions bot added the stale label Sep 12, 2023
@pavannd1 pavannd1 removed the stale label Sep 19, 2023
@github-actions github-actions bot added the stale label Dec 19, 2023
@julio-lopez julio-lopez added test-framework Related to e2e test framework frozen and removed stale labels Dec 19, 2023
@kanisterio kanisterio deleted a comment from github-actions bot Dec 19, 2023
@kanisterio kanisterio deleted a comment from github-actions bot Dec 19, 2023
@hairyhum
Copy link
Contributor

The upload artifact was addressed in #2534 without actually using the cache.
We can't cache the build image, which contributes about 40-60 seconds to the pipeline, and switching away from using the build image could allow to use cache, but that needs some changes in the makefiles and build scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Kanister
To Be Triaged
Development

No branches or pull requests

4 participants