Make CI faster #57

Merged
lx merged 1 commit from trinity-1686a/garage:improve-ci into main 2021-04-08 17:55:11 +00:00

Analysing CI logs, it seems to be doing nothing really useful a considerable part of the time :

step apt/pip/rustup registry download
build 5s 28s
cargo-test 5s 28s
smoke-test 36s 23s

Registry download can be avoided by keeping cargo home from one step to the next, and the restore-cache makes sure to prime the cache so the (which it currently doesn't really do as /drone/cargo get discarded between steps). This is what this pr implements.

apt/pip/rustup can be not run at all during CI by making a docker image with the required dependancies, with a dockerfile looking like (untested)

FROM rust:buster
RUN apt-get update && 
	apt-get install --yes libsodium-dev awscli python-pip && 
    rm -rf /var/lib/apt/lists/*
RUN rustup component add rustfmt
RUN pip install s3cmd

This is not implemented here as it needs the image to get pushed to docker-hub (or a custom registry), which should probably be done with a user named after either the project, or the organisation developing it (garage or deuxfleurs).

These changes requires renewing signature for .droneci.yml

Analysing CI logs, it seems to be doing nothing really useful a considerable part of the time : | step | apt/pip/rustup | registry download | | -------- | ------ | ------- | | build | 5s | 28s | | cargo-test| 5s | 28s | | smoke-test| 36s | 23s | Registry download can be avoided by keeping cargo home from one step to the next, and the restore-cache makes sure to prime the cache so the (which it currently doesn't really do as /drone/cargo get discarded between steps). This is what this pr implements. apt/pip/rustup can be not run at all during CI by making a docker image with the required dependancies, with a dockerfile looking like (untested) ```dockerfile FROM rust:buster RUN apt-get update && apt-get install --yes libsodium-dev awscli python-pip && rm -rf /var/lib/apt/lists/* RUN rustup component add rustfmt RUN pip install s3cmd ``` This is not implemented here as it needs the image to get pushed to docker-hub (or a custom registry), which should probably be done with a user named after either the project, or the organisation developing it (garage or deuxfleurs). #### These changes requires renewing signature for `.droneci.yml`
trinity-1686a added 1 commit 2021-04-08 15:32:32 +00:00
use volume for cargo home
All checks were successful
continuous-integration/drone/pr Build is passing
992284d545
so it gets preserved between steps, and registry download is done only once
lx merged commit e2e8ea4df5 into main 2021-04-08 17:55:11 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#57
No description provided.