Skip to content

Commit

Permalink
Provides a Release Candidate Image for Releases (#2473)
Browse files Browse the repository at this point in the history
* Adds docker client-rc image on client release
* Adds registry to docker login
* Publish docker of all production binaries
* adds pkg-config to moonbeam production docker
* Force non interactive install
* Adds missing checkout for CI


---------

Co-authored-by: Andrea Giacobino <[email protected]>
  • Loading branch information
crystalin and noandrea authored Nov 16, 2023
1 parent 31dd0f3 commit e610729
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 13 deletions.
36 changes: 35 additions & 1 deletion .github/workflows/publish-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
--build-arg="RUSTFLAGS=-C target-cpu=${{ matrix.cpu }}" \
- < docker/moonbeam-production.Dockerfile
# Copy moonbeam binary
# Copy moonbeam binary
docker rm -f dummy 2> /dev/null | true
docker create -ti --name dummy prod bash
docker cp dummy:/moonbeam/moonbeam moonbeam
Expand Down Expand Up @@ -147,3 +147,37 @@ jobs:
asset_path: build/${{matrix.node}}-${{matrix.cpu}}
asset_name: ${{matrix.node}}-${{matrix.cpu}}
asset_content_type: application/octet-stream

####### Publish Release Candidate Docker Image #######

docker-release-candidate:
runs-on: ubuntu-latest
needs: ["build-binary", "publish-draft-release"]
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/[email protected]
with:
name: binaries
path: build
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.MBF_DOCKERHUB_USERNAME }}
password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }}
registry: index.docker.io
- run: |
DOCKER_IMAGE=purestake/moonbeam
COMMIT=`git rev-list -n 1 '${{ github.event.inputs.to }}'`
SHA=sha-${COMMIT::8}
TAG="${{ github.event.inputs.to }}-rc"
echo building "${DOCKER_IMAGE}:${TAG}"
docker build \
--build-arg DOCKER_IMAGE="$DOCKER_IMAGE" \
--build-arg SHA="$SHA" \
-f docker/moonbeam-release.Dockerfile \
-t "${DOCKER_IMAGE}:${TAG}" \
.
docker push "${DOCKER_IMAGE}:${TAG}"
4 changes: 3 additions & 1 deletion docker/moonbeam-production.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ FROM docker.io/library/ubuntu:20.04 AS builder
ARG COMMIT="master"
ARG RUSTFLAGS=""
ENV RUSTFLAGS=$RUSTFLAGS
ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /

RUN echo "*** Installing Basic dependencies ***"
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates
RUN apt install --assume-yes git clang curl libssl-dev llvm libudev-dev make protobuf-compiler
RUN apt install --assume-yes git clang curl libssl-dev llvm libudev-dev make protobuf-compiler pkg-config

RUN set -e

Expand Down
39 changes: 28 additions & 11 deletions tools/github/print-client-release-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,35 @@ async function main() {
const previousVersion = argv.from;
const newVersion = argv.to;

const commonTemplate = `
- [ ] Start the github action Publish Binary Draft with ${previousVersion} => ${newVersion}
const commonTemplate =
`
- [ ] Start the github action Publish Binary Draft with ${previousVersion} => ${newVersion}
(master branch).
- [ ] Review the generated Draft and clean a bit the messages if needed (keep it draft).
- [ ] Update moonbeam-networks stagenet (moonsama/moonlama) config.json to include sha-xxxxx
(matching your ${newVersion} tag) and increase the config version + 1.
- [ ] Test the new client on stagenet (moonsama/moonlama).
- [ ] Publish the client release draft.
- [ ] When everything is ok, publish the new docker image: start github action Publish Docker
with ${newVersion}.
- [ ] Publish the new tracing image: on repo moonbeam-runtime-overrides, start github action
Publish Docker with ${newVersion} and master.
- \`gh workflow run "Publish Binary Draft" -r 'master' ` +
`-f from=runtime-${previousVersion} -f to=runtime-${newVersion}\`
- [ ] Review the generated Draft and clean a bit the messages if needed (keep it draft).
- [ ] Update moonbeam-networks stagenet (moonsama/moonlama) config.json to include:
- \`\`\`
"binaries": [
{
"docker": "docker.io/moonbeamfoundation/moonbeam:${newVersion}-rc",
"path": "/moonbeam/moonbeam",
"name": "moonbeam"
},
{
"docker": "docker.io/moonbeamfoundation/moonbeam:${newVersion}-rc",
"path": "/moonbeam/moonbeam-skylake",
"name": "moonbeam-skylake"
}
]
\`\`\`
(matching your ${newVersion} tag) and increase the config version + 1.
- [ ] Test the new client on stagenet (moonsama/moonlama).
- [ ] Publish the client release draft.
- [ ] When everything is ok, publish the new docker image: start github action Publish Docker
with ${newVersion}.
- [ ] Publish the new tracing image: on repo moonbeam-runtime-overrides, start github action
Publish Docker with ${newVersion} and master.
`;

// Detect if it's a major release or hotfix
Expand Down

0 comments on commit e610729

Please sign in to comment.