Skip to content

Decrease frequency of yarn install failures in monitoring#642

Open
michalinacienciala wants to merge 3 commits intomainfrom
update-monitoring-dependencies
Open

Decrease frequency of yarn install failures in monitoring#642
michalinacienciala wants to merge 3 commits intomainfrom
update-monitoring-dependencies

Conversation

@michalinacienciala
Copy link
Contributor

In this PR we:

  • Update dependencies to tbtc-v2 and tbtc-v2.ts packages to decrease frequency of manually run yarn install's failures
  • Update CI to run postinstall scripts separately from yarn install (to eliminate yarn install failures in CI)
  • Explain the need for running postinstall separately in the Dockerfile (as requested in Don't run postinstall script separately from yarn install #629 (comment))

We've published new versions of the `@keep-network/tbtc-v2` and
`@keep-network/tbtc-v2.ts` packages The versions of tghose packages for the
development environment don't contain `prepare-dependencies.sh` script from
`@threshold-network/solidity-contracts` which was causing random failures
during `yarn install`. The `goerli` and `mainnet` packages still contain that
script, so we won't completely eliminate the problem, but should decrease its
frequency.
In a separate commit we'll add a workaround that should help with eliminating
the problem in CI.
Sometimes during installation of the `monitoring` project we were getting random
failures related to the presence of the `prepare-dependencies.sh` script from
`threshold-network/solidity-contracts` in the project subdependencies. Lately we
managed to remove the script from the `development`-tagged packages, but
the script is still present in `goerli` and `mainnet` packages. As `monitoring`
project installs `goerli` and `mainnet` `@keep-network/tbtc-v2` packages during
`yarn install`, the random failures may still occur. As a workaround for this
problem in our CI we will run install step with the `--ignore-scripts` flag
which installs the dependencies without running the postinstall scripts (neither
in subdependencies nor in the main project). We then add a step that executes
`yarn run postinstall` - this way we still execute any postinstall scripts from
the main project (currently it's `npm rebuild bcrypto`) script.
There are two reasons why we need to run `yarn install --frozen-lockfile` with
the `--ignore-scripts` flag and run `yarn run postinstall` afterwards:
1. Sometimes during installation of the `monitoring` project we were getting
   random failures related to the presence of the `prepare-dependencies.sh`
   script from `threshold-network/solidity-contracts` in the project
   subdependencies. Lately we managed to remove the script from the
   `development`-tagged packages, but the script is still present in `goerli`
   and `mainnet` packages. As `monitoring` project installs `goerli` and
   `mainnet` `@keep-network/tbtc-v2` packages during `yarn install`, the random
   failures may still occur. As a workaround for this problem we will ca run
   install step with the `--ignore-scripts` flag which installs the dependencies
   without running the postinstall scripts (neither in subdependencies nor in
   the main project). We then add a step that executes `yarn run postinstall` -
   this way we still execute any postinstall scripts from the main project
   (currently it's `npm rebuild bcrypto`) script.
2. The `bcoin` holds their `node_modules` in VCS
   (https://github.com/bcoin-org/bcoin/tree/master/node_modules). That means
   `bcrypto` dependency is already here when we run `yarn install`. For an
   unknown reason, `yarn install` does not build all native components in that
   case, hence the need for manual `postinstall` that does it again under the
   hood.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:shipit: deployment Deployments and CI workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant