Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Set up a smoke test pass that check if Substrate/Polkadot build using dist sccache #77

Merged
merged 6 commits into from
May 24, 2021

Conversation

Xanewok
Copy link
Contributor

@Xanewok Xanewok commented May 14, 2021

Builds on #51 (merged) and #76 (included, closed in favor of this).
Fixes #52.

For now this builds sccache locally, spins up a local sccache dist cluster using the Compose file and runs a simple cargo check on the target repository.

The sole reason for this is to uncover any discrepancies between the local sccache-enabled builds and the distributed ones, since the sandboxing logic can unearth some bugs that wholly prevent us from building in the dist scenario (like not including files which are required by the compilation but not included in the rustc-emitted dep-info file, see #51).

This is implemented as a concurrent smoke job for simplicity. We should probably set it up only after the build job, download the created musl-enabled binaries there (TODO: Set up a cache) to save time and only then do a fan-out to test that X different repositories build successfully using the sccache in dist mode. That's done now.

@Xanewok Xanewok force-pushed the igor-smoke-test-experiment branch from 850f6ed to 82c8836 Compare May 18, 2021 08:26
@Xanewok Xanewok changed the title WIP: Set up a smoke test pass that check if Substrate/Polkadot build using dist sccache Set up a smoke test pass that check if Substrate/Polkadot build using dist sccache May 18, 2021
@Xanewok Xanewok marked this pull request as ready for review May 18, 2021 08:27
@drahnr drahnr self-requested a review May 18, 2021 09:26
@Xanewok Xanewok force-pushed the igor-smoke-test-experiment branch from 27eac25 to 2c5675c Compare May 18, 2021 13:24
Comment on lines +1 to +4
# A version of `Dockerfile.build.sccache-dist` that skips the build stage and
# instead copies over the locally pre-built `sccache-dist` binary.
# TODO: Switch to BuildKit with Docker/Compose support when available, which
# allows us to unify these into a single Dockerfile
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My Docker-fu is not that great and maybe there's a way to share a single Dockerfile that allows to either vendor a binary from outside or build the project if needed, without resorting to Buildkit (IIUC Compose needs a very recent version that even supports that). @drahnr @gww-parity do you have an idea if we can deduplicate Dockerfile.{build,vendor}.sccache-dist somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The vendor one is just to save time in the CI while the build one is to provide a more self-contained example Dockerfile that can be used by others (technically vendor can be as well but the user needs to be on a compatible distro or know to compile targeting musl)

Copy link
Contributor

@gww-parity gww-parity left a comment

Choose a reason for hiding this comment

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

The way to uniform those Dockerfiles (if that's your goal) could be to extract common parts into scripts, copy them into containers and execute. Something alnog the lines

COPY ./common_ubuntu18_setup.sh /common_ubuntu18_setup.sh
RUN ./common_ubuntu18_setup.sh
COPY ./following_steps_for_X.sh
RUN ./following_steps_for_X.sh

@Xanewok
Copy link
Contributor Author

Xanewok commented May 24, 2021

I talked with @gww-parity and we agreed to move this forward and not separate the Docker-related scripts for now

@Xanewok Xanewok merged commit f42ca5f into master May 24, 2021
@Xanewok Xanewok deleted the igor-smoke-test-experiment branch May 24, 2021 12:55
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.

Check that Substrate/Polkadot fully compiles using distributed compilation
3 participants