From e81ab186db5f088fb90a876cf1fd12d2ae4a9403 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 00:48:53 +0300 Subject: [PATCH 01/20] ci: prebuild dev containers Fixes #2181 Add a GitHub Actions workflow to prebuild dev containers and update devcontainer configuration. * **Add GitHub Actions workflow**: Create `.github/workflows/prebuild-devcontainers.yml` to schedule and trigger builds for the dev container image. * **Add devcontainer configuration**: Create `.devcontainer/devcontainer.jso` to specify the image to be used for the dev container. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/dashpay/platform/issues/2181?shareId=XXXX-XXXX-XXXX-XXXX). --- .../{devcontainer.json => build.json} | 0 .devcontainer/devcontainer.jso | 4 ++ .github/workflows/prebuild-devcontainers.yml | 40 +++++++++++++++++++ 3 files changed, 44 insertions(+) rename .devcontainer/{devcontainer.json => build.json} (100%) create mode 100644 .devcontainer/devcontainer.jso create mode 100644 .github/workflows/prebuild-devcontainers.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/build.json similarity index 100% rename from .devcontainer/devcontainer.json rename to .devcontainer/build.json diff --git a/.devcontainer/devcontainer.jso b/.devcontainer/devcontainer.jso new file mode 100644 index 00000000000..812703468ab --- /dev/null +++ b/.devcontainer/devcontainer.jso @@ -0,0 +1,4 @@ +{ + "name": "Dash Platform Dev Container", + "image": "ghcr.io/dashpay/platform/devcontainer" +} diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml new file mode 100644 index 00000000000..6c68d7a9a6c --- /dev/null +++ b/.github/workflows/prebuild-devcontainers.yml @@ -0,0 +1,40 @@ +name: Prebuild Dev Containers + +on: + schedule: + - cron: "0 0 * * *" + push: + paths: + - '.devcontainer/**' + - '.github/workflows/prebuild-devcontainers.yml' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Set up QEMU for multi-architecture builds + uses: docker/setup-qemu-action@v3 + + - name: Setup Docker buildx for multi-architecture builds + uses: docker/setup-buildx-action@v3 + with: + use: true + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: dashpay + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Platform devcontainer + uses: devcontainers/ci@v0.3 + with: + imageName: ghcr.io/dashpay/platform/devcontainer + platform: linux/amd64,linux/arm64 + configFile: .devcontainer/build.json + push: true + cacheFrom: ghcr.io/dashpay/platform/devcontainer From 9ebc8a2dc0a2100c46e04e5f3da6e7bd89ca4007 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 01:07:15 +0300 Subject: [PATCH 02/20] build: rename files --- .devcontainer/{build.json => devcontainer-build.json} | 0 .devcontainer/{devcontainer.jso => devcontainer.json} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .devcontainer/{build.json => devcontainer-build.json} (100%) rename .devcontainer/{devcontainer.jso => devcontainer.json} (100%) diff --git a/.devcontainer/build.json b/.devcontainer/devcontainer-build.json similarity index 100% rename from .devcontainer/build.json rename to .devcontainer/devcontainer-build.json diff --git a/.devcontainer/devcontainer.jso b/.devcontainer/devcontainer.json similarity index 100% rename from .devcontainer/devcontainer.jso rename to .devcontainer/devcontainer.json From e2cf64eec2de0597912ddc2e2f2126c6489abd12 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 01:09:47 +0300 Subject: [PATCH 03/20] ci: update dev container file --- .github/workflows/prebuild-devcontainers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 6c68d7a9a6c..35d318d3e03 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -35,6 +35,6 @@ jobs: with: imageName: ghcr.io/dashpay/platform/devcontainer platform: linux/amd64,linux/arm64 - configFile: .devcontainer/build.json + configFile: .devcontainer/devcontainer-build.json push: true cacheFrom: ghcr.io/dashpay/platform/devcontainer From 2de894bf3e2cefcbdedfff1e1ed90f9dcce9845c Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 01:15:26 +0300 Subject: [PATCH 04/20] refactor: remove trailing comma --- .devcontainer/devcontainer-build.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer-build.json b/.devcontainer/devcontainer-build.json index 2d0d18ee904..c7168a1ce0d 100644 --- a/.devcontainer/devcontainer-build.json +++ b/.devcontainer/devcontainer-build.json @@ -61,7 +61,7 @@ "ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/devcontainers/features/node:1": { "version": 20, - "installYarnUsingApt": false, + "installYarnUsingApt": false }, "ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {}, "ghcr.io/devcontainers/features/docker-in-docker:2": {}, From a9c1535a5c43cb1f537b5f652be5aed3a80e7c23 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 01:16:50 +0300 Subject: [PATCH 05/20] refactor: remove duplicate extension --- .devcontainer/devcontainer-build.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.devcontainer/devcontainer-build.json b/.devcontainer/devcontainer-build.json index c7168a1ce0d..df88d659340 100644 --- a/.devcontainer/devcontainer-build.json +++ b/.devcontainer/devcontainer-build.json @@ -11,7 +11,6 @@ "arcanis.vscode-zipfs", "chrmarti.regex", "davidanson.vscode-markdownlint", - "arcanis.vscode-zipfs", "ms-vscode.cmake-tools", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode", From 1bd45ea2dad913b6fd466705383c5f5d214e0be8 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 01:19:53 +0300 Subject: [PATCH 06/20] refactor: explicit image tag --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 812703468ab..ef71072f9f1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,4 @@ { "name": "Dash Platform Dev Container", - "image": "ghcr.io/dashpay/platform/devcontainer" + "image": "ghcr.io/dashpay/platform/devcontainer:latest" } From d23c7fd0dc2072cd260cbf2ea1595323dc173ae9 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 01:39:53 +0300 Subject: [PATCH 07/20] build: add version tag --- .devcontainer/devcontainer.json | 2 +- .github/workflows/prebuild-devcontainers.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ef71072f9f1..586571ba2b1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,4 @@ { "name": "Dash Platform Dev Container", - "image": "ghcr.io/dashpay/platform/devcontainer:latest" + "image": "ghcr.io/dashpay/platform/devcontainer:0.1.0" } diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 35d318d3e03..f4500012ce9 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -7,6 +7,7 @@ on: paths: - '.devcontainer/**' - '.github/workflows/prebuild-devcontainers.yml' + workflow_dispatch: jobs: build: @@ -34,6 +35,7 @@ jobs: uses: devcontainers/ci@v0.3 with: imageName: ghcr.io/dashpay/platform/devcontainer + imageTag: 0.1.0 platform: linux/amd64,linux/arm64 configFile: .devcontainer/devcontainer-build.json push: true From 2f169f8b6dbcf0341d0fb8d42fc4c46b67ae7420 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 01:42:35 +0300 Subject: [PATCH 08/20] ci: stop previous runs --- .github/workflows/prebuild-devcontainers.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index f4500012ce9..a6269d5ca4e 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -9,6 +9,10 @@ on: - '.github/workflows/prebuild-devcontainers.yml' workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest From 5156cc8f26bc864352f10ee4a6555612c247b6a0 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 01:43:26 +0300 Subject: [PATCH 09/20] ci: add more files --- .github/workflows/prebuild-devcontainers.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index a6269d5ca4e..15d773e1791 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -7,6 +7,8 @@ on: paths: - '.devcontainer/**' - '.github/workflows/prebuild-devcontainers.yml' + - rust-toolchain.toml + - Dockerfile workflow_dispatch: concurrency: From df9a352881ab4762c4af96ca9850a24fdcec2650 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 01:47:41 +0300 Subject: [PATCH 10/20] ci: update job and step names --- .github/workflows/prebuild-devcontainers.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 15d773e1791..35a93b01506 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -17,15 +17,16 @@ concurrency: jobs: build: + name: Build and push devcontainer runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v3 - - name: Set up QEMU for multi-architecture builds + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - name: Setup Docker buildx for multi-architecture builds + - name: Setup Docker buildx uses: docker/setup-buildx-action@v3 with: use: true From 91ee717a833c3df648e340c9d4a8dc3f08b2893a Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 02:42:51 +0300 Subject: [PATCH 11/20] ci: switch to self-hosted runner --- .github/workflows/prebuild-devcontainers.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 35a93b01506..52f372292f8 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -1,8 +1,6 @@ name: Prebuild Dev Containers on: - schedule: - - cron: "0 0 * * *" push: paths: - '.devcontainer/**' @@ -18,7 +16,7 @@ concurrency: jobs: build: name: Build and push devcontainer - runs-on: ubuntu-latest + runs-on: ["self-hosted", "linux", "arm64", "ubuntu-platform"] steps: - name: Checkout repo uses: actions/checkout@v3 @@ -36,7 +34,7 @@ jobs: with: registry: ghcr.io username: dashpay - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }}π - name: Build and push Platform devcontainer uses: devcontainers/ci@v0.3 From 8d64d3826cd461edda77045771b3987052eece57 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 02:43:38 +0300 Subject: [PATCH 12/20] ci: add timeout just in case --- .github/workflows/prebuild-devcontainers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 52f372292f8..bc70d9b92fe 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -17,6 +17,7 @@ jobs: build: name: Build and push devcontainer runs-on: ["self-hosted", "linux", "arm64", "ubuntu-platform"] + timeout-minutes: 60 steps: - name: Checkout repo uses: actions/checkout@v3 From 79916fd0c0dfe5f199837bdb04a8e72438efda53 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 03:00:37 +0300 Subject: [PATCH 13/20] ci: switch to PAT --- .github/workflows/prebuild-devcontainers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index bc70d9b92fe..1853ee66c29 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -35,7 +35,7 @@ jobs: with: registry: ghcr.io username: dashpay - password: ${{ secrets.GITHUB_TOKEN }}π + password: ${{ secrets.GHCR_TOKEN }} - name: Build and push Platform devcontainer uses: devcontainers/ci@v0.3 From d412e6a2b594134418e84fd14510b662f7af5f26 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 03:06:26 +0300 Subject: [PATCH 14/20] ci: add nodejs --- .github/workflows/prebuild-devcontainers.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 1853ee66c29..2ea6b4fe2cf 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -20,7 +20,12 @@ jobs: timeout-minutes: 60 steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Setup Node.JS + uses: actions/setup-node@v4 + with: + node-version: "20" - name: Set up QEMU uses: docker/setup-qemu-action@v3 From 10fa6e850de9cbe7c90157b4e0055a4f41d14b0b Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 03:15:28 +0300 Subject: [PATCH 15/20] ci: set up skopeo --- .github/workflows/prebuild-devcontainers.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 2ea6b4fe2cf..d6b7bb8d45c 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -27,6 +27,11 @@ jobs: with: node-version: "20" + - name: Set up skopeo + uses: warjiang/setup-skopeo@0 + with: + version: latest + - name: Set up QEMU uses: docker/setup-qemu-action@v3 From 7f542ab8b66912a574796b6b069cf704fb156af7 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 03:17:36 +0300 Subject: [PATCH 16/20] ci: change to latest --- .github/workflows/prebuild-devcontainers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index d6b7bb8d45c..c3502257a61 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -28,7 +28,7 @@ jobs: node-version: "20" - name: Set up skopeo - uses: warjiang/setup-skopeo@0 + uses: warjiang/setup-skopeo@latestπ with: version: latest From 03483c27d3835d607f7bf046dfdc8452b54fbbea Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 03:17:36 +0300 Subject: [PATCH 17/20] ci: change to latest --- .github/workflows/prebuild-devcontainers.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index d6b7bb8d45c..4323c45f1fc 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -28,9 +28,7 @@ jobs: node-version: "20" - name: Set up skopeo - uses: warjiang/setup-skopeo@0 - with: - version: latest + uses: warjiang/setup-skopeo@latest - name: Set up QEMU uses: docker/setup-qemu-action@v3 From 4f539ded88bcd74b376984c43e951d6942400c9b Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 03:20:21 +0300 Subject: [PATCH 18/20] ci: change to v0.1.3 --- .github/workflows/prebuild-devcontainers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 4323c45f1fc..3b2c6312a19 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -28,7 +28,7 @@ jobs: node-version: "20" - name: Set up skopeo - uses: warjiang/setup-skopeo@latest + uses: warjiang/setup-skopeo@v0.1.3 - name: Set up QEMU uses: docker/setup-qemu-action@v3 From 3b34bd2404380e5c5e06b61bc2bd0f9a9197aa06 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 03:32:15 +0300 Subject: [PATCH 19/20] ci: install skopeo --- .github/workflows/prebuild-devcontainers.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 3b2c6312a19..9bf655dc15d 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -16,7 +16,7 @@ concurrency: jobs: build: name: Build and push devcontainer - runs-on: ["self-hosted", "linux", "arm64", "ubuntu-platform"] + runs-on: ["self-hosted", "linux", "x64", "ubuntu-platform"] timeout-minutes: 60 steps: - name: Checkout repo @@ -27,8 +27,10 @@ jobs: with: node-version: "20" - - name: Set up skopeo - uses: warjiang/setup-skopeo@v0.1.3 + - name: Install skopeo + run: | + sudo apt-get update + sudo apt-get install -y skopeo - name: Set up QEMU uses: docker/setup-qemu-action@v3 From 866734291744ecba2a1b3ad561cccefff51926bf Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sun, 29 Sep 2024 04:25:05 +0300 Subject: [PATCH 20/20] ci: fix push setting --- .github/workflows/prebuild-devcontainers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 9bf655dc15d..794fa3d4a56 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -54,5 +54,5 @@ jobs: imageTag: 0.1.0 platform: linux/amd64,linux/arm64 configFile: .devcontainer/devcontainer-build.json - push: true + push: always cacheFrom: ghcr.io/dashpay/platform/devcontainer