Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split Dockerfile build into two stages #104

Merged

Conversation

kentbull
Copy link
Contributor

One stage for building, one for the runtime. This enables near-instantaneous builds of source only changes

One stage for building, one for the runtime. This enables near-instantaneous builds of source only changes
@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Merging #104 (4ffb4fc) into development (05c7eab) will increase coverage by 1.52%.
Report is 6 commits behind head on development.
The diff coverage is 84.16%.

@@               Coverage Diff               @@
##           development     #104      +/-   ##
===============================================
+ Coverage        88.20%   89.72%   +1.52%     
===============================================
  Files               30       34       +4     
  Lines             4789     5247     +458     
===============================================
+ Hits              4224     4708     +484     
+ Misses             565      539      -26     
Files Changed Coverage Δ
tests/app/test_specing.py 100.00% <ø> (ø)
src/keria/app/grouping.py 22.36% <22.36%> (ø)
src/keria/peer/exchanging.py 30.55% <30.55%> (ø)
src/keria/end/ending.py 85.71% <50.00%> (+54.34%) ⬆️
src/keria/app/agenting.py 84.01% <100.00%> (+2.69%) ⬆️
src/keria/app/aiding.py 85.17% <100.00%> (+7.42%) ⬆️
src/keria/app/credentialing.py 79.00% <100.00%> (+0.73%) ⬆️
src/keria/app/notifying.py 100.00% <100.00%> (ø)
src/keria/app/presenting.py 96.61% <100.00%> (+1.69%) ⬆️
src/keria/testing/testing_helper.py 99.29% <100.00%> (ø)
... and 8 more

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lenkan
Copy link
Collaborator

lenkan commented Oct 17, 2023

@kentbull This is great and speeds up the testing flow a great deal. Do you have any plans to merge this?

@kentbull
Copy link
Contributor Author

Though I don't have merge access it would be nice if this was merged.

@lenkan
Copy link
Collaborator

lenkan commented Oct 24, 2023

I am using a different structure than this and have some thoughts... Do you need to use venv and a multi stage build to achieve this? I suggest keeping the single stage build and only separate the dependency and source with layers.

I suggest to use something like this:

FROM python:3.10.4-alpine3.16

RUN apk update && apk add --no-cache alpine-sdk libffi-dev libsodium libsodium-dev bash && curl https://sh.rustup.rs -sSf | bash -s -- -y

WORKDIR /keria
COPY requirements.txt setup.py /keria/
RUN mkdir /keria/src
RUN source "$HOME/.cargo/env" && pip install -r requirements.txt

COPY src/ src/
COPY scripts/keri/ scripts/keri/

ENTRYPOINT [ "keria" ]
CMD ["keria", "start",  "--config-file", "demo-witness-oobis", "--config-dir", "./scripts"]

Arguably, the config with hard coded witness oobis should be left out and provided by whoever starts the image. But that could wait.

@pfeairheller
Copy link
Member

The codecov failures are not accurate here, going to merge.

@pfeairheller pfeairheller merged commit 93b0fb3 into WebOfTrust:development Oct 30, 2023
3 of 5 checks passed
@kentbull kentbull deleted the dockerfile-multistage-build branch February 1, 2024 19:33
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