Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

ci: cache improvements #471

Merged
merged 7 commits into from
Aug 17, 2021
Merged

ci: cache improvements #471

merged 7 commits into from
Aug 17, 2021

Conversation

Mirko-von-Leipzig
Copy link
Contributor

@Mirko-von-Leipzig Mirko-von-Leipzig commented Aug 16, 2021

This PR improves the CI caching, roughly halving the time required when caches are hit (no dependency or toolchain changes).

Overview of changes:

  • Use rust-cache action. This forms the bulk of the time improvement as Rust dependencies are now cached.
  • Improve npm caching for conformance tests. This trims 2-3 minutes of build time.
  • Improve job and step naming.
  • Add a manual trigger for the workflow.
  • Remove core dump for macos, no longer required.

Further details can be found in the commits.

I've been running into sporadic conformance test failures on windows (link to run):

  1) .pubsub.subscribe
       multiple connected nodes
         should send/receive 100 messages:
     FetchError: request to http:https://127.0.0.1:50533/api/v0/pubsub/pub?arg=pubsub-tests-C-aIrZS_7OSQMNSVOMszV failed, reason: read ECONNRESET
      at ClientRequest.<anonymous> (node_modules\node-fetch\lib\index.js:1455:11)
      at Socket.socketErrorListener (_http_client.js:475:9)
      at emitErrorNT (internal/streams/destroy.js:106:8)
      at emitErrorCloseNT (internal/streams/destroy.js:74:3)
      at processTicksAndRejections (internal/process/task_queues.js:82:21)

@koivunej
Copy link
Collaborator

ECONNRESET

these sound normal, but could be explained with something changing underneath in windows or just our tests lagging behind.

tar -xf go_ipfs.tar.gz

- name: Install dependencies windows (openssl)
- name: Install dependencies (windows)
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's still the nagging about "setupOnly" which ... I don't know why it would interfere with caching. https://github.com/rs-ipfs/rust-ipfs/pull/471/checks?check_run_id=3339830233#step:33:3

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@Mirko-von-Leipzig Mirko-von-Leipzig Aug 16, 2021

Choose a reason for hiding this comment

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

Just enabled this option, will test if it caches on my fork.
--edit--
Appears to have worked, 6minute step down-to 20secs.

Copy link
Collaborator

@koivunej koivunej Aug 16, 2021

Choose a reason for hiding this comment

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

This still requires the openssl installing step, at least per the docs.

This allows for manually triggering the workflow.
Particularly useful for running CI on forks without creating a PR.
New name is simply the host OS.

Previously was a long string including all parameters, which wouldn't
fit on the GH page.
This replaces the existing one, which wasn't caching much.
This was used to debug a crash which no longer occurs.

Removing lets us simplify the workflow file, and improves caching.
The setup for the conformance test would always build the npm packages.

Instead we now check for a cache hit, and only build if we miss.
Groups steps together where sensible, and made the naming more uniform.
@koivunej
Copy link
Collaborator

Excellent, looking great.

bors r+

bors bot added a commit that referenced this pull request Aug 16, 2021
471: ci: cache improvements r=koivunej a=Mirko-von-Leipzig

This PR improves the CI caching, roughly halving the time required when caches are hit (no dependency or toolchain changes).

Overview of changes:

- Use [rust-cache action](https://github.com/Swatinem/rust-cache). This forms the bulk of the time improvement as Rust dependencies are now cached.
- Improve npm caching for conformance tests. This trims 2-3 minutes of build time.
- Improve job and step naming.
- Add a manual trigger for the workflow.
- Remove core dump for macos, no longer required.

Further details can be found in the commits.

I've been running into sporadic conformance test failures on windows ([link to run](https://github.com/Mirko-von-Leipzig/rust-ipfs/actions/runs/1135372291)):
```
  1) .pubsub.subscribe
       multiple connected nodes
         should send/receive 100 messages:
     FetchError: request to http:https://127.0.0.1:50533/api/v0/pubsub/pub?arg=pubsub-tests-C-aIrZS_7OSQMNSVOMszV failed, reason: read ECONNRESET
      at ClientRequest.<anonymous> (node_modules\node-fetch\lib\index.js:1455:11)
      at Socket.socketErrorListener (_http_client.js:475:9)
      at emitErrorNT (internal/streams/destroy.js:106:8)
      at emitErrorCloseNT (internal/streams/destroy.js:74:3)
      at processTicksAndRejections (internal/process/task_queues.js:82:21)
```

Co-authored-by: Mirko von Leipzig <[email protected]>
@bors
Copy link
Contributor

bors bot commented Aug 16, 2021

Build failed:

@koivunej
Copy link
Collaborator

bors r+

@bors
Copy link
Contributor

bors bot commented Aug 17, 2021

Build succeeded:

@bors bors bot merged commit 08f840b into rs-ipfs:master Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants