Skip to content
Snippets Groups Projects
Verified Commit 70a55b6d authored by Mateusz Żebrak's avatar Mateusz Żebrak
Browse files

Adjust dockerfile to the latest changes in images from hived

Due to latest changes in hived docker images:
- git was removed, so we no longer require it in dockerfile
  (previously it was required for poetry install and
  poetry dynamic-versioning commands. It was fixed by
  embedded_testnet_instance installing only dev packages
  via the --no-root switch, so it requires already installed clive
  from previous stage)
- need to install libboost-all-dev because wax requires it
- need to install poetry just for the embedded_testnet_instance
  (so we can supplement with dev dependencies only. We also create venv
  by python3-venv instead of poetry now)
parent da819c44
No related branches found
No related tags found
2 merge requests!233V1.27.5.3 release,!222Bump hive & wax
...@@ -22,14 +22,22 @@ COPY --from=beekeper_source --chown=hived_admin:users "/home/hived/bin/beekeeper ...@@ -22,14 +22,22 @@ COPY --from=beekeper_source --chown=hived_admin:users "/home/hived/bin/beekeeper
# crucial for proper display # crucial for proper display
ENV COLORTERM=truecolor ENV COLORTERM=truecolor
# libboost-all-dev is required for wax
RUN sudo apt-get update && \
sudo apt-get install -y python3-venv libboost-all-dev && \
sudo apt-get clean && \
sudo rm -rf /var/lib/apt/lists/*
# create and use python virtualenv
ENV PYTHON_VENV_PATH="/clive/venv"
RUN python3 -m venv ${PYTHON_VENV_PATH}
ENV PATH="${PYTHON_VENV_PATH}/bin:$PATH" VIRTUAL_ENV=${PYTHON_VENV_PATH}
FROM common as instance FROM common as instance
ARG CLIVE_VERSION ARG CLIVE_VERSION
RUN poetry env use python3
RUN source "$(poetry env info --path)/bin/activate"
# Project IDS: # Project IDS:
# - 362 -> schemas # - 362 -> schemas
# - 392 -> clive # - 392 -> clive
...@@ -45,7 +53,7 @@ ENTRYPOINT ["/home/hived_admin/entrypoint.sh"] ...@@ -45,7 +53,7 @@ ENTRYPOINT ["/home/hived_admin/entrypoint.sh"]
# this target should be built using a testnet hived image as a base (to have embedded testnet) # this target should be built using a testnet hived image as a base (to have embedded testnet)
FROM common as embedded_testnet_instance FROM instance as embedded_testnet_instance
ARG CLIVE_SECRETS__DEFAULT_KEY="5KTNAYSHVzhnVPrwHpKhc5QqNQt6aW8JsrMT7T4hyrKydzYvYik" ARG CLIVE_SECRETS__DEFAULT_KEY="5KTNAYSHVzhnVPrwHpKhc5QqNQt6aW8JsrMT7T4hyrKydzYvYik"
ENV CLIVE_SECRETS__DEFAULT_KEY=${CLIVE_SECRETS__DEFAULT_KEY} ENV CLIVE_SECRETS__DEFAULT_KEY=${CLIVE_SECRETS__DEFAULT_KEY}
...@@ -58,9 +66,11 @@ ENV CLI_WALLET_PATH="/home/hived/bin/cli_wallet" ...@@ -58,9 +66,11 @@ ENV CLI_WALLET_PATH="/home/hived/bin/cli_wallet"
ENV GET_DEV_KEY_PATH="/home/hived/bin/get_dev_key" ENV GET_DEV_KEY_PATH="/home/hived/bin/get_dev_key"
ENV COMPRESS_BLOCK_LOG_PATH="/home/hived/bin/compress_block_log" ENV COMPRESS_BLOCK_LOG_PATH="/home/hived/bin/compress_block_log"
RUN curl -sSL https://install.python-poetry.org | python3 - --version 1.7.0
ENV PATH="/home/hived_admin/.local/bin:$PATH"
# Run dev installation to supplement with development dependencies # Run dev installation to supplement with development dependencies
RUN poetry install RUN poetry install --no-root
RUN poetry dynamic-versioning # Substitute versions because of https://github.com/mtkennerly/poetry-dynamic-versioning/issues/25#issuecomment-698193152, has to be done after installation otherwise pip will show "dirty" version
ENV TESTNET_MODE=1 ENV TESTNET_MODE=1
......
...@@ -57,9 +57,6 @@ while [ $# -gt 0 ]; do ...@@ -57,9 +57,6 @@ while [ $# -gt 0 ]; do
shift shift
done done
# Activate the virtual environment
source $(poetry env info --path)/bin/activate
if [ "${TESTNET_MODE}" = "0" ]; then if [ "${TESTNET_MODE}" = "0" ]; then
if [ "${INTERACTIVE_CLI_MODE}" = "0" ]; then if [ "${INTERACTIVE_CLI_MODE}" = "0" ]; then
echo "Launching clive in TUI mode on mainnet" echo "Launching clive in TUI mode on mainnet"
......
...@@ -28,7 +28,7 @@ print_help () { ...@@ -28,7 +28,7 @@ print_help () {
echo "OPTIONS:" echo "OPTIONS:"
echo " --beekeeper-source-image=image_name Allows to specify image name containing a prebuilt beekeper tool" echo " --beekeeper-source-image=image_name Allows to specify image name containing a prebuilt beekeper tool"
echo " --base-image=image_name Allows to specify an image name being use as a base of the one to be built" echo " --base-image=image_name Allows to specify an image name being use as a base of the one to be built"
echo " --clive-version=version Allows to specify a version of clive to be installed in the image (omitted if --embedded-testnet is used)" echo " --clive-version=version Allows to specify a version of clive to be installed in the image"
echo " --embedded-testnet Allows to build a clive image having embedded a hived testnet inside (ready for immediate sanboxing run)" echo " --embedded-testnet Allows to build a clive image having embedded a hived testnet inside (ready for immediate sanboxing run)"
echo " --image-path-suffix Allows to specify a suffix to be added to the image path, to organize images in a more structured directory-like way" echo " --image-path-suffix Allows to specify a suffix to be added to the image path, to organize images in a more structured directory-like way"
echo " --help Display this help screen and exit" echo " --help Display this help screen and exit"
...@@ -86,14 +86,7 @@ TST_REGISTRY=${REGISTRY:?"Missing arg #3 to specify target container registry"} ...@@ -86,14 +86,7 @@ TST_REGISTRY=${REGISTRY:?"Missing arg #3 to specify target container registry"}
TST_BEEKEEPER_IMAGE=${BEEKEEPER_IMAGE:?"Missing --beekeeper-source-image to specify beekeeper binary source"} TST_BEEKEEPER_IMAGE=${BEEKEEPER_IMAGE:?"Missing --beekeeper-source-image to specify beekeeper binary source"}
TST_BASE_IMAGE=${BASE_IMAGE:?"Missing --base-image option to specify base image"} TST_BASE_IMAGE=${BASE_IMAGE:?"Missing --base-image option to specify base image"}
TST_CLIVE_VERSION=${CLIVE_VERSION:?"Missing --clive-version option to specify clive version to be installed"}
if [ -z "$CLIVE_VERSION" ] && [ "$DOCKER_TARGET" != "embedded_testnet_instance" ];
then
echo "ERROR: Missing --clive-version option to specify clive version to be installed"
echo
print_help
exit 2
fi
# Supplement a registry path by trailing slash (if needed) # Supplement a registry path by trailing slash (if needed)
[[ "${REGISTRY}" != */ ]] && REGISTRY="${REGISTRY}/" [[ "${REGISTRY}" != */ ]] && REGISTRY="${REGISTRY}/"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment