Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #994 from EOSIO/merging_master
Browse files Browse the repository at this point in the history
Merging master into release/22.0.x
  • Loading branch information
Brad Hart authored Jul 12, 2021
2 parents f05d9e8 + 370b9e8 commit 9ccdb11
Show file tree
Hide file tree
Showing 9 changed files with 609 additions and 209 deletions.
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "develop"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "release/22.0.x"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "release/22.1.x"
36 changes: 19 additions & 17 deletions .github/eosjs-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,51 @@
ARG EOSBRANCH=develop
ARG CDTBRANCH=develop
FROM eosio/eosio.cdt:${CDTBRANCH} as contracts
ARG CDTBRANCH
WORKDIR /root
### base
RUN apt-get update \
&& apt-get install -yq curl git

RUN git clone https://github.com/EOSIO/eos \
&& cd eos \
&& git checkout develop
&& git checkout develop \
&& mkdir -p /root/contracts/eosio.bios/ && mv ./contracts/contracts/eosio.bios/bin/* /root/contracts/eosio.bios/ \
&& mkdir -p /root/contracts/eosio.boot/ && mv ./contracts/contracts/eosio.boot/bin/* /root/contracts/eosio.boot/ \
&& mkdir -p /root/contracts/eosio.system/ && mv ./unittests/contracts/eosio.system/* /root/contracts/eosio.system/ \
&& mkdir -p /root/contracts/eosio.msig/ && mv ./unittests/contracts/eosio.msig/* /root/contracts/eosio.msig/ \
&& mkdir -p /root/contracts/eosio.token/ && mv ./unittests/contracts/eosio.token/* /root/contracts/eosio.token/

RUN git clone https://github.com/EOSIO/eosio.cdt \
&& cd eosio.cdt \
&& git checkout develop \
&& mkdir build && cd build && mkdir read_only_query_tests && cd .. \
&& eosio-cpp -abigen ./tests/unit/test_contracts/read_only_query_tests.cpp -o ./build/read_only_query_tests/read_only_query_tests.wasm
&& mkdir -p build/read_only_query_tests/ \
&& eosio-cpp -abigen ./tests/unit/test_contracts/read_only_query_tests.cpp -o ./build/read_only_query_tests/read_only_query_tests.wasm \
&& mkdir -p /root/contracts/read_only_query_tests/ && mv ./build/read_only_query_tests/* /root/contracts/read_only_query_tests/

RUN git clone https://github.com/EOSIO/key-value-example-app.git \
&& cd key-value-example-app \
&& eosio-cpp -abigen ./contracts/kv_todo/src/kv_todo.cpp -o ./contracts/kv_todo/build/kv_todo.wasm -R ./contracts/kv_todo/ricardian/ -I ./contracts/kv_todo/include/
&& eosio-cpp -abigen ./contracts/kv_todo/src/kv_todo.cpp -o ./contracts/kv_todo/build/kv_todo.wasm -R ./contracts/kv_todo/ricardian/ -I ./contracts/kv_todo/include/ \
&& mkdir -p /root/contracts/kv_todo/ && mv ./contracts/kv_todo/build/* /root/contracts/kv_todo/

RUN git clone https://github.com/EOSIO/return-values-example-app.git \
&& cd return-values-example-app \
&& eosio-cpp -abigen ./contracts/action_return_value/src/action_return_value.cpp -o ./contracts/action_return_value/build/action_return_value.wasm -R ./contracts/action_return_value/ricardian/
&& eosio-cpp -abigen ./contracts/action_return_value/src/action_return_value.cpp -o ./contracts/action_return_value/build/action_return_value.wasm -R ./contracts/action_return_value/ricardian/ \
&& mkdir -p /root/contracts/action_return_value/ && mv ./contracts/action_return_value/build/* /root/contracts/action_return_value/

RUN mkdir cfhello
COPY ./contracts/cfhello.cpp /root/cfhello
RUN cd cfhello \
&& mkdir build \
&& eosio-cpp -abigen ./cfhello.cpp -o ./build/cfhello.wasm
&& eosio-cpp -abigen ./cfhello.cpp -o ./build/cfhello.wasm \
&& mkdir -p /root/contracts/cfhello/ && mv ./build/* /root/contracts/cfhello/

FROM eosio/eosio:${EOSBRANCH}
ARG EOSBRANCH
ENTRYPOINT ["nodeos", "--data-dir", "/root/.local/share", "-e", "-p", "eosio", "--replay-blockchain", "--plugin", "eosio::producer_plugin", "--plugin", "eosio::producer_api_plugin", "--plugin", "eosio::chain_api_plugin", "--plugin", "eosio::trace_api_plugin", "--trace-no-abis", "--plugin", "eosio::db_size_api_plugin", "--plugin", "eosio::http_plugin", "--http-server-address=0.0.0.0:8888", "--access-control-allow-origin=*", "--contracts-console", "--http-validate-host=false", "--enable-account-queries=true", "--verbose-http-errors", "--max-transaction-time=100"]
WORKDIR /root
RUN mkdir -p "/opt/eosio/bin/contracts"
COPY --from=contracts /root/eos/contracts/contracts/eosio.bios/bin/* /opt/eosio/bin/contracts/eosio.bios/
COPY --from=contracts /root/eos/contracts/contracts/eosio.boot/bin/* /opt/eosio/bin/contracts/eosio.boot/
COPY --from=contracts /root/eos/unittests/contracts/eosio.system/* /opt/eosio/bin/contracts/eosio.system/
COPY --from=contracts /root/eos/unittests/contracts/eosio.msig/* /opt/eosio/bin/contracts/eosio.msig/
COPY --from=contracts /root/eos/unittests/contracts/eosio.token/* /opt/eosio/bin/contracts/eosio.token/
COPY --from=contracts /root/eosio.cdt/build/read_only_query_tests/* /opt/eosio/bin/contracts/read_only_query_tests/
COPY --from=contracts /root/key-value-example-app/contracts/kv_todo/build/* /opt/eosio/bin/contracts/kv_todo/
COPY --from=contracts /root/return-values-example-app/contracts/action_return_value/build/* /opt/eosio/bin/contracts/action_return_value/
COPY --from=contracts /root/cfhello/build/* /opt/eosio/bin/contracts/cfhello/
COPY --from=contracts /root/contracts /opt/eosio/bin/contracts/
COPY ./ /opt/eosio/bin/

RUN mkdir -p "/opt/eosio/bin/config-dir"
RUN /bin/bash /opt/eosio/bin/scripts/deploy_contracts.sh
RUN /bin/bash /opt/eosio/bin/scripts/deploy_contracts.sh "$EOSBRANCH"
45 changes: 24 additions & 21 deletions .github/eosjs-ci/scripts/deploy_contracts.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
NODEOS_RUNNING=$1
EOS_BRANCH=$1
echo $EOS_BRANCH

set -m

Expand Down Expand Up @@ -109,9 +110,8 @@ mkdir -p $CONFIG_DIR
mkdir -p $BLOCKCHAIN_DATA_DIR
mkdir -p $BLOCKCHAIN_CONFIG_DIR

if [ -z "$NODEOS_RUNNING" ]; then
echo "Starting the chain for setup"
nodeos -e -p eosio \
echo "Starting the chain for setup"
nodeos -e -p eosio \
--data-dir $BLOCKCHAIN_DATA_DIR \
--config-dir $BLOCKCHAIN_CONFIG_DIR \
--http-validate-host=false \
Expand All @@ -127,7 +127,6 @@ if [ -z "$NODEOS_RUNNING" ]; then
--enable-account-queries=true \
--max-transaction-time=100000 \
--verbose-http-errors &
fi

mkdir -p "$CONFIG_DIR"/keys

Expand Down Expand Up @@ -178,6 +177,8 @@ sleep 1s
activate_feature "299dcb6af692324b899b39f16d5a530a33062804e41f09dc97e9f156b4476707"
activate_feature "825ee6288fb1373eab1b5187ec2f04f6eacb39cb3a97f356a07c91622dd61d16"
activate_feature "c3a6138c5061cf291310887c0b5c71fcaffeab90d5deb50d3b9e687cead45071"
activate_feature "bf61537fd21c61a60e542a5d66c3f6a78da0589336868307f94a82bccea84e88"
activate_feature "5443fcf88330c586bc0e5f3dee10e7f63c76c00249c87fe4fbf7f38c082006b4"
activate_feature "4e7bf348da00a945489b2a681749eb56f5de00b900014e137ddae39f48f69d67"
activate_feature "f0af56d2c5a48d60a4a5b5c903edfb7db3a736a94ed589d0b797df33ff9d3e1d"
activate_feature "2652f5f96006294109b3dd0bbde63693f55324af452b799ee137a81a905eed25"
Expand All @@ -188,9 +189,9 @@ activate_feature "e0fb64b1085cc5538970158d05a009c24e276fb94e1a0bf6a528b48fbc4ff5
activate_feature "ef43112c6543b88db2283a2e077278c315ae2c84719a8b25f25cc88565fbea99"
activate_feature "4a90c00d55454dc5b059055ca213579c6ea856967712a56017487886a4d4cc0f"
activate_feature "1a99a59d87e06e09ec5b028a9cbb7749b4a5ad8819004365d02dc4379a8b7241"
activate_feature "bf61537fd21c61a60e542a5d66c3f6a78da0589336868307f94a82bccea84e88"
activate_feature "5443fcf88330c586bc0e5f3dee10e7f63c76c00249c87fe4fbf7f38c082006b4"
activate_feature "808c49387292c34ccb3970e00b08a690b6b3370c1cbcec46d46c19d5dfafab03"
if [ $EOSBRANCH = "release_2.2.x" ] || [ $EOSBRANCH = "develop" ]; then
activate_feature "808c49387292c34ccb3970e00b08a690b6b3370c1cbcec46d46c19d5dfafab03"
fi

sleep 1s
setabi eosio $CONTRACTS_DIR/eosio.bios/eosio.bios.abi
Expand All @@ -200,10 +201,6 @@ sleep 1s
cleos push action eosio setkvparams '[{"max_key_size":1024, "max_value_size":4096, "max_iterators":1024}]' -p eosio@active
cleos push action eosio setpparams '["01110000400100000000"]' -p eosio@active

sleep 1s
setabi cfhello $CONTRACTS_DIR/cfhello/cfhello.abi
setcode cfhello $CONTRACTS_DIR/cfhello/cfhello.wasm

sleep 1s
setabi todo $CONTRACTS_DIR/kv_todo/kv_todo.abi
setcode todo $CONTRACTS_DIR/kv_todo/kv_todo.wasm
Expand All @@ -213,8 +210,14 @@ setabi returnvalue $CONTRACTS_DIR/action_return_value/action_return_value.abi
setcode returnvalue $CONTRACTS_DIR/action_return_value/action_return_value.wasm

sleep 1s
setabi readonly $CONTRACTS_DIR/read_only_query_tests/read_only_query_tests.abi
setcode readonly $CONTRACTS_DIR/read_only_query_tests/read_only_query_tests.wasm
setabi cfhello $CONTRACTS_DIR/cfhello/cfhello.abi
setcode cfhello $CONTRACTS_DIR/cfhello/cfhello.wasm

if [ $EOSBRANCH = "release_2.2.x" ] || [ $EOSBRANCH = "develop" ]; then
sleep 1s
setabi readonly $CONTRACTS_DIR/read_only_query_tests/read_only_query_tests.abi
setcode readonly $CONTRACTS_DIR/read_only_query_tests/read_only_query_tests.wasm
fi

sleep 1s
setabi eosio.msig $CONTRACTS_DIR/eosio.msig/eosio.msig.abi
Expand Down Expand Up @@ -249,13 +252,13 @@ cleos push action todo upsert '["bf581bee-9f2c-447b-94ad-78e4984b6f51", "todo",
cleos push action todo upsert '["b7b0d09d-a82b-44d9-b067-3bae2d02917e", "todo", "Start Blockchain", false]' -p todo@active
cleos push action todo upsert '["ac8acfe7-cd4e-4d22-8400-218b697a4517", "todo", "Deploy Hello World Contract", false]' -p todo@active

cleos push action readonly setup '[]' -p readonly@active
if [ $EOSBRANCH = "release_2.2.x" ] || [ $EOSBRANCH = "develop" ]; then
cleos push action readonly setup '[]' -p readonly@active
fi

echo "All done initializing the blockchain"

if [[ -z $NODEOS_RUNNING ]]; then
echo "Shut down Nodeos, sleeping for 2 seconds to allow time for at least 4 blocks to be created after deploying contracts"
sleep 2s
kill %1
fg %1
fi
echo "Shut down Nodeos, sleeping for 2 seconds to allow time for at least 4 blocks to be created after deploying contracts"
sleep 2s
kill %1
fg %1
35 changes: 0 additions & 35 deletions .github/workflows/build-docker-develop.yml

This file was deleted.

161 changes: 161 additions & 0 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: Build Docker Images
on:
schedule:
- cron: "0 2 * * *"
workflow_dispatch:

jobs:
build-docker-2_1_x:
name: Build Docker - nodeos release/2.1.x
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
token: ${{ github.token }}
- name: Get nodeos sha
id: nodeos
uses: actions/github-script@v3
with:
script: |
const nodeosVersion = 'v2.1.';
const releaseList = await github.paginate('GET /repos/eosio/eos/releases');
const releases = releaseList.map(release => {
return {
tag: release.tag_name,
published_at: new Date(release.published_at),
};
})
.filter(release => release.tag.startsWith(nodeosVersion))
.sort((a, b) => b.published_at - a.published_at);
const tagList = await github.paginate('GET /repos/eosio/eos/tags');
const tag = tagList.filter(tag => tag.name === releases[0].tag);
return tag[0].commit.sha;
- name: Nodeos sha
id: nodeos-sha
run: |
SHA=$(echo "${NODEOS_SHA_FROM_JS}" | tr -d '"')
echo ::set-output name=NODEOS_SHA::${SHA}
env:
NODEOS_SHA_FROM_JS: ${{ steps.nodeos.outputs.result }}
- name: Set up QEMU
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@0d135e0c2fc0dba0729c1a47ecfcf5a3c7f8579e
- name: Login to DockerHub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: ./.github/eosjs-ci
file: ./.github/eosjs-ci/Dockerfile
pull: true
push: true
no-cache: true
build-args: |
EOSBRANCH=release_2.1.x
CDTBRANCH=release_1.8.x
tags: |
eosio/eosjs-ci:release_2.1.x
eosio/eosjs-ci:${{ steps.nodeos-sha.outputs.NODEOS_SHA }}
build-docker-2_2_x:
name: Build Docker - nodeos release/2.2.x
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
token: ${{ github.token }}
- name: Get nodeos sha
id: nodeos
uses: actions/github-script@v3
with:
script: |
const nodeosVersion = 'v2.2.';
const releaseList = await github.paginate('GET /repos/eosio/eos/releases');
const releases = releaseList.map(release => {
return {
tag: release.tag_name,
published_at: new Date(release.published_at),
};
})
.filter(release => release.tag.startsWith(nodeosVersion))
.sort((a, b) => b.published_at - a.published_at);
const tagList = await github.paginate('GET /repos/eosio/eos/tags');
const tag = tagList.filter(tag => tag.name === releases[0].tag);
return tag[0].commit.sha;
- name: Nodeos sha
id: nodeos-sha
run: |
SHA=$(echo "${NODEOS_SHA_FROM_JS}" | tr -d '"')
echo ::set-output name=NODEOS_SHA::${SHA}
env:
NODEOS_SHA_FROM_JS: ${{ steps.nodeos.outputs.result }}
- name: Set up QEMU
uses: docker/setup-qemu-action@c308fdd69d26ed66f4506ebd74b180abe5362145
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@0d135e0c2fc0dba0729c1a47ecfcf5a3c7f8579e
- name: Login to DockerHub
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@e1b7f96249f2e4c8e4ac1519b9608c0d48944a1f
with:
context: ./.github/eosjs-ci
file: ./.github/eosjs-ci/Dockerfile
pull: true
push: true
no-cache: true
build-args: |
EOSBRANCH=release_2.2.x
CDTBRANCH=release_1.8.x
tags: |
eosio/eosjs-ci:release_2.2.x
eosio/eosjs-ci:${{ steps.nodeos-sha.outputs.NODEOS_SHA }}
build-docker-develop:
name: Build Docker - nodeos develop
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
token: ${{ github.token }}
- name: Get nodeos sha
id: nodeos
uses: actions/github-script@v3
with:
script: |
const developRef = await github.request('GET /repos/eosio/eos/git/refs/heads/develop');
return developRef.data.object.sha;
- name: Nodeos sha
id: nodeos-sha
run: |
SHA=$(echo "${NODEOS_SHA_FROM_JS}" | tr -d '"')
echo ::set-output name=NODEOS_SHA::${SHA}
env:
NODEOS_SHA_FROM_JS: ${{ steps.nodeos.outputs.result }}
- name: Set up QEMU
uses: docker/setup-qemu-action@c308fdd69d26ed66f4506ebd74b180abe5362145
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@0d135e0c2fc0dba0729c1a47ecfcf5a3c7f8579e
- name: Login to DockerHub
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@e1b7f96249f2e4c8e4ac1519b9608c0d48944a1f
with:
context: ./.github/eosjs-ci
file: ./.github/eosjs-ci/Dockerfile
pull: true
push: true
no-cache: true
tags: |
eosio/eosjs-ci:develop
eosio/eosjs-ci:${{ steps.nodeos-sha.outputs.NODEOS_SHA }}
Loading

0 comments on commit 9ccdb11

Please sign in to comment.