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

ref(docker): combine test and prod entrypoints into one #7660

Merged
merged 22 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1f47193
ref(docker): combine test and prod entrypoints into one
gustavovalverde Oct 2, 2023
f3c85b4
chore: use 2 spaces insted of 4 for indentation
gustavovalverde Oct 2, 2023
1561aaf
fix: add missing `test-threads` to `fully_synced_rpc_`
gustavovalverde Oct 3, 2023
3c96797
fix: allow 3 arguments instead of 2 to handle `fully_synced_rpc_` cor…
gustavovalverde Oct 3, 2023
b2fd228
chore: remove extra file
gustavovalverde Oct 9, 2023
11d6881
chore: add comments to main parts of the file
gustavovalverde Oct 9, 2023
172c576
fix(ci): just create the `$ZEBRA_CONF_PATH` if `$ENTRYPOINT_FEATURES`…
gustavovalverde Oct 10, 2023
de9f8ea
fix(entrypoint): just print ${ZEBRA_CONF_PATH} if exists
gustavovalverde Oct 10, 2023
b8cafde
fix: missing condition
gustavovalverde Oct 10, 2023
60446c0
ref: handle tests better if `$ENTRYPOINT_FEATURES` is set
gustavovalverde Oct 10, 2023
76e1f90
fix(ci): We just want `ZEBRA_CONF_PATH` to be set in the `release` image
gustavovalverde Oct 11, 2023
a13831c
fix(entrypoint): fix the overall `case` logic
gustavovalverde Oct 11, 2023
4f93887
fix(ci): allos to run with custom config in CI image
gustavovalverde Oct 11, 2023
86302b5
fix(ci): more edgecases
gustavovalverde Oct 11, 2023
0a8f335
fix: we don't need to find files, but subdirectories
gustavovalverde Oct 11, 2023
fba1af4
fix(ci): handle Signal Forwarding and exit codes for `cargo`
gustavovalverde Oct 11, 2023
998687f
fix(ci): parse `fully_synced_rpc_` test correctly
gustavovalverde Oct 11, 2023
efce396
chore: add missing cache dir variable for LWD
gustavovalverde Oct 11, 2023
8fb43ca
fix(entrypoint): handle an arbitrary number of arguments
gustavovalverde Oct 11, 2023
da834f5
fix(entrypoint): handle features list
gustavovalverde Oct 11, 2023
3fe1031
fix(entrypoint): typo
gustavovalverde Oct 11, 2023
a784f34
chore: typo
gustavovalverde Oct 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@
!zebra-*
!zebrad
!docker/entrypoint.sh
!docker/runtime-entrypoint.sh
2 changes: 1 addition & 1 deletion .github/workflows/continous-integration-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ jobs:
run: |
set -ex
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }}
docker run -e NETWORK --detach -e ZEBRA_CONF_PATH --name variable-conf-tests -t ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} -c $ZEBRA_CONF_PATH start
docker run -e NETWORK --detach -e ZEBRA_CONF_PATH --name variable-conf-tests -t ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} zebrad start
EXIT_STATUS=$(docker logs --tail all --follow variable-conf-tests 2>&1 | grep -q --extended-regexp --max-count=1 -e 'v1.0.0-rc.2.toml'; echo $?; )
docker stop variable-conf-tests
docker logs variable-conf-tests
Expand Down
4 changes: 2 additions & 2 deletions book/src/user/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ And after our image has been built, we can run it on `Mainnet` with the followin
docker run --env LOG_COLOR="true" -p 9999:9999 local/zebra.mining
```

Based on our actual `runtime-entrypoint.sh` script, the following configuration file will be generated (on the fly, at startup) and used by Zebra:
Based on our actual `entrypoint.sh` script, the following configuration file will be generated (on the fly, at startup) and used by Zebra:

```toml
[network]
Expand Down Expand Up @@ -80,7 +80,7 @@ endpoint_addr = "127.0.0.1:9999"

- `TEST_FEATURES`: Specifies the features for tests. Example: `"lightwalletd-grpc-tests zebra-checkpoints"`
- `ZEBRA_SKIP_IPV6_TESTS`: Skips IPv6 tests. Example: `1`
- `ENTRYPOINT_FEATURES`: Overrides the specific features used to run tests in `runtime-entrypoint.sh`. Example: `"default-release-binaries lightwalletd-grpc-tests"`
- `ENTRYPOINT_FEATURES`: Overrides the specific features used to run tests in `entrypoint.sh`. Example: `"default-release-binaries lightwalletd-grpc-tests"`

#### CI/CD

Expand Down
13 changes: 9 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,16 @@ RUN rm -r zebra-original
# Build zebrad
RUN cargo build --locked --release --features "${FEATURES}" --package zebrad --bin zebrad

COPY ./docker/runtime-entrypoint.sh /
RUN chmod u+x /runtime-entrypoint.sh
COPY ./docker/entrypoint.sh /
RUN chmod u+x /entrypoint.sh

# This stage is only used when deploying nodes or when only the resulting zebrad binary is needed
#
# To save space, this step starts from scratch using debian, and only adds the resulting
# binary from the `release` stage, and the Zcash Sprout & Sapling parameters from ZCash
FROM debian:bullseye-slim AS runtime
COPY --from=release /opt/zebrad/target/release/zebrad /usr/local/bin
COPY --from=release /runtime-entrypoint.sh /
COPY --from=release /entrypoint.sh /
COPY --from=us-docker.pkg.dev/zfnd-dev-zebra/zebra/zcash-params:edge /root/.zcash-params /root/.zcash-params

RUN apt-get update && \
Expand All @@ -189,9 +189,14 @@ RUN apt-get update && \
ARG FEATURES
ENV FEATURES=${FEATURES}

# Path and name of the config file
ENV ZEBRA_CONF_DIR=/etc/zebrad
ENV ZEBRA_CONF_FILE=zebrad.toml

# Expose configured ports
EXPOSE 8233 18233

# Update the config file based on the Docker run variables,
# and launch zebrad with it
ENTRYPOINT [ "/runtime-entrypoint.sh" ]
ENTRYPOINT [ "/entrypoint.sh" ]
CMD ["zebrad"]
Loading
Loading