stacks-blockchain-api icon indicating copy to clipboard operation
stacks-blockchain-api copied to clipboard

chore: gh action caching for docker build layers

Open zone117x opened this issue 4 years ago • 3 comments

Enable github action caching for build layers. Minor changes to Dockerfile to cache the apk add ... and npm install ... steps.

Should bring image build time down from minutes to tens of seconds.

zone117x avatar Dec 13 '21 17:12 zone117x

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/blockstack/stacks-blockchain-api/E6vTzu4uW71jhqyNAwqNqxJ4XBJY
✅ Preview: https://stacks-blockchain-api-git-chore-gh-action-bui-071192-blockstack.vercel.app

vercel[bot] avatar Dec 13 '21 17:12 vercel[bot]

Codecov Report

Merging #901 (09810b4) into develop (fdbc548) will increase coverage by 0.57%. The diff coverage is 88.31%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #901      +/-   ##
===========================================
+ Coverage    66.01%   66.58%   +0.57%     
===========================================
  Files           92       95       +3     
  Lines         9856     9979     +123     
  Branches      1546     1564      +18     
===========================================
+ Hits          6506     6645     +139     
+ Misses        3346     3330      -16     
  Partials         4        4              
Impacted Files Coverage Δ
src/api/routes/debug.ts 22.55% <0.00%> (ø)
src/datastore/common.ts 82.29% <ø> (ø)
src/datastore/memory-store.ts 6.98% <0.00%> (-0.05%) :arrow_down:
src/api/routes/block.ts 75.67% <70.96%> (+2.79%) :arrow_up:
src/api/init.ts 82.10% <75.00%> (-0.32%) :arrow_down:
src/api/routes/tx.ts 74.69% <87.50%> (+0.75%) :arrow_up:
src/api/async-handler.ts 88.88% <88.88%> (ø)
src/api/routes/core-node-rpc-proxy.ts 79.43% <88.88%> (-0.43%) :arrow_down:
src/api/controllers/db-controller.ts 77.72% <90.62%> (+2.49%) :arrow_up:
src/datastore/postgres-store.ts 83.65% <96.29%> (+0.25%) :arrow_up:
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7d5940d...09810b4. Read the comment docs.

codecov-commenter avatar Dec 13 '21 18:12 codecov-commenter

Hmm this isn't working as intended. None of the following steps are being cached:

RUN apk add --no-cache --virtual .build-deps alpine-sdk python3 git openjdk8-jre cmake
COPY package.json package-lock.json ./
RUN npm config set unsafe-perm true && npm install

Not really sure why not, probably something weird with the docker context being detected as changed. I'll wait for @CharlieC3 to possibly provide some insight.

zone117x avatar Dec 14 '21 08:12 zone117x

Closing this PR for now. I opened an issue to track if we want to work on it in the future: https://github.com/hirosystems/stacks-blockchain-api/issues/1623

zone117x avatar Apr 20 '23 12:04 zone117x