diff --git a/.github/workflows/dockerhub_release.yml b/.github/workflows/dockerhub_release.yml new file mode 100644 index 0000000..a0a9882 --- /dev/null +++ b/.github/workflows/dockerhub_release.yml @@ -0,0 +1,113 @@ +name: Release - Bump and Publish Version + +## Release automation for chainweb-node +# Designed to run systems in chainweb/binary-release + +## Currently has manual version setting and creates draft releases; +# when we are confident in this process, it can auto-increment and publish non-drafts +# tbd: connect k8s firing mechanism, create and connect chainweb-node-docker update workflow + +run-name: "Release chainweb-node ${{ inputs.release_sha }} from ${{ github.sha}}" +on: + workflow_dispatch: + inputs: + SHORT_SHA: + description: "hash of chainweb-node release, default to branch running this job" + type: string + required: true + VERSION_NEW: + description: "The X.Y.Z tag for the new version" + type: string + required: true + GHC_VERSION: + description: "Input an updated ghc version" + type: string + required: false + workflow_call: + inputs: + SHORT_SHA: + description: "hash of chainweb-node release, default to branch running this job" + type: string + required: true + VERSION_NEW: + description: "The X.Y.Z tag for the new version" + type: string + required: true + GHC_VERSION: + description: "Input an updated ghc version" + type: string + required: false + outputs: + DOCKERHUB_SHA: + description: "The sha of the final dockerhub image" + value: ${{ jobs.Build-Push.outputs.DOCKERHUB_SHA }} + +jobs: + Build-Push: + runs-on: ubuntu-latest + outputs: + DOCKERHUB_SHA: ${{ steps.validate-sha.outputs.DOCKERHUB_SHA }} + steps: + - uses: actions/checkout@v4 + with: + repository: kadena-io/chainweb-node-docker + ssh-key: ${{ secrets.GH_DEPLOYKEY_CHAINWEBDOCKER }} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_PAT }} + + - name: Update Dockerfile reference sha + run: | + echo "DOCKERHUB_SHA=not yet updated" >> $GITHUB_ENV + sed -i -e "s/ARG REVISION=.*/ARG REVISION=${{ inputs.SHORT_SHA }}/" Dockerfile + + - name: Update GHC version if needed + run: | + if [[ ! -z ${{ inputs.GHC_VERSION }} ]]; then + sed -i -e "s/ARG GHCVER=.*/ARG GHCVER=${{ inputs.GHC_VERSION }}/" Dockerfile + fi + cat Dockerfile + - name: Build and push ubuntu image + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64 + push: true + tags: kadena/chainweb-node:${{ inputs.VERSION_NEW }},kadena/chainweb-node:latest + + - name: Test run docker image + run: | + docker run --rm kadena/chainweb-node:${{ inputs.VERSION_NEW }} ./chainweb-node --version + + - name: Update master branch with dockerfile version + run: | + git config --local user.name "Kadena DevOps" + git config --local user.email "devops@kadena.io" + git add Dockerfile + git commit --allow-empty -m "chainweb-node version bump ${{ inputs.VERSION_NEW }}" + # allow empty in case this is a re-run + git status + git tag chainweb-${{ inputs.VERSION_NEW }} + git push + git push --force origin --tags + + - name: Validate SHAs + id: validate-sha + run: | + ## spit these to output + docker pull kadena/chainweb-node:${{ inputs.VERSION_NEW }} + docker pull kadena/chainweb-node:latest + digest1=$(docker inspect kadena/chainweb-node:${{ inputs.VERSION_NEW }} --format '{{ .RepoDigests }}') + digest2=$(docker inspect kadena/chainweb-node:latest --format '{{ .RepoDigests }}') + echo "$digest1 and $digest2" + if [[ "$digest1" != "$digest2" ]]; then + echo "DOCKERHUB_SHA=sha mismatches in dockerhub image" >> $GITHUB_OUTPUT + echo "sha mismatch between pushed images" + exit 1 + fi + echo "Digest compare succeeded, new tags match" + echo "DOCKERHUB_SHA=$digest1" >> $GITHUB_OUTPUT + echo "Pushed to github output" diff --git a/.github/workflows/publish-on-github.yaml b/.github/workflows/publish-on-github.yaml index 18b8a17..91c5bff 100644 --- a/.github/workflows/publish-on-github.yaml +++ b/.github/workflows/publish-on-github.yaml @@ -1,9 +1,5 @@ name: Publish Docker image on: - release: - types: [published] - push: - branchs: [master] workflow_dispatch: inputs: ubuntu_version: diff --git a/Dockerfile b/Dockerfile index 75ceccd..b0970f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,12 +5,12 @@ # --ulimit nofile=64000:64000 # BUILD PARAMTERS -ARG UBUNTUVER=20.04 +ARG UBUNTUVER=22.04 FROM ubuntu:${UBUNTUVER} -ARG REVISION=09b4dc6 -ARG GHCVER=8.10.7 +ARG REVISION=d7aee70 +ARG GHCVER=9.8.2 ARG UBUNTUVER ARG STRIP=1 @@ -20,7 +20,7 @@ LABEL ubuntu="$UBUNTUVER" # install prerequisites RUN apt-get update \ - && apt-get install -y curl xxd openssl binutils libtbb2 libgflags2.2 libsnappy1v5 locales \ + && apt-get install -y curl xxd openssl binutils libtbb2 libgflags2.2 libsnappy1v5 locales libmpfr6 \ && rm -rf /var/lib/apt/lists/* \ && locale-gen en_US.UTF-8 \ && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 @@ -29,7 +29,7 @@ ENV LANG=en_US.UTF-8 # Install chainweb applications WORKDIR /chainweb -RUN curl -Ls "https://kadena-cabal-cache.s3.amazonaws.com/chainweb-node/chainweb.${GHCVER}.ubuntu-${UBUNTUVER}.${REVISION}.tar.gz" \ +RUN curl -Ls "https://kadena-cabal-cache.s3.amazonaws.com/chainweb-node/chainweb.true.${GHCVER}.ubuntu-${UBUNTUVER}.${REVISION}.tar.gz" \ | tar -xzC "/" \ chainweb/chainweb-node \ chainweb/LICENSE \ diff --git a/README.md b/README.md index 5565f8c..5068fa0 100644 --- a/README.md +++ b/README.md @@ -231,22 +231,6 @@ powerful enough to competitively mine on the Kadena Mainnet. Links to alternate mining software can be found [here](https://kadena-io.github.io/kadena-docs/Public-Chain-Docs/#start-mining). -# Enable [Rosetta API](https://www.rosetta-api.org/) - -The chainweb node has optional support for the rosetta API, which can be enabled -by setting the `ROSETTA` environment variable to any non-empty value. - -```sh -docker run \ - --detach \ - --publish 1848:1848 \ - --publish 1789:1789 \ - --env "ROSETTA=1" \ - --name chainweb-node \ - --mount type=volume,source=chainweb-data,target=/data \ - kadena/chainweb-node -``` - # API Overview TODO diff --git a/run-chainweb-node.sh b/run-chainweb-node.sh index 6bfb77a..9a8bbac 100644 --- a/run-chainweb-node.sh +++ b/run-chainweb-node.sh @@ -9,7 +9,6 @@ export CHAINWEB_SERVICE_PORT=${CHAINWEB_SERVICE_PORT:-1848} export LOGLEVEL=${LOGLEVEL:-warn} export MINER_KEY=${MINER_KEY:-} export MINER_ACCOUNT=${MINER_ACCOUNT:-$MINER_KEY} -export ENABLE_ROSETTA=${ENABLE_ROSETTA:-} export SKIP_REACHABILITY_CHECK=${SKIP_REACHABILITY_CHECK:-0} if [[ -z "$CHAINWEB_P2P_HOST" ]] ; then @@ -59,15 +58,6 @@ chainweb: " fi -# ############################################################################ # -# Flags - -if [[ -n "$ROSETTA" ]] ; then - ROSETTA_FLAG="--rosetta" -else - ROSETTA_FLAG="--no-rosetta" -fi - # ############################################################################ # # Run node @@ -77,7 +67,6 @@ exec ./chainweb-node \ --p2p-hostname="$CHAINWEB_P2P_HOST" \ --p2p-port="$CHAINWEB_P2P_PORT" \ --service-port="$CHAINWEB_SERVICE_PORT" \ - "$ROSETTA_FLAG" \ --log-level="$LOGLEVEL" \ +RTS -N -t -A64M -H500M -RTS \ "$@"