Skip to content

Universe: new and improved yarn package#2483

Merged
shykes merged 1 commit into
dagger:mainfrom
shykes:yarnv2
May 20, 2022
Merged

Universe: new and improved yarn package#2483
shykes merged 1 commit into
dagger:mainfrom
shykes:yarnv2

Conversation

@shykes
Copy link
Copy Markdown
Contributor

@shykes shykes commented May 18, 2022

This is a rewrite of the official yarn package. It is based on my experimental version (universe.dagger.io/x/solomon@dagger.io/yarn).

NOTE: this PR depends on #2480 , please merge that first.

Improvements include:

  • Usable by the example todoapp plan (which includes a custom inline implementation with hacks). See Getting started tutorial: use the official yarn package #2482
  • More granular API
    • #Script to run a yarn script (yarn run ...)
    • #Install to install dependencies (yarn install)
    • #Command to run any command (yarn ...)
  • Proper use of yarn cache, configurable with project name
  • App source code is mounted instead of copied (more efficient)
  • Action container can be customized, including with custom image (to run a custom yarn binary)
  • Tests are improved and self-contained (use core.#Source)

Note: one small breaking change: yarn.#Build.name is now yarn.#Build.project. I tried to add reverse compat but ran into mystical CUE errors... And could not find any configuration that actually used that field.

@shykes shykes requested review from helderco and jpadams as code owners May 18, 2022 23:58
@shykes shykes requested a review from a team as a code owner May 19, 2022 00:45
@sipsma
Copy link
Copy Markdown
Contributor

sipsma commented May 19, 2022

I was just trying to debug the timeouts in the universe tests by adding the tracing functionality just in my fork, but just accidentally pushed to this PR instead of the fork... Apparently the gh CLI sets that up as the default remote...

Either way, I guess I'll just let it run through for debugging, but we shouldn't merge my add tracing to universe tests commit here. I'll revert back to the original commits once this CI run finishes.

@sipsma
Copy link
Copy Markdown
Contributor

sipsma commented May 19, 2022

The CI run seems to be indicating that the GHA runner is becoming unresponsive, the error message being: Runner GitHub Actions 3 did not respond to a cancelation request with 00:05:00..

This makes me suspect the problem may not be the GHA throttling that we've previously... I'll try again in my own fork though. Reverted back my accidental push to this branch (sorry about the noise).

@shykes
Copy link
Copy Markdown
Contributor Author

shykes commented May 19, 2022

How should I proceed? The yarn tests pass on my local machine, and I don't touch anything else. Should we ignore cancelled test, and merge anyway?

@sipsma
Copy link
Copy Markdown
Contributor

sipsma commented May 19, 2022

How should I proceed? The yarn tests pass on my local machine, and I don't touch anything else. Should we ignore cancelled test, and merge anyway?

Pass for me locally too, but also timeout when I run in GHA in my fork. Got traces from there though, it's showing that the actions.test.todoreact.install.container._exec step in universe.dagger.io/x/solomon@dagger.io/yarn/test/test.cue is just hanging indefinitely while executing.

I have no idea why this would be. My only shot-in-the-dark guess is that the package repo we are downloading from is throttling GHA action IP addresses? Worth more investigation but may take some time.

For now, I would be okay with just disabling that test in CI and only running it locally until we figure out what's happening here (maybe just comment out the test in test.bats for now). If we just override and merge it as is my fear is that all other PRs that rebase on these commits could just hit the same issue.

@jpadams
Copy link
Copy Markdown
Contributor

jpadams commented May 20, 2022

Once I get the buildkit cache all loaded up, dagger do test works every time, but if I start from no cache, I see errors. Can repro them like this:

dagger do test todoreact build --no-cache

image

@shykes
Copy link
Copy Markdown
Contributor Author

shykes commented May 20, 2022

Once I get the buildkit cache all loaded up, dagger do test works every time, but if I start from no cache, I see errors. Can repro them like this:

That might be because —no-cache also wipes cache mounts, which yarn uses heavily. Is the error react-scripts: command not found? If so that’s definitely it.

@jpadams
Copy link
Copy Markdown
Contributor

jpadams commented May 20, 2022

That might be because —no-cache also wipes cache mounts, which yarn uses heavily. Is the error react-scripts: command not found? If so that’s definitely it.
Yes, indeed.

image

@jpadams
Copy link
Copy Markdown
Contributor

jpadams commented May 20, 2022

I removed my dagger-buildkitd container and volume, then ran fresh.

Seems to work fine. I think first time, I had your commits from prs 2480 and 2483 out of order. Looks good to me now.

for reference, my git log:
image

Signed-off-by: Solomon Hykes <solomon@dagger.io>
@shykes shykes merged commit 966c6cf into dagger:main May 20, 2022
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