Skip to content

Commit

Permalink
Update references from purestake to moonbeam-foundation (#2405)
Browse files Browse the repository at this point in the history
* Update readme to inform about the organization move

* Use new github org

* Update doc with new org

* Updates purestake references

* Adds debug to build

* fix docker secrets

* fix links

* fix docker tagging

* better link

* Removes debug

* typos

* migrate images

* adds tracing migration images

* remove migration

* remove polkadot preparation script

* migrate previous moonbeam sha image

* cleanup migration
  • Loading branch information
crystalin authored Jul 21, 2023
1 parent 80da8fa commit a0b39cb
Show file tree
Hide file tree
Showing 34 changed files with 190 additions and 452 deletions.
94 changes: 24 additions & 70 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ jobs:
echo "git_branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
echo "git_ref=$GITHUB_REF" >> $GITHUB_OUTPUT
fi
echo "repo.full_name: ${{ github.event.pull_request.head.repo.full_name }}"
echo "github.repository: ${{ github.repository }}"
- uses: actions/checkout@v3
with:
ref: ${{ steps.check-git-ref.outputs.git_ref }}
- name: Get Latest RT Release
id: get-latest-rt
run: |
LATEST_RUNTIME_RELEASE=$(curl -s https://api.github.com/repos/purestake/moonbeam/releases | jq -r '.[] | select(.name | test("runtime";"i")) | .tag_name' | head -n 1 | tr -d '[:blank:]') && [[ ! -z "${LATEST_RUNTIME_RELEASE}" ]]
LATEST_RUNTIME_RELEASE=$(curl -s https://api.github.com/repos/moonbeam-foundation/moonbeam/releases | jq -r '.[] | select(.name | test("runtime";"i")) | .tag_name' | head -n 1 | tr -d '[:blank:]') && [[ ! -z "${LATEST_RUNTIME_RELEASE}" ]]
echo $LATEST_RUNTIME_RELEASE
echo "latest_rt=$LATEST_RUNTIME_RELEASE" >> $GITHUB_OUTPUT
- name: Get Sha
Expand All @@ -72,7 +74,7 @@ jobs:
head -1 | sed 's/.*#//' | cut -c1-8)" >> $GITHUB_OUTPUT
echo "polkadot_ver=$(grep 'frame-system' Cargo.toml | sed -nE 's/.*moonbeam-polkadot-v([0-9]+\.[0-9]+\.[0-9]+).*/\1/p' | head -1)" >> $GITHUB_OUTPUT
ENDPOINT="https://api.github.com/repos/PureStake/moonbeam/git/refs/tags/${{ steps.get-latest-rt.outputs.latest_rt }}"
ENDPOINT="https://api.github.com/repos/moonbeam-foundation/moonbeam/git/refs/tags/${{ steps.get-latest-rt.outputs.latest_rt }}"
RESPONSE=$(curl -s -H "Accept: application/vnd.github.v3+json" $ENDPOINT)
TYPE=$(echo $RESPONSE | jq -r '.object.type')
Expand All @@ -94,7 +96,7 @@ jobs:
id: check-docker-image
run: |
TAG=sha-${{ steps.get-sha.outputs.sha8 }}
echo "image_exists=$(docker image inspect purestake/moonbeam:$TAG > /dev/null && echo "true" || echo "false")" >> $GITHUB_OUTPUT
echo "image_exists=$(docker image inspect moonbeamfoundation/moonbeam:$TAG > /dev/null && echo "true" || echo "false")" >> $GITHUB_OUTPUT
- name: Display variables
run: |
echo git_ref: ${{ steps.check-git-ref.outputs.git_ref }}
Expand Down Expand Up @@ -229,67 +231,6 @@ jobs:
- name: Format code with rustfmt
run: cargo fmt -- --check

####### Preparing polkadot binary for parachain tests #######
####### For non-official repo, the script will fail if a new version of
####### polkadot needs to be pushed.
####### This job must not be skipped (otherwise the ts-tests are not run)

prepare-polkadot:
runs-on: bare-metal
needs: ["set-tags"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ needs.set-tags.outputs.git_ref }}
- name: Login to DockerHub
# We should make sure that external PRs can't login to docker,
# but the check to detect if a PR is "external" not work when
# this workflow is trigerred by a push.
if: |
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: index.docker.io
- name: Check & build polkadot docker image
run: |
POLKADOT_REPO=${{ needs.set-tags.outputs.polkadot_repo }}
POLKADOT_COMMIT=${{ needs.set-tags.outputs.polkadot_commit }}
DOCKER_TAG="purestake/moonbase-relay-testnet:sha-$POLKADOT_COMMIT"
POLKADOT_EXISTS=$(docker image inspect $DOCKER_TAG > /dev/null && \
echo "true" || echo "false")
if [[ "$POLKADOT_EXISTS" == "false" ]]; then
# $POLKADOT_COMMIT and $POLKADOT_REPO is used to build the relay image
./scripts/build-alphanet-relay-image.sh
docker push $DOCKER_TAG
fi
- name: Check & prepare para-test docker image
run: |
POLKADOT_REPO=${{ needs.set-tags.outputs.polkadot_repo }}
POLKADOT_COMMIT=${{ needs.set-tags.outputs.polkadot_commit }}
DOCKER_TAG="docker.io/purestake/polkadot-para-tests:sha-$POLKADOT_COMMIT"
POLKADOT_EXISTS=$(docker image inspect $DOCKER_TAG > /dev/null && \
echo "true" || echo "false")
if [[ "$POLKADOT_EXISTS" == "false" ]]; then
mkdir -p build
MOONBEAM_DOCKER_TAG="docker.io/purestake/moonbase-relay-testnet:sha-$POLKADOT_COMMIT"
# Clear the dummy container if it wasn't properly cleaned up
docker rm -f dummy 2> /dev/null | true
docker create --pull always -ti --name dummy $MOONBEAM_DOCKER_TAG bash
docker cp dummy:/usr/local/bin/polkadot build/polkadot
docker rm -f dummy
docker build . --pull --no-cache -f docker/polkadot-para-tests.Dockerfile \
--network=host \
--build-arg HOST_UID="$UID" \
-t $DOCKER_TAG
docker push $DOCKER_TAG
fi
####### Building and Testing binaries #######

cargo-clippy:
Expand Down Expand Up @@ -398,7 +339,7 @@ jobs:
typescript-tests:
runs-on:
labels: bare-metal
needs: ["set-tags", "build", "prepare-polkadot"]
needs: ["set-tags", "build"]
env:
BINARY_PATH: "../build/moonbeam"
steps:
Expand Down Expand Up @@ -473,7 +414,9 @@ jobs:
docker-moonbeam:
runs-on: ubuntu-latest
needs: ["set-tags", "build"]
if: needs.set-tags.outputs.image_exists == false && github.event.pull_request.head.repo.full_name == github.repository
if: |
needs.set-tags.outputs.image_exists == 'false'
&& github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -486,7 +429,7 @@ jobs:
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=purestake/moonbeam
DOCKER_IMAGE=moonbeamfoundation/moonbeam
TAGS="${DOCKER_IMAGE}:sha-${{ needs.set-tags.outputs.sha8 }}"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
Expand All @@ -501,8 +444,8 @@ jobs:
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.MBF_DOCKERHUB_USERNAME }}
password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }}
- name: Build and push moonbeam
id: docker_build
uses: docker/build-push-action@v4
Expand All @@ -520,6 +463,17 @@ jobs:
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Tag it with purestake for 6 month
run: |
PURESTAKE_TAG=`echo "${{ steps.prep.outputs.tags }}" | sed 's/moonbeamfoundation/purestake/'`
docker pull ${{ steps.prep.outputs.tags }}
docker tag ${{ steps.prep.outputs.tags }} $PURESTAKE_TAG
docker push $PURESTAKE_TAG
chopsticks-upgrade-test:
runs-on:
Expand Down Expand Up @@ -605,7 +559,7 @@ jobs:
- name: Retrieve moonbeam binary from docker (for plainSpec generation)
run: |
MOONBEAM_COMMIT=${{ needs.set-tags.outputs.latest_rt_sha8 }}
DOCKER_TAG="purestake/moonbeam:sha-$MOONBEAM_COMMIT"
DOCKER_TAG="moonbeamfoundation/moonbeam:sha-$MOONBEAM_COMMIT"
docker rm -f moonbeam_container 2> /dev/null | true
docker create --name moonbeam_container $DOCKER_TAG bash
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
outputs:
git_branch: ${{ steps.check-git-ref.outputs.git_branch }}
git_ref: ${{ steps.check-git-ref.outputs.git_ref }}
image_exists: ${{ steps.check-docker-image.outputs.image_exists }}
sha: ${{ steps.get-sha.outputs.sha }}
sha8: ${{ steps.get-sha.outputs.sha8 }}
polkadot_repo: ${{ steps.get-sha.outputs.polkadot_repo }}
Expand Down Expand Up @@ -57,7 +56,7 @@ jobs:
- name: Get Latest RT Release
id: get-latest-rt
run: |
LATEST_RUNTIME_RELEASE=$(curl -s https://api.github.com/repos/purestake/moonbeam/releases | jq -r '.[] | select(.name | test("runtime";"i")) | .tag_name' | head -n 1 | tr -d '[:blank:]')
LATEST_RUNTIME_RELEASE=$(curl -s https://api.github.com/repos/moonbeam-foundation/moonbeam/releases | jq -r '.[] | select(.name | test("runtime";"i")) | .tag_name' | head -n 1 | tr -d '[:blank:]')
echo $LATEST_RUNTIME_RELEASE
echo "latest_rt=$LATEST_RUNTIME_RELEASE" >> $GITHUB_OUTPUT
- name: Get Sha
Expand All @@ -69,19 +68,17 @@ jobs:
echo "polkadot_commit=$(egrep -o '/polkadot.*#([^\"]*)' Cargo.lock | \
head -1 | sed 's/.*#//' | cut -c1-8)" >> $GITHUB_OUTPUT
echo "$(curl -s "https://api.github.com/repos/purestake/moonbeam/git/refs/tags/${{ steps.get-latest-rt.outputs.latest_rt }}" | jq -r '.object.sha' | cut -c 1-8)"
echo "latest_rt_sha8=$(curl -s 'https://api.github.com/repos/purestake/moonbeam/git/refs/tags/${{steps.get-latest-rt.outputs.latest_rt }}' | jq -r '.object.sha' | cut -c 1-8 )" >> $GITHUB_OUTPUT
echo "$(curl -s "https://api.github.com/repos/moonbeam-foundation/moonbeam/git/refs/tags/${{ steps.get-latest-rt.outputs.latest_rt }}" | jq -r '.object.sha' | cut -c 1-8)"
echo "latest_rt_sha8=$(curl -s 'https://api.github.com/repos/moonbeam-foundation/moonbeam/git/refs/tags/${{steps.get-latest-rt.outputs.latest_rt }}' | jq -r '.object.sha' | cut -c 1-8 )" >> $GITHUB_OUTPUT
- name: Check existing docker image
id: check-docker-image
run: |
TAG=sha-${{ steps.get-sha.outputs.sha8 }}
echo "image_exists=$(docker manifest inspect purestake/moonbeam:$TAG > /dev/null && echo "true" || echo "false")" >> $GITHUB_OUTPUT
- name: Display variables
run: |
echo git_ref: ${{ steps.check-git-ref.outputs.git_ref }}
echo sha: ${{ steps.get-sha.outputs.sha }}
echo sha8: ${{ steps.get-sha.outputs.sha8 }}
echo image_exists: ${{ steps.check-docker-image.outputs.image_exists }}
echo latest_rt: ${{ steps.get-latest-rt.outputs.latest_rt }}
echo latest_rt_sha8: ${{ steps.get-sha.outputs.latest_rt_sha8 }}
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/prepare-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=purestake/moonbeam
DOCKER_IMAGE=moonbeamfoundation/moonbeam
SHA8="$(git log -1 --format="%H" | cut -c1-8)"
TAGS="${DOCKER_IMAGE}:sha-${SHA8}-opt"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
Expand All @@ -75,8 +75,8 @@ jobs:
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.MBF_DOCKERHUB_USERNAME }}
password: ${{ secrets.MBF_DOCKERHUB_TOKEN }}
- name: Build and push moonbeam
id: docker_build
uses: docker/build-push-action@v4
Expand All @@ -94,3 +94,14 @@ jobs:
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Tag it with purestake for 6 month
run: |
PURESTAKE_TAG=`echo "${{ steps.prep.outputs.tags }}" | sed 's/moonbeamfoundation/purestake/'`
docker pull ${{ steps.prep.outputs.tags }}
docker tag ${{ steps.prep.outputs.tags }} $PURESTAKE_TAG
docker push $PURESTAKE_TAG
16 changes: 16 additions & 0 deletions .github/workflows/publish-docker-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ jobs:
with:
fetch-depth: 0
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.MBF_DOCKERHUB_USERNAME }}
password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }}
- name: Publish runtime docker image
run: |
DOCKER_IMAGE=moonbeamfoundation/moonbeam
DOCKER_TAG="${{ github.event.inputs.tag }}"
COMMIT=`git rev-list -n 1 '${{ github.event.inputs.tag }}'`
SHA=sha-${COMMIT::8}
echo tagging "${DOCKER_IMAGE}:${SHA}"
docker pull "${DOCKER_IMAGE}:${SHA}"
docker tag "${DOCKER_IMAGE}:${SHA}" "${DOCKER_IMAGE}:${DOCKER_TAG}"
docker push "${DOCKER_IMAGE}:${DOCKER_TAG}"
- name: Login to Purestake DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
48 changes: 45 additions & 3 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,48 @@ jobs:
with:
fetch-depth: 0
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.MBF_DOCKERHUB_USERNAME }}
password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }}
- run: |
DOCKER_IMAGE=moonbeamfoundation/moonbeam
VERSION="${{ github.event.inputs.tag }}"
COMMIT=`git rev-list -n 1 '${{ github.event.inputs.tag }}'`
SHA=sha-${COMMIT::8}
echo using "${DOCKER_IMAGE}:${SHA} as base image"
mkdir -p build
wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam -O build/moonbeam
wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam-skylake -O build/moonbeam-skylake
wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam-znver3 -O build/moonbeam-znver3
echo building "${DOCKER_IMAGE}:${VERSION}"
docker build \
--build-arg DOCKER_IMAGE="$DOCKER_IMAGE" \
--build-arg SHA="$SHA" \
-f docker/moonbeam-release.Dockerfile \
-t "${DOCKER_IMAGE}:${VERSION}" \
.
docker push "${DOCKER_IMAGE}:${VERSION}"
if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
MINOR=${VERSION%.*}
echo tagging "${DOCKER_IMAGE}:${MINOR}"
docker tag "${DOCKER_IMAGE}:${VERSION}" "${DOCKER_IMAGE}:${MINOR}"
docker push "${DOCKER_IMAGE}:${MINOR}"
MAJOR=${MINOR%.*}
echo tagging "${DOCKER_IMAGE}:${MAJOR}"
docker tag "${DOCKER_IMAGE}:${VERSION}" "${DOCKER_IMAGE}:${MAJOR}"
docker push "${DOCKER_IMAGE}:${MAJOR}"
echo tagging "${DOCKER_IMAGE}:latest"
docker tag "${DOCKER_IMAGE}:${VERSION}" "${DOCKER_IMAGE}:latest"
docker push "${DOCKER_IMAGE}:latest"
fi
- name: Login to Purestake DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -28,9 +70,9 @@ jobs:
echo using "${DOCKER_IMAGE}:${SHA} as base image"
mkdir -p build
wget https://github.com/PureStake/moonbeam/releases/download/$VERSION/moonbeam -O build/moonbeam
wget https://github.com/PureStake/moonbeam/releases/download/$VERSION/moonbeam-skylake -O build/moonbeam-skylake
wget https://github.com/PureStake/moonbeam/releases/download/$VERSION/moonbeam-znver3 -O build/moonbeam-znver3
wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam -O build/moonbeam
wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam-skylake -O build/moonbeam-skylake
wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam-znver3 -O build/moonbeam-znver3
echo building "${DOCKER_IMAGE}:${VERSION}"
docker build \
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
matrix:
chain: ["moonbase", "moonriver", "moonbeam"]
srtool_image:
- purestake/srtool
- moonbeamfoundation/srtool
srtool_image_tag:
- 1.69.0
steps:
Expand All @@ -45,18 +45,18 @@ jobs:
ref: ${{ github.event.inputs.to }}
- name: Login to DockerHub
uses: docker/[email protected]
if: github.repository == 'purestake/moonbeam'
if: github.repository == 'moonbeam-foundation/moonbeam'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.MBF_DOCKERHUB_USERNAME }}
password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }}
registry: index.docker.io
- name: Download original scripts
uses: actions/download-artifact@v3
with:
name: original-scripts
path: original-scripts
- name: Build & Push purestake/srtool image
if: github.repository == 'purestake/moonbeam'
- name: Build & Push moonbeamfoundation/srtool image
if: github.repository == 'moonbeam-foundation/moonbeam'
run: |
docker pull "${{ matrix.srtool_image }}:${{ matrix.srtool_image_tag }}" && image_exists=true || image_exists=false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upgrade-typescript-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Retrieve moonbeam binary
run: |
COMMIT_SHA8=$(git log -1 --format="%H" | cut -c1-8)
DOCKER_TAG="purestake/moonbeam:sha-$COMMIT_SHA8"
DOCKER_TAG="moonbeamfoundation/moonbeam:sha-$COMMIT_SHA8"
# Clear the dummy container if it wasn't properly cleaned up
docker rm -f dummy 2> /dev/null
docker create -ti --name dummy $DOCKER_TAG bash
Expand Down
Loading

0 comments on commit a0b39cb

Please sign in to comment.