Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
Create create-dev-dappnode-image command
Browse files Browse the repository at this point in the history
  • Loading branch information
cburgdorf committed Sep 11, 2020
1 parent 8db3e5d commit 2cfe64d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 10 deletions.
11 changes: 11 additions & 0 deletions Makefile
Expand Up @@ -88,6 +88,17 @@ create-dappnode-image: clean
cd ./dappnode && dappnodesdk increase $(dappnode_bump)
cd ./dappnode && dappnodesdk build

create-dev-dappnode-image: clean
# There's currently no way for us to cut dev releases from local files other than pushing these
# to GitHub first and then fetching from there. This takes the commit from the current HEAD and
# pushes it into a `dappnode_<shortref>` branch in the provided repository (e.g cburgdorf/trinity).
git push https://github.com/$(repository).git $(shell git rev-parse HEAD):refs/heads/dappnode_$(shell git rev-parse --short HEAD)
sed -i -e 's@ARG GIT_REPOSITORY=.*@ARG GIT_REPOSITORY=$(repository)@g' ./dappnode/build/Dockerfile
sed -i -e 's/ARG GITREF=.*/ARG GITREF=dappnode_$(shell git rev-parse --short HEAD)/g' ./dappnode/build/Dockerfile
cd ./dappnode && dappnodesdk increase patch
cd ./dappnode && dappnodesdk build


sdist: clean
python setup.py sdist bdist_wheel
ls -l dist
Expand Down
5 changes: 2 additions & 3 deletions dappnode/build/Dockerfile
Expand Up @@ -2,15 +2,14 @@ FROM python:3.7

WORKDIR /usr/src/app

COPY . /usr/src/app

# Install deps
RUN apt-get update
RUN apt-get -y install libsnappy-dev gcc g++ cmake

ARG GIT_REPOSITORY=ethereum/trinity
ARG GITREF=v0.1.0-alpha.36

RUN git clone https://github.com/ethereum/trinity.git
RUN git clone https://github.com/$GIT_REPOSITORY.git
RUN cd trinity && git checkout $GITREF && pip install -e .[dev] --no-cache-dir

EXPOSE 30303 30303/udp
Expand Down
33 changes: 26 additions & 7 deletions docs/contributing.rst
Expand Up @@ -197,13 +197,13 @@ Prerequisites:
make create-dappnode-image trinity_version=<version> dappnode_bump=<major|minor|patch>
Please note that the dappnode image follows it's own versioning and that the `trinity_version`
must refer to either a `tag` or a `commit` from this repository. The `dappnode_bump` must be
either `major`, `minor` or `patch` and should be chosen as follows:
Please note that the dappnode image follows its own versioning and that the ``trinity_version``
must refer to either a ``tag`` or a ``commit`` from this repository. The ``dappnode_bump`` must be
either ``major``, ``minor`` or ``patch`` and should be chosen as follows:

- If the only change in the image is the pinned Trinity version, it should bump the same part
as the Trinity version bump. E.g. if the image carries a new Trinity patch version, then the
dappnode image should also be created with `dappnode_bump=patch`.
dappnode image should also be created with ``dappnode_bump=patch``.

- If the image contains other changes (e.g. a fix in the dappnode image itself), then the
traditional semver rules apply.
Expand All @@ -216,8 +216,27 @@ Use the reported `Install link` to install the image on a DappNode.

If the image works as intended, publish it to the APM registry using the Dappnode UI.

- Dappnode Package Name: `trinity.public.dappnode.eth`
- Next version: `<version-of-dappnode-image>`
- Manifest hash: `<manifest-hash-as-reported-on-the-console>`
- Dappnode Package Name: ``trinity.public.dappnode.eth``
- Next version: ``<version-of-dappnode-image>``
- Manifest hash: ``<manifest-hash-as-reported-on-the-console>``

Use MetaMask to publish the transaction and wait for it to get included in the chain.


How to release *development* dappnode images
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

There's currently no way to create a dappnode package directly from the local source code without it touching
GitHub first. The following command pushes the current ``HEAD`` commit into the specified GitHub repository
under the branch name ``dappnode_<short-ref-of-head>``. It then builds a DappNode package that fetches the code
from that branch.

1. Create the package by invoking the command with a specified repository (e. g ``repository=cburgdorf/trinity``)

.. code:: sh
make create-dev-dappnode-image repository=<github-account>/<github-repo>
2. Ensure the image can be installed and works

Use the reported `Install link` to install the image on a DappNode.
2 changes: 2 additions & 0 deletions newsfragments/2030.doc.rst
@@ -0,0 +1,2 @@
Create ``make create-dev-dappnode-image`` command to make the creation of temporary
dappnode packages easier and reduce the chances of human error.

0 comments on commit 2cfe64d

Please sign in to comment.