From 0019c97491b015e6b360588395492b6d78dcc85a Mon Sep 17 00:00:00 2001 From: Logesh <55389513+logesh2496@users.noreply.github.com> Date: Wed, 22 Jun 2022 13:03:27 +0530 Subject: [PATCH 01/14] feat: create docker github actions --- .github/workflows/docker.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..2a2e9f1 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --tag paritytech/ci-linux:974ba3ac-20201006 From 5f76f6113f204f5c1c335f6d5addc8a0b04002e0 Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Wed, 22 Jun 2022 15:48:08 +0530 Subject: [PATCH 02/14] fix: add dockerfile --- Dockerfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..be76c4e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +# FROM rust:buster as builder +# WORKDIR /app + +# RUN rustup default nightly-2022-02-19 && \ +# rustup target add wasm32-unknown-unknown --toolchain nightly-2022-02-19 + +# RUN apt-get update && \ +# apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ +# apt-get install -y cmake pkg-config libssl-dev git clang libclang-dev + +# COPY . . + +# RUN cargo build --release && ./target/release/node-template --dev --ws-external + +# ENTRYPOINT ["tail", "-f", "/dev/null"] + +# # ============= + +FROM rustlang/rust:nightly + +WORKDIR /app + +RUN apt-get update -y && \ + apt-get install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev + +RUN rustup target add wasm32-unknown-unknown + +COPY . . + +RUN cargo build --release && ./target/release/node-template --dev --ws-external + +# ENTRYPOINT ["tail", "-f", "/dev/null"] \ No newline at end of file From af295f66ee4817bc58b87baffb8e3e653f114705 Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Wed, 22 Jun 2022 17:11:57 +0530 Subject: [PATCH 03/14] fix: ignore running the node cmd --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index be76c4e..71274de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,7 @@ RUN rustup target add wasm32-unknown-unknown COPY . . -RUN cargo build --release && ./target/release/node-template --dev --ws-external +RUN cargo build --release +# && ./target/release/node-template --dev --ws-external # ENTRYPOINT ["tail", "-f", "/dev/null"] \ No newline at end of file From 02cddea10120fce0235135190ee97882a44e8dc0 Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Wed, 22 Jun 2022 21:43:14 +0530 Subject: [PATCH 04/14] feat: push image to gcr --- .github/workflows/docker.yml | 29 ++++++++++++++++++++++------- Dockerfile | 5 ++++- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2a2e9f1..fe9590d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,17 +2,32 @@ name: Docker Image CI on: push: - branches: [ "master" ] + branches: ["master"] pull_request: - branches: [ "master" ] + branches: ["master"] jobs: - build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --tag paritytech/ci-linux:974ba3ac-20201006 + - uses: actions/checkout@v3 + # - name: Login and Build the Docker image + # run: | + # echo $CR_PAT | docker login ghcr.io -u ${{ github.actor }} --password-stdin + # env: + # CR_PAT: ${{ secrets.PAT }} + # docker image build -t nusic/layer1:v1 . + # docker push nusic/layer1:v1 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build the Docker image + run: | + docker build -t nusic/layer1:v1 . + docker run ghcr.io/nusic/layer1:v1 + docker push ghcr.io/nusic/layer1:v1 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 71274de..1c19836 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,10 @@ RUN rustup target add wasm32-unknown-unknown COPY . . -RUN cargo build --release +RUN cargo build --release + +LABEL org.opencontainers.image.source="https://github.com/nusic-fm/metadata-layer" + # && ./target/release/node-template --dev --ws-external # ENTRYPOINT ["tail", "-f", "/dev/null"] \ No newline at end of file From 134c745c2576108b5459199e5cfcba3db9aae3cb Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Wed, 22 Jun 2022 21:45:13 +0530 Subject: [PATCH 05/14] fix: remove spacing --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fe9590d..e1447b5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,7 +27,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build the Docker image - run: | - docker build -t nusic/layer1:v1 . - docker run ghcr.io/nusic/layer1:v1 - docker push ghcr.io/nusic/layer1:v1 \ No newline at end of file + run: | + docker build -t nusic/layer1:v1 . + docker run ghcr.io/nusic/layer1:v1 + docker push ghcr.io/nusic/layer1:v1 From 42f9388a42ddd9d9f209264e41e396546d556a26 Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Wed, 22 Jun 2022 22:24:17 +0530 Subject: [PATCH 06/14] fix: tag with gcr --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e1447b5..5a4ec82 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,6 +28,6 @@ jobs: - name: Build the Docker image run: | - docker build -t nusic/layer1:v1 . + docker build -t ghcr.io/nusic/layer1:v1 . docker run ghcr.io/nusic/layer1:v1 docker push ghcr.io/nusic/layer1:v1 From 71237ac880f766f6c4bd0cef4da5e510db9aa1fc Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Wed, 22 Jun 2022 23:00:43 +0530 Subject: [PATCH 07/14] fix: github actor --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5a4ec82..7cf87c1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,6 +28,6 @@ jobs: - name: Build the Docker image run: | - docker build -t ghcr.io/nusic/layer1:v1 . - docker run ghcr.io/nusic/layer1:v1 - docker push ghcr.io/nusic/layer1:v1 + docker build -t ghcr.io/${{ github.actor }}/layer1:v1 . + docker run ghcr.io/${{ github.actor }}/layer1:v1 + docker push ghcr.io/${{ github.actor }}/layer1:v1 From 4995b19144b0c044d355d8fa4689c46aeb6af93f Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Thu, 23 Jun 2022 10:16:35 +0530 Subject: [PATCH 08/14] fix: change username to org name --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7cf87c1..c68d90d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -23,11 +23,11 @@ jobs: uses: docker/login-action@v1 with: registry: ghcr.io - username: ${{ github.actor }} + username: nusic-fm password: ${{ secrets.GITHUB_TOKEN }} - name: Build the Docker image run: | - docker build -t ghcr.io/${{ github.actor }}/layer1:v1 . - docker run ghcr.io/${{ github.actor }}/layer1:v1 - docker push ghcr.io/${{ github.actor }}/layer1:v1 + docker build -t ghcr.io/nusic-fm/layer1:v1 . + docker run ghcr.io/nusic-fm/layer1:v1 + docker push ghcr.io/nusic-fm/layer1:v1 From a74871c54d73c9e1d069ff5a8fa34969331f1943 Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Thu, 23 Jun 2022 12:06:09 +0530 Subject: [PATCH 09/14] fix: add entrypoint --- .github/workflows/docker.yml | 6 +++--- Dockerfile | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c68d90d..f3809f2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,6 +28,6 @@ jobs: - name: Build the Docker image run: | - docker build -t ghcr.io/nusic-fm/layer1:v1 . - docker run ghcr.io/nusic-fm/layer1:v1 - docker push ghcr.io/nusic-fm/layer1:v1 + docker build -t ghcr.io/nusic-fm/layer1:v1.1 . + docker run ghcr.io/nusic-fm/layer1:v1.1 + docker push ghcr.io/nusic-fm/layer1:v1.1 diff --git a/Dockerfile b/Dockerfile index 1c19836..abcbdd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,8 @@ RUN cargo build --release LABEL org.opencontainers.image.source="https://github.com/nusic-fm/metadata-layer" +ENTRYPOINT ["/usr/local/bin/substrate"] + # && ./target/release/node-template --dev --ws-external # ENTRYPOINT ["tail", "-f", "/dev/null"] \ No newline at end of file From ea2819c1ee0573ab044e4194ff054a7fe8fabb2a Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Mon, 27 Jun 2022 15:34:48 +0530 Subject: [PATCH 10/14] fix: remove entrypoint --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index abcbdd9..d68c3c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ RUN cargo build --release LABEL org.opencontainers.image.source="https://github.com/nusic-fm/metadata-layer" -ENTRYPOINT ["/usr/local/bin/substrate"] +# ENTRYPOINT ["/"] # && ./target/release/node-template --dev --ws-external From ddf266ece2341489ab256a50e616b9a7ba419dcc Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Thu, 30 Jun 2022 06:33:20 +0530 Subject: [PATCH 11/14] fix: docker for gcp --- Dockerfile | 5 +++++ runtime/src/lib.rs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d68c3c1..651f1b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,7 @@ RUN apt-get update -y && \ apt-get install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev RUN rustup target add wasm32-unknown-unknown +# /app/target/release/node-template --dev --ws-external COPY . . @@ -31,6 +32,10 @@ RUN cargo build --release LABEL org.opencontainers.image.source="https://github.com/nusic-fm/metadata-layer" +# CMD ["sh", "-c", "/app/target/release/node-template --${} --${}"] + +EXPOSE 9944 + # ENTRYPOINT ["/"] # && ./target/release/node-template --dev --ws-external diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2b58b8b..135508e 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -308,7 +308,7 @@ construct_runtime!( TransactionPayment: pallet_transaction_payment, Sudo: pallet_sudo, // Include the custom logic from the pallet-template in the runtime. - TemplateModule: pallet_template, + UploadModule: pallet_template, } ); @@ -351,7 +351,7 @@ mod benches { [frame_system, SystemBench::] [pallet_balances, Balances] [pallet_timestamp, Timestamp] - [pallet_template, TemplateModule] + [pallet_template, UploadModule] ); } From 5769ddd5ce7dca356e462ef14eed38d72cf5c02c Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Thu, 30 Jun 2022 13:28:10 +0530 Subject: [PATCH 12/14] fix: node initializaiton cmd --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 651f1b5..5d9ade8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,12 @@ RUN cargo build --release LABEL org.opencontainers.image.source="https://github.com/nusic-fm/metadata-layer" -# CMD ["sh", "-c", "/app/target/release/node-template --${} --${}"] +ENV environment dev +ENV place ws-external + +# CMD ["/app/target/release/node-template"] + +CMD ["sh", "-c", "/app/target/release/node-template --${environment} --${place}"] EXPOSE 9944 From fd9a4ee84cd9f37f40797be8cec80159fdddc14c Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Thu, 30 Jun 2022 14:51:12 +0530 Subject: [PATCH 13/14] fix: remove docker run --- .github/workflows/docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f3809f2..4488aae 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -29,5 +29,6 @@ jobs: - name: Build the Docker image run: | docker build -t ghcr.io/nusic-fm/layer1:v1.1 . - docker run ghcr.io/nusic-fm/layer1:v1.1 docker push ghcr.io/nusic-fm/layer1:v1.1 + + # docker run ghcr.io/nusic-fm/layer1:v1.1 \ No newline at end of file From 34b1e8734d5100c540c10a10ba37864caf18dd23 Mon Sep 17 00:00:00 2001 From: logesh2496 Date: Fri, 1 Jul 2022 08:10:51 +0530 Subject: [PATCH 14/14] fix: add entrypoint --- .github/workflows/docker.yml | 4 ++-- Dockerfile | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4488aae..f27f9e4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,7 +28,7 @@ jobs: - name: Build the Docker image run: | - docker build -t ghcr.io/nusic-fm/layer1:v1.1 . - docker push ghcr.io/nusic-fm/layer1:v1.1 + docker build -t ghcr.io/nusic-fm/layer1:v1.2 . + docker push ghcr.io/nusic-fm/layer1:v1.2 # docker run ghcr.io/nusic-fm/layer1:v1.1 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 5d9ade8..5508486 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,16 +32,16 @@ RUN cargo build --release LABEL org.opencontainers.image.source="https://github.com/nusic-fm/metadata-layer" -ENV environment dev -ENV place ws-external +# ENV environment dev +# ENV place ws-external # CMD ["/app/target/release/node-template"] -CMD ["sh", "-c", "/app/target/release/node-template --${environment} --${place}"] +# CMD ["sh", "-c", "/app/target/release/node-template --${environment} --${place}"] EXPOSE 9944 -# ENTRYPOINT ["/"] +ENTRYPOINT ["/app/target/release/node-template"] # && ./target/release/node-template --dev --ws-external