Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
workerbee
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
workerbee
Commits
719f0e57
Commit
719f0e57
authored
1 year ago
by
Bartek Wrona
Committed by
Bartek Wrona
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
testnet docker definition
parent
81c5d9aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Add alternate testnet network with initminer access to the examples to improve user experience with testing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/Dockerfile.testnet
+64
-0
64 additions, 0 deletions
examples/Dockerfile.testnet
with
64 additions
and
0 deletions
examples/Dockerfile.testnet
0 → 100644
+
64
−
0
View file @
719f0e57
# syntax=docker/dockerfile:1.4
ARG HIVE_TESTNET_IMAGE_VERSION=testnet-instance-infinite-post-creator
FROM registry.gitlab.syncad.com/hive/hive/testnet-instance:${HIVE_TESTNET_IMAGE_VERSION} as pure_testnet
USER hived
WORKDIR /home/hived/
ENV PATH="/home/hived/.local/bin:$PATH"
ENV PYPROJECT_DIR=/home/hived/hive-local-tools
ENV TESTNET_GENERATOR_DIR=/home/hived/infinite_post_creator
FROM pure_testnet AS python_tools
# install poetry in an isolated environment
RUN curl -sSL https://install.python-poetry.org | python3 - && \
poetry self update 1.7.1 && \
poetry self add "poetry-dynamic-versioning[plugin]@>=1.0.0,<2.0.0"
FROM python_tools AS python_builder
COPY --chown=hived ./hive/tests/python/hive-local-tools "${PYPROJECT_DIR}"
COPY --chown=hived ./hive/tests/python/functional/comment_payment_tests/infinite_post_creator "${TESTNET_GENERATOR_DIR}"
ENV PIP_DEFAULT_TIMEOUT=300
RUN pushd "${TESTNET_GENERATOR_DIR}" && \
poetry -C "${PYPROJECT_DIR}" env use python3 && \
source $(poetry -C "${PYPROJECT_DIR}" env info --path)/bin/activate && \
python3 -V && \
poetry -C "${PYPROJECT_DIR}" -V && \
poetry -C "${PYPROJECT_DIR}" install && \
mkdir -p /home/hived/pyenv && ln -sf $(poetry -C "${PYPROJECT_DIR}" env info --path) /home/hived/pyenv/hive_venv
RUN cat <<EOF >>/home/hived/start_instance.sh
#! /bin/bash
set -e
source /home/hived/pyenv/hive_venv/bin/activate
cd "\${TESTNET_GENERATOR_DIR}"
python "\${TESTNET_GENERATOR_DIR}/infinite_post_creator.py"
EOF
FROM pure_testnet as runtime
USER hived
WORKDIR /home/hived
SHELL ["/bin/bash", "-c"]
ENV HIVE_BIN_ROOT_PATH="/home/hived/bin"
ENV HIVED_PATH="${HIVE_BIN_ROOT_PATH}/hived"
ENV CLI_WALLET_PATH="${HIVE_BIN_ROOT_PATH}/cli_wallet"
ENV GET_DEV_KEY_PATH="${HIVE_BIN_ROOT_PATH}/get_dev_key"
ENV SIGN_TRANSACTION_PATH="${HIVE_BIN_ROOT_PATH}/sign_transaction"
# copy prepared environment from builder, just to start it
COPY --chown=hived --from=python_builder "${PYPROJECT_DIR}" "${PYPROJECT_DIR}"
COPY --chown=hived --from=python_builder "${TESTNET_GENERATOR_DIR}" "${TESTNET_GENERATOR_DIR}"
COPY --chown=hived --from=python_builder "/home/hived/.cache" "/home/hived/.cache"
COPY --chown=hived --from=python_builder /home/hived/pyenv /home/hived/pyenv
COPY --chmod=755 --chown=hived --from=python_builder "/home/hived/start_instance.sh" "/home/hived/start_instance.sh"
ENTRYPOINT [ "/bin/bash", "-c", "/home/hived/start_instance.sh" ]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment