From 53cbc228d0d6e0254ccf8b22ecfec09b542e007e Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Tue, 2 Apr 2024 14:18:41 +0200 Subject: [PATCH 01/21] adding job for building dashboard --- .github/workflows/dashboard.yaml | 33 ++++++++++++++++++++++++++++++++ dashboard/docker-compose.dev.yml | 4 ++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/dashboard.yaml diff --git a/.github/workflows/dashboard.yaml b/.github/workflows/dashboard.yaml new file mode 100644 index 000000000..39a30fa3b --- /dev/null +++ b/.github/workflows/dashboard.yaml @@ -0,0 +1,33 @@ +name: Build and publish dashboard +on: + push: + paths: + - dashboard + branches: + - "main" + pull_request: + merge_group: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: "πŸš€ Building" + run: | + docker build -t ghcr.io/dfinity/dre/ic-management-frontend:$GITHUB_SHA -f dashboard/Dockerfile dashboard + + - name: "πŸ”§ Login to GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: "πŸ“¦ Push images to GitHub Container Registry" + if: ${{ startsWith(github.head_ref, 'container') || startsWith(github.ref, 'refs/heads/container') || (github.ref == 'refs/heads/main') }} + run: | + docker push ghcr.io/dfinity/dre/ic-management-frontend:$GITHUB_SHA \ No newline at end of file diff --git a/dashboard/docker-compose.dev.yml b/dashboard/docker-compose.dev.yml index c546d9962..b260032c6 100644 --- a/dashboard/docker-compose.dev.yml +++ b/dashboard/docker-compose.dev.yml @@ -9,12 +9,12 @@ services: dashboard-backend-mainnet: build: context: .. - dockerfile: ic-management-backend/Dockerfile + dockerfile: rs/ic-management-backend/Dockerfile args: BUILDKIT_INLINE_CACHE: 1 slack: build: context: .. - dockerfile: slack-notifications/Dockerfile + dockerfile: rs/slack-notifications/Dockerfile args: BUILDKIT_INLINE_CACHE: 1 From 1f091c0b3b3dad2dbf5dc39443c9ed508d064023 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Tue, 2 Apr 2024 14:22:00 +0200 Subject: [PATCH 02/21] adding checkout step --- .github/workflows/dashboard.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dashboard.yaml b/.github/workflows/dashboard.yaml index 39a30fa3b..121963297 100644 --- a/.github/workflows/dashboard.yaml +++ b/.github/workflows/dashboard.yaml @@ -1,4 +1,4 @@ -name: Build and publish dashboard +name: Build and push dashboard image on: push: paths: @@ -16,6 +16,7 @@ jobs: build: runs-on: ubuntu-20.04 steps: + - uses: actions/checkout@v4 - name: "πŸš€ Building" run: | docker build -t ghcr.io/dfinity/dre/ic-management-frontend:$GITHUB_SHA -f dashboard/Dockerfile dashboard From 643c94bab1250158d3d1bb0efc2c0c075990f980 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Tue, 2 Apr 2024 14:39:08 +0200 Subject: [PATCH 03/21] spliting into two MR's --- .github/workflows/dashboard.yaml | 9 ++++++++- .github/workflows/main.yaml | 1 + .github/workflows/update-k8s-deployments/action.yaml | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dashboard.yaml b/.github/workflows/dashboard.yaml index 121963297..6b96f85df 100644 --- a/.github/workflows/dashboard.yaml +++ b/.github/workflows/dashboard.yaml @@ -31,4 +31,11 @@ jobs: - name: "πŸ“¦ Push images to GitHub Container Registry" if: ${{ startsWith(github.head_ref, 'container') || startsWith(github.ref, 'refs/heads/container') || (github.ref == 'refs/heads/main') }} run: | - docker push ghcr.io/dfinity/dre/ic-management-frontend:$GITHUB_SHA \ No newline at end of file + docker push ghcr.io/dfinity/dre/ic-management-frontend:$GITHUB_SHA + + - name: "πŸ€– Update k8s deployments" + if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.head_ref, 'container') || startsWith(github.ref, 'refs/heads/container') || (github.ref == 'refs/heads/main') }} + uses: ./.github/workflows/update-k8s-deployments + with: + gitlab_api_token: ${{ secrets.GITLAB_K8S_API_TOKEN }} + paths: bases/apps/mainnet-dashboard/statefulset-slack.yaml bases/apps/mainnet-dashboard/backend/base/deployment.yaml \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8e352a998..8b5313734 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -73,6 +73,7 @@ jobs: uses: ./.github/workflows/update-k8s-deployments with: gitlab_api_token: ${{ secrets.GITLAB_K8S_API_TOKEN }} + paths: bases/apps/mainnet-dashboard/frontend/deployment.yaml ######################################## # Clean up runner diff --git a/.github/workflows/update-k8s-deployments/action.yaml b/.github/workflows/update-k8s-deployments/action.yaml index 51f59ec23..b599f34be 100644 --- a/.github/workflows/update-k8s-deployments/action.yaml +++ b/.github/workflows/update-k8s-deployments/action.yaml @@ -5,6 +5,9 @@ inputs: gitlab_api_token: description: 'A GitLab API token with access to the k8s repository' required: true + paths: + description: 'Paths in k8s repo to update' + required: true runs: using: composite @@ -12,6 +15,7 @@ runs: - name: "☸️ Update k8s deployments" env: GITLAB_API_TOKEN: ${{ inputs.gitlab_api_token }} + K8S_PATHS: ${{ inputs.paths }} shell: bash run: | set -eExou pipefail @@ -30,7 +34,7 @@ runs: # this regex matches the first group (ie the image name) and uses \1 # called a back-reference to insert the first group matched, the second # part is to match the 40 characters hash that we replace with the $GITHUB_SHA - sed -i "s~\(\([[:alpha:]]\|-\)\+\):[[:alnum:]]\{40\}~\1:${GITHUB_SHA}~g" bases/apps/mainnet-dashboard/statefulset-slack.yaml bases/apps/mainnet-dashboard/backend/base/deployment.yaml bases/apps/mainnet-dashboard/frontend/deployment.yaml + sed -i "s~\(\([[:alpha:]]\|-\)\+\):[[:alnum:]]\{40\}~\1:${GITHUB_SHA}~g" ${K8S_PATHS} # commit changes if there are any git add . From 405f8ce0ea1305936253e8a2f2f6c4a648e27c07 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Tue, 2 Apr 2024 14:40:21 +0200 Subject: [PATCH 04/21] fixing paths --- .github/workflows/dashboard.yaml | 2 +- .github/workflows/main.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dashboard.yaml b/.github/workflows/dashboard.yaml index 6b96f85df..febd75aa7 100644 --- a/.github/workflows/dashboard.yaml +++ b/.github/workflows/dashboard.yaml @@ -38,4 +38,4 @@ jobs: uses: ./.github/workflows/update-k8s-deployments with: gitlab_api_token: ${{ secrets.GITLAB_K8S_API_TOKEN }} - paths: bases/apps/mainnet-dashboard/statefulset-slack.yaml bases/apps/mainnet-dashboard/backend/base/deployment.yaml \ No newline at end of file + paths: bases/apps/mainnet-dashboard/frontend/deployment.yaml \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8b5313734..53d1030c4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -73,7 +73,8 @@ jobs: uses: ./.github/workflows/update-k8s-deployments with: gitlab_api_token: ${{ secrets.GITLAB_K8S_API_TOKEN }} - paths: bases/apps/mainnet-dashboard/frontend/deployment.yaml + paths: bases/apps/mainnet-dashboard/statefulset-slack.yaml bases/apps/mainnet-dashboard/backend/base/deployment.yaml + ######################################## # Clean up runner From cd524e89f85871fa1820bc1b882920bc7054c685 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 2 Apr 2024 13:02:02 +0000 Subject: [PATCH 05/21] Github Action: Bazel Repin --- Cargo.Bazel.lock | 977 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 920 insertions(+), 57 deletions(-) diff --git a/Cargo.Bazel.lock b/Cargo.Bazel.lock index 37dca8551..a417b0c03 100644 --- a/Cargo.Bazel.lock +++ b/Cargo.Bazel.lock @@ -1,5 +1,5 @@ { - "checksum": "152cebe18b533178b47418824dc4a3581bed28c76dc3239bca30c1a049167480", + "checksum": "0f7d55fffc221eb04046dc4e6c1ffed5860221312a1b8197dc615e43af57b038", "crates": { "actix-codec 0.5.2": { "name": "actix-codec", @@ -4113,6 +4113,44 @@ }, "license": "MIT OR Apache-2.0" }, + "base64 0.22.0": { + "name": "base64", + "version": "0.22.0", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/base64/0.22.0/download", + "sha256": "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" + } + }, + "targets": [ + { + "Library": { + "crate_name": "base64", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "base64", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "alloc", + "default", + "std" + ], + "selects": {} + }, + "edition": "2018", + "version": "0.22.0" + }, + "license": "MIT OR Apache-2.0" + }, "base64ct 1.6.0": { "name": "base64ct", "version": "1.6.0", @@ -6334,7 +6372,7 @@ "target": "pretty_env_logger" }, { - "id": "reqwest 0.11.27", + "id": "reqwest 0.12.2", "target": "reqwest" }, { @@ -9485,6 +9523,61 @@ }, "license": "MIT" }, + "darling 0.20.8": { + "name": "darling", + "version": "0.20.8", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/darling/0.20.8/download", + "sha256": "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" + } + }, + "targets": [ + { + "Library": { + "crate_name": "darling", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "darling", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "suggestions" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "darling_core 0.20.8", + "target": "darling_core" + } + ], + "selects": {} + }, + "edition": "2018", + "proc_macro_deps": { + "common": [ + { + "id": "darling_macro 0.20.8", + "target": "darling_macro" + } + ], + "selects": {} + }, + "version": "0.20.8" + }, + "license": "MIT" + }, "darling_core 0.13.4": { "name": "darling_core", "version": "0.13.4", @@ -9617,6 +9710,72 @@ }, "license": "MIT" }, + "darling_core 0.20.8": { + "name": "darling_core", + "version": "0.20.8", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/darling_core/0.20.8/download", + "sha256": "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" + } + }, + "targets": [ + { + "Library": { + "crate_name": "darling_core", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "darling_core", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "strsim", + "suggestions" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "fnv 1.0.7", + "target": "fnv" + }, + { + "id": "ident_case 1.0.1", + "target": "ident_case" + }, + { + "id": "proc-macro2 1.0.79", + "target": "proc_macro2" + }, + { + "id": "quote 1.0.35", + "target": "quote" + }, + { + "id": "strsim 0.10.0", + "target": "strsim" + }, + { + "id": "syn 2.0.57", + "target": "syn" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "0.20.8" + }, + "license": "MIT" + }, "darling_macro 0.13.4": { "name": "darling_macro", "version": "0.13.4", @@ -9711,6 +9870,53 @@ }, "license": "MIT" }, + "darling_macro 0.20.8": { + "name": "darling_macro", + "version": "0.20.8", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/darling_macro/0.20.8/download", + "sha256": "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" + } + }, + "targets": [ + { + "ProcMacro": { + "crate_name": "darling_macro", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "darling_macro", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "darling_core 0.20.8", + "target": "darling_core" + }, + { + "id": "quote 1.0.35", + "target": "quote" + }, + { + "id": "syn 2.0.57", + "target": "syn" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "0.20.8" + }, + "license": "MIT" + }, "data-encoding 2.5.0": { "name": "data-encoding", "version": "2.5.0", @@ -9911,7 +10117,7 @@ "target": "serde_json" }, { - "id": "strum 0.25.0", + "id": "strum 0.26.2", "target": "strum" }, { @@ -9942,7 +10148,7 @@ "target": "async_trait" }, { - "id": "strum_macros 0.25.3", + "id": "strum_macros 0.26.2", "target": "strum_macros" } ], @@ -10227,13 +10433,13 @@ }, "license": "MIT/Apache-2.0" }, - "derive_builder 0.12.0": { + "derive_builder 0.20.0": { "name": "derive_builder", - "version": "0.12.0", + "version": "0.20.0", "repository": { "Http": { - "url": "https://static.crates.io/crates/derive_builder/0.12.0/download", - "sha256": "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" + "url": "https://static.crates.io/crates/derive_builder/0.20.0/download", + "sha256": "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" } }, "targets": [ @@ -10259,19 +10465,19 @@ ], "selects": {} }, - "edition": "2015", + "edition": "2018", "proc_macro_deps": { "common": [ { - "id": "derive_builder_macro 0.12.0", + "id": "derive_builder_macro 0.20.0", "target": "derive_builder_macro" } ], "selects": {} }, - "version": "0.12.0" + "version": "0.20.0" }, - "license": "MIT/Apache-2.0" + "license": "MIT OR Apache-2.0" }, "derive_builder_core 0.11.2": { "name": "derive_builder_core", @@ -10324,13 +10530,13 @@ }, "license": "MIT/Apache-2.0" }, - "derive_builder_core 0.12.0": { + "derive_builder_core 0.20.0": { "name": "derive_builder_core", - "version": "0.12.0", + "version": "0.20.0", "repository": { "Http": { - "url": "https://static.crates.io/crates/derive_builder_core/0.12.0/download", - "sha256": "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" + "url": "https://static.crates.io/crates/derive_builder_core/0.20.0/download", + "sha256": "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" } }, "targets": [ @@ -10349,10 +10555,16 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "lib_has_std" + ], + "selects": {} + }, "deps": { "common": [ { - "id": "darling 0.14.4", + "id": "darling 0.20.8", "target": "darling" }, { @@ -10364,16 +10576,16 @@ "target": "quote" }, { - "id": "syn 1.0.109", + "id": "syn 2.0.57", "target": "syn" } ], "selects": {} }, - "edition": "2015", - "version": "0.12.0" + "edition": "2018", + "version": "0.20.0" }, - "license": "MIT/Apache-2.0" + "license": "MIT OR Apache-2.0" }, "derive_builder_macro 0.11.2": { "name": "derive_builder_macro", @@ -10418,13 +10630,13 @@ }, "license": "MIT/Apache-2.0" }, - "derive_builder_macro 0.12.0": { + "derive_builder_macro 0.20.0": { "name": "derive_builder_macro", - "version": "0.12.0", + "version": "0.20.0", "repository": { "Http": { - "url": "https://static.crates.io/crates/derive_builder_macro/0.12.0/download", - "sha256": "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" + "url": "https://static.crates.io/crates/derive_builder_macro/0.20.0/download", + "sha256": "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" } }, "targets": [ @@ -10443,23 +10655,29 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "lib_has_std" + ], + "selects": {} + }, "deps": { "common": [ { - "id": "derive_builder_core 0.12.0", + "id": "derive_builder_core 0.20.0", "target": "derive_builder_core" }, { - "id": "syn 1.0.109", + "id": "syn 2.0.57", "target": "syn" } ], "selects": {} }, - "edition": "2015", - "version": "0.12.0" + "edition": "2018", + "version": "0.20.0" }, - "license": "MIT/Apache-2.0" + "license": "MIT OR Apache-2.0" }, "derive_more 0.99.17": { "name": "derive_more", @@ -11674,7 +11892,7 @@ "target": "registry_canister" }, { - "id": "reqwest 0.11.27", + "id": "reqwest 0.12.2", "target": "reqwest" }, { @@ -11698,7 +11916,7 @@ "target": "spinners" }, { - "id": "strum 0.25.0", + "id": "strum 0.26.2", "target": "strum" }, { @@ -12395,6 +12613,55 @@ }, "license": "MIT OR Apache-2.0" }, + "env_filter 0.1.0": { + "name": "env_filter", + "version": "0.1.0", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/env_filter/0.1.0/download", + "sha256": "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" + } + }, + "targets": [ + { + "Library": { + "crate_name": "env_filter", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "env_filter", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "regex" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "log 0.4.21", + "target": "log" + }, + { + "id": "regex 1.10.4", + "target": "regex" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.1.0" + }, + "license": "MIT OR Apache-2.0" + }, "env_logger 0.10.2": { "name": "env_logger", "version": "0.10.2", @@ -12460,6 +12727,71 @@ }, "license": "MIT OR Apache-2.0" }, + "env_logger 0.11.3": { + "name": "env_logger", + "version": "0.11.3", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/env_logger/0.11.3/download", + "sha256": "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" + } + }, + "targets": [ + { + "Library": { + "crate_name": "env_logger", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "env_logger", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "auto-color", + "color", + "default", + "humantime", + "regex" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "anstream 0.6.13", + "target": "anstream" + }, + { + "id": "anstyle 1.0.6", + "target": "anstyle" + }, + { + "id": "env_filter 0.1.0", + "target": "env_filter" + }, + { + "id": "humantime 2.1.0", + "target": "humantime" + }, + { + "id": "log 0.4.21", + "target": "log" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.11.3" + }, + "license": "MIT OR Apache-2.0" + }, "equivalent 1.0.1": { "name": "equivalent", "version": "1.0.1", @@ -14560,13 +14892,13 @@ }, "license": "MIT OR Apache-2.0" }, - "gitlab 0.1603.0": { + "gitlab 0.1610.0": { "name": "gitlab", - "version": "0.1603.0", + "version": "0.1610.0", "repository": { "Http": { - "url": "https://static.crates.io/crates/gitlab/0.1603.0/download", - "sha256": "b3f2c47b143c826e356bd2aa344998bb3e92d8c348860677fb95d3743b2e5062" + "url": "https://static.crates.io/crates/gitlab/0.1610.0/download", + "sha256": "d6c802fc7eb82ff5ba2e4447c5acd0f18ec1b7bb95dbe95b6d77639e25be7cbe" } }, "targets": [ @@ -14673,7 +15005,7 @@ ], "selects": {} }, - "edition": "2018", + "edition": "2021", "proc_macro_deps": { "common": [ { @@ -14683,7 +15015,7 @@ ], "selects": {} }, - "version": "0.1603.0" + "version": "0.1610.0" }, "license": "MIT/Apache-2.0" }, @@ -16667,6 +16999,73 @@ }, "license": "MIT/Apache-2.0" }, + "hyper-tls 0.6.0": { + "name": "hyper-tls", + "version": "0.6.0", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/hyper-tls/0.6.0/download", + "sha256": "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" + } + }, + "targets": [ + { + "Library": { + "crate_name": "hyper_tls", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "hyper_tls", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "bytes 1.6.0", + "target": "bytes" + }, + { + "id": "http-body-util 0.1.1", + "target": "http_body_util" + }, + { + "id": "hyper 1.2.0", + "target": "hyper" + }, + { + "id": "hyper-util 0.1.3", + "target": "hyper_util" + }, + { + "id": "native-tls 0.2.11", + "target": "native_tls" + }, + { + "id": "tokio 1.37.0", + "target": "tokio" + }, + { + "id": "tokio-native-tls 0.3.1", + "target": "tokio_native_tls" + }, + { + "id": "tower-service 0.3.2", + "target": "tower_service" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "0.6.0" + }, + "license": "MIT/Apache-2.0" + }, "hyper-util 0.1.3": { "name": "hyper-util", "version": "0.1.3", @@ -16699,7 +17098,153 @@ "server", "tokio" ], - "selects": {} + "selects": { + "aarch64-apple-darwin": [ + "client", + "client-legacy", + "http2" + ], + "aarch64-apple-ios": [ + "client", + "client-legacy", + "http2" + ], + "aarch64-apple-ios-sim": [ + "client", + "client-legacy", + "http2" + ], + "aarch64-fuchsia": [ + "client", + "client-legacy", + "http2" + ], + "aarch64-linux-android": [ + "client", + "client-legacy", + "http2" + ], + "aarch64-pc-windows-msvc": [ + "client", + "client-legacy", + "http2" + ], + "aarch64-unknown-linux-gnu": [ + "client", + "client-legacy", + "http2" + ], + "arm-unknown-linux-gnueabi": [ + "client", + "client-legacy", + "http2" + ], + "armv7-linux-androideabi": [ + "client", + "client-legacy", + "http2" + ], + "armv7-unknown-linux-gnueabi": [ + "client", + "client-legacy", + "http2" + ], + "i686-apple-darwin": [ + "client", + "client-legacy", + "http2" + ], + "i686-linux-android": [ + "client", + "client-legacy", + "http2" + ], + "i686-pc-windows-msvc": [ + "client", + "client-legacy", + "http2" + ], + "i686-unknown-freebsd": [ + "client", + "client-legacy", + "http2" + ], + "i686-unknown-linux-gnu": [ + "client", + "client-legacy", + "http2" + ], + "powerpc-unknown-linux-gnu": [ + "client", + "client-legacy", + "http2" + ], + "riscv32imc-unknown-none-elf": [ + "client", + "client-legacy", + "http2" + ], + "riscv64gc-unknown-none-elf": [ + "client", + "client-legacy", + "http2" + ], + "s390x-unknown-linux-gnu": [ + "client", + "client-legacy", + "http2" + ], + "thumbv7em-none-eabi": [ + "client", + "client-legacy", + "http2" + ], + "thumbv8m.main-none-eabi": [ + "client", + "client-legacy", + "http2" + ], + "x86_64-apple-darwin": [ + "client", + "client-legacy", + "http2" + ], + "x86_64-apple-ios": [ + "client", + "client-legacy", + "http2" + ], + "x86_64-fuchsia": [ + "client", + "client-legacy", + "http2" + ], + "x86_64-linux-android": [ + "client", + "client-legacy", + "http2" + ], + "x86_64-pc-windows-msvc": [ + "client", + "client-legacy", + "http2" + ], + "x86_64-unknown-freebsd": [ + "client", + "client-legacy", + "http2" + ], + "x86_64-unknown-linux-gnu": [ + "client", + "client-legacy", + "http2" + ], + "x86_64-unknown-none": [ + "client", + "client-legacy", + "http2" + ] + } }, "deps": { "common": [ @@ -16707,6 +17252,10 @@ "id": "bytes 1.6.0", "target": "bytes" }, + { + "id": "futures-channel 0.3.30", + "target": "futures_channel" + }, { "id": "futures-util 0.3.30", "target": "futures_util" @@ -16734,6 +17283,18 @@ { "id": "tokio 1.37.0", "target": "tokio" + }, + { + "id": "tower 0.4.13", + "target": "tower" + }, + { + "id": "tower-service 0.3.2", + "target": "tower_service" + }, + { + "id": "tracing 0.1.40", + "target": "tracing" } ], "selects": {} @@ -21725,7 +22286,7 @@ "target": "custom_error" }, { - "id": "derive_builder 0.12.0", + "id": "derive_builder 0.20.0", "target": "derive_builder" }, { @@ -21737,7 +22298,7 @@ "target": "dotenv" }, { - "id": "env_logger 0.10.2", + "id": "env_logger 0.11.3", "target": "env_logger" }, { @@ -21757,7 +22318,7 @@ "target": "futures_util" }, { - "id": "gitlab 0.1603.0", + "id": "gitlab 0.1610.0", "target": "gitlab" }, { @@ -21853,7 +22414,7 @@ "target": "registry_canister" }, { - "id": "reqwest 0.11.27", + "id": "reqwest 0.12.2", "target": "reqwest" }, { @@ -21869,7 +22430,7 @@ "target": "serde_yaml" }, { - "id": "strum 0.25.0", + "id": "strum 0.26.2", "target": "strum" }, { @@ -21904,7 +22465,7 @@ "target": "async_trait" }, { - "id": "strum_macros 0.25.3", + "id": "strum_macros 0.26.2", "target": "strum_macros" } ], @@ -21977,7 +22538,7 @@ "target": "registry_canister" }, { - "id": "reqwest 0.11.27", + "id": "reqwest 0.12.2", "target": "reqwest" }, { @@ -21989,7 +22550,7 @@ "target": "serde_json" }, { - "id": "strum 0.25.0", + "id": "strum 0.26.2", "target": "strum" }, { @@ -22003,7 +22564,7 @@ "proc_macro_deps": { "common": [ { - "id": "strum_macros 0.25.3", + "id": "strum_macros 0.26.2", "target": "strum_macros" } ], @@ -28538,7 +29099,7 @@ "target": "pretty_env_logger" }, { - "id": "reqwest 0.11.27", + "id": "reqwest 0.12.2", "target": "reqwest" }, { @@ -29477,7 +30038,7 @@ "target": "axum_otel_metrics" }, { - "id": "base64 0.21.7", + "id": "base64 0.22.0", "target": "base64" }, { @@ -29658,7 +30219,7 @@ "target": "regex" }, { - "id": "reqwest 0.11.27", + "id": "reqwest 0.12.2", "target": "reqwest" }, { @@ -30231,7 +30792,7 @@ "target": "rand" }, { - "id": "reqwest 0.11.27", + "id": "reqwest 0.12.2", "target": "reqwest" }, { @@ -34947,7 +35508,7 @@ "target": "anyhow" }, { - "id": "base64 0.21.7", + "id": "base64 0.22.0", "target": "base64" }, { @@ -36822,6 +37383,200 @@ }, "license": "MIT OR Apache-2.0" }, + "reqwest 0.12.2": { + "name": "reqwest", + "version": "0.12.2", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/reqwest/0.12.2/download", + "sha256": "2d66674f2b6fb864665eea7a3c1ac4e3dfacd2fda83cf6f935a612e01b0e3338" + } + }, + "targets": [ + { + "Library": { + "crate_name": "reqwest", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "reqwest", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "__tls", + "charset", + "default", + "default-tls", + "h2", + "http2", + "json", + "macos-system-configuration" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "base64 0.21.7", + "target": "base64" + }, + { + "id": "bytes 1.6.0", + "target": "bytes" + }, + { + "id": "futures-core 0.3.30", + "target": "futures_core" + }, + { + "id": "futures-util 0.3.30", + "target": "futures_util" + }, + { + "id": "http 1.1.0", + "target": "http" + }, + { + "id": "serde 1.0.197", + "target": "serde" + }, + { + "id": "serde_json 1.0.115", + "target": "serde_json" + }, + { + "id": "serde_urlencoded 0.7.1", + "target": "serde_urlencoded" + }, + { + "id": "sync_wrapper 0.1.2", + "target": "sync_wrapper" + }, + { + "id": "tower-service 0.3.2", + "target": "tower_service" + }, + { + "id": "url 2.5.0", + "target": "url" + } + ], + "selects": { + "cfg(not(target_arch = \"wasm32\"))": [ + { + "id": "encoding_rs 0.8.33", + "target": "encoding_rs" + }, + { + "id": "h2 0.4.3", + "target": "h2" + }, + { + "id": "http-body 1.0.0", + "target": "http_body" + }, + { + "id": "http-body-util 0.1.1", + "target": "http_body_util" + }, + { + "id": "hyper 1.2.0", + "target": "hyper" + }, + { + "id": "hyper-tls 0.6.0", + "target": "hyper_tls" + }, + { + "id": "hyper-util 0.1.3", + "target": "hyper_util" + }, + { + "id": "ipnet 2.9.0", + "target": "ipnet" + }, + { + "id": "log 0.4.21", + "target": "log" + }, + { + "id": "mime 0.3.17", + "target": "mime" + }, + { + "id": "native-tls 0.2.11", + "target": "native_tls", + "alias": "native_tls_crate" + }, + { + "id": "once_cell 1.19.0", + "target": "once_cell" + }, + { + "id": "percent-encoding 2.3.1", + "target": "percent_encoding" + }, + { + "id": "pin-project-lite 0.2.14", + "target": "pin_project_lite" + }, + { + "id": "rustls-pemfile 1.0.4", + "target": "rustls_pemfile" + }, + { + "id": "tokio 1.37.0", + "target": "tokio" + }, + { + "id": "tokio-native-tls 0.3.1", + "target": "tokio_native_tls" + } + ], + "cfg(target_arch = \"wasm32\")": [ + { + "id": "js-sys 0.3.69", + "target": "js_sys" + }, + { + "id": "wasm-bindgen 0.2.92", + "target": "wasm_bindgen" + }, + { + "id": "wasm-bindgen-futures 0.4.42", + "target": "wasm_bindgen_futures" + }, + { + "id": "web-sys 0.3.69", + "target": "web_sys" + } + ], + "cfg(target_os = \"macos\")": [ + { + "id": "system-configuration 0.5.1", + "target": "system_configuration" + } + ], + "cfg(windows)": [ + { + "id": "winreg 0.50.0", + "target": "winreg" + } + ] + } + }, + "edition": "2021", + "version": "0.12.2" + }, + "license": "MIT OR Apache-2.0" + }, "retry 2.0.0": { "name": "retry", "version": "2.0.0", @@ -37324,7 +38079,7 @@ "target": "registry_canister" }, { - "id": "reqwest 0.11.27", + "id": "reqwest 0.12.2", "target": "reqwest" }, { @@ -40462,7 +41217,7 @@ "target": "dotenv" }, { - "id": "env_logger 0.10.2", + "id": "env_logger 0.11.3", "target": "env_logger" }, { @@ -40506,7 +41261,7 @@ "target": "registry_canister" }, { - "id": "reqwest 0.11.27", + "id": "reqwest 0.12.2", "target": "reqwest" }, { @@ -40995,7 +41750,7 @@ "target": "regex" }, { - "id": "reqwest 0.11.27", + "id": "reqwest 0.12.2", "target": "reqwest" }, { @@ -41592,6 +42347,54 @@ }, "license": "MIT" }, + "strum 0.26.2": { + "name": "strum", + "version": "0.26.2", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/strum/0.26.2/download", + "sha256": "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" + } + }, + "targets": [ + { + "Library": { + "crate_name": "strum", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "strum", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "derive", + "std", + "strum_macros" + ], + "selects": {} + }, + "edition": "2018", + "proc_macro_deps": { + "common": [ + { + "id": "strum_macros 0.26.2", + "target": "strum_macros" + } + ], + "selects": {} + }, + "version": "0.26.2" + }, + "license": "MIT" + }, "strum_macros 0.24.3": { "name": "strum_macros", "version": "0.24.3", @@ -41712,6 +42515,66 @@ }, "license": "MIT" }, + "strum_macros 0.26.2": { + "name": "strum_macros", + "version": "0.26.2", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/strum_macros/0.26.2/download", + "sha256": "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" + } + }, + "targets": [ + { + "ProcMacro": { + "crate_name": "strum_macros", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "strum_macros", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "heck 0.4.1", + "target": "heck" + }, + { + "id": "proc-macro2 1.0.79", + "target": "proc_macro2" + }, + { + "id": "quote 1.0.35", + "target": "quote" + }, + { + "id": "syn 2.0.57", + "target": "syn" + } + ], + "selects": {} + }, + "edition": "2018", + "proc_macro_deps": { + "common": [ + { + "id": "rustversion 1.0.14", + "target": "rustversion" + } + ], + "selects": {} + }, + "version": "0.26.2" + }, + "license": "MIT" + }, "subtle 2.5.0": { "name": "subtle", "version": "2.5.0", From ec29ea4ce8b93c58e09a141efe624608177cf1fc Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 10:00:11 +0200 Subject: [PATCH 06/21] changing how the files are uploaded --- .../check-modified-files-as-step/action.yaml | 37 +++++++++++++++++++ .github/workflows/dashboard.yaml | 7 ---- .github/workflows/main.yaml | 34 ++++++++++++++++- .../update-k8s-deployments/action.yaml | 4 ++ 4 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/check-modified-files-as-step/action.yaml diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml new file mode 100644 index 000000000..b65009c4a --- /dev/null +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -0,0 +1,37 @@ +name: Check if a path was modified +description: Reusable action for checking if a file path is modified as a step. It outputs a `changed` variable which can be referenced later. + +inputs: + path: + description: 'Path to check' + required: true + +runs: + using: composite + steps: + ######################################## + # Optimize bazel cache by hard-linking duplicate files + ######################################## + - name: "πŸ” Check if $PATH_TO_CHECK is modified in last commit " + env: + PATH_TO_CHECK: ${{ inputs.path }} + shell: bash + run: | + set -eExou pipefail + + echo "=============== list modified files ===============" + git diff --name-only HEAD^ HEAD + + echo "========== check paths of modified files ==========" + git diff --name-only HEAD^ HEAD > files.txt + while IFS= read -r file + do + echo $file + if [[ $file != $PATH_TO_CHECK ]]; then + echo "::set-output name=changed::false" + else + echo "This modified file matches $PATH_TO_CHECK" + echo "::set-output name=changed::true" + break + fi + done < files.txt diff --git a/.github/workflows/dashboard.yaml b/.github/workflows/dashboard.yaml index febd75aa7..76d547c44 100644 --- a/.github/workflows/dashboard.yaml +++ b/.github/workflows/dashboard.yaml @@ -32,10 +32,3 @@ jobs: if: ${{ startsWith(github.head_ref, 'container') || startsWith(github.ref, 'refs/heads/container') || (github.ref == 'refs/heads/main') }} run: | docker push ghcr.io/dfinity/dre/ic-management-frontend:$GITHUB_SHA - - - name: "πŸ€– Update k8s deployments" - if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.head_ref, 'container') || startsWith(github.ref, 'refs/heads/container') || (github.ref == 'refs/heads/main') }} - uses: ./.github/workflows/update-k8s-deployments - with: - gitlab_api_token: ${{ secrets.GITLAB_K8S_API_TOKEN }} - paths: bases/apps/mainnet-dashboard/frontend/deployment.yaml \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 53d1030c4..88ffea954 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -65,6 +65,38 @@ jobs: if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.head_ref, 'container') || startsWith(github.ref, 'refs/heads/container') || (github.ref == 'refs/heads/main') }} run: bazel query --noshow_progress 'kind("oci_push", ...)' | xargs -I_target bazel run _target -- --tag ${GITHUB_SHA} + ######################################## + # Check if dashboard/* changed to see if + # it also needs to be updated in k8s + ######################################## + - name: "❓ Check if dashboard/* changed in last commit" + id: check + uses: ./.github/workflows/check-modified-files-as-step + with: + path: dashboard/* + + - name: "πŸ’² Setting correct paths to update" + id: paths + env: + PATH_CHANGED: ${{ steps.check.outputs.changed }} + shell: bash + run: | + files=( + bases/apps/mainnet-dashboard/statefulset-slack.yaml + bases/apps/mainnet-dashboard/backend/base/deployment.yaml + ) + if [[ $PATH_CHANGED == "true" ]]; then + echo "Adding frontend to list of files" + files+=( bases/apps/mainnet-dashboard/frontend/deployment.yaml ) + else + echo "Skipping adding of frontend to list of files" + fi + + files_json=$(echo "${files[@]}" | jq -R . | jq -s .) + echo "Output of this step:" + echo $files_json + echo "::set-output name=filesJson::$files_json" + ######################################## # Update k8s deployments ######################################## @@ -73,7 +105,7 @@ jobs: uses: ./.github/workflows/update-k8s-deployments with: gitlab_api_token: ${{ secrets.GITLAB_K8S_API_TOKEN }} - paths: bases/apps/mainnet-dashboard/statefulset-slack.yaml bases/apps/mainnet-dashboard/backend/base/deployment.yaml + paths: ${{ steps.paths.outputs.filesJson }} ######################################## diff --git a/.github/workflows/update-k8s-deployments/action.yaml b/.github/workflows/update-k8s-deployments/action.yaml index b599f34be..07ee177dc 100644 --- a/.github/workflows/update-k8s-deployments/action.yaml +++ b/.github/workflows/update-k8s-deployments/action.yaml @@ -20,6 +20,10 @@ runs: run: | set -eExou pipefail + files=$(echo $K8S_PATHS | jq -r '.[]') + echo "Should change following files:" + echo $files + cd .git # checkout branch From 12a07bfd13124cd671efa2de5240e2fe41e6e3be Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 10:03:12 +0200 Subject: [PATCH 07/21] updating comment --- .github/workflows/check-modified-files-as-step/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml index b65009c4a..49541655f 100644 --- a/.github/workflows/check-modified-files-as-step/action.yaml +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -10,7 +10,7 @@ runs: using: composite steps: ######################################## - # Optimize bazel cache by hard-linking duplicate files + # Check to see if files changed ######################################## - name: "πŸ” Check if $PATH_TO_CHECK is modified in last commit " env: From 67d62b5c7a95685519be9b242a32b3962cd2393a Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 10:17:16 +0200 Subject: [PATCH 08/21] updating sha of ic-icrc1 --- WORKSPACE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index debefaa88..c76fb2415 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -113,7 +113,7 @@ crate_repositories() http_file( name = "ic-icrc1-archive", downloaded_file_path = "ic-icrc1-archive.wasm.gz", - sha256 = "46aac8f1db925e166a1d8fc45ff33505a41afb6f9ba0581028b76199e0a07727", + sha256 = "6e9869a0d51a4e0f6b6f111958c06fbca0a6476483d6048a512d4df845ebe0ae", url = "https://download.dfinity.systems/ic/778d2bb870f858952ca9fbe69324f9864e3cf5e7/canisters/ic-icrc1-archive.wasm.gz", ) From cc3df30678e95b9f8bd3d92abbe66a31718c41de Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 11:41:32 +0200 Subject: [PATCH 09/21] adding pwd --- .../check-modified-files-as-step/action.yaml | 2 +- .github/workflows/main.yaml | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml index 49541655f..d0415f79f 100644 --- a/.github/workflows/check-modified-files-as-step/action.yaml +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -18,7 +18,7 @@ runs: shell: bash run: | set -eExou pipefail - + pwd echo "=============== list modified files ===============" git diff --name-only HEAD^ HEAD diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 88ffea954..a91900290 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -20,18 +20,18 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - - name: "☁️ Setup runner" - uses: ./.github/workflows/manage-runner-pre + # - name: "☁️ Setup runner" + # uses: ./.github/workflows/manage-runner-pre ######################################## # Build and test ######################################## - - name: "πŸš€ Building" - uses: ./.github/workflows/build - with: - ssh_pk_workflow: ${{ secrets.SSH_PK_WORKFLOW }} - - run: bazel test ... - name: "πŸš€ Testing" + # - name: "πŸš€ Building" + # uses: ./.github/workflows/build + # with: + # ssh_pk_workflow: ${{ secrets.SSH_PK_WORKFLOW }} + # - run: bazel test ... + # name: "πŸš€ Testing" ######################################## # Upload test artifacts @@ -111,7 +111,7 @@ jobs: ######################################## # Clean up runner ######################################## - - uses: ./.github/workflows/manage-runner-post - name: "πŸͺ“ Tear down runner" - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - uses: ./.github/workflows/manage-runner-post + # name: "πŸͺ“ Tear down runner" + # with: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 171ff7fa1591cacee1736ddc22968a22137e06dc Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 11:43:57 +0200 Subject: [PATCH 10/21] adding status print --- .github/workflows/check-modified-files-as-step/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml index d0415f79f..a2dca9947 100644 --- a/.github/workflows/check-modified-files-as-step/action.yaml +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -18,7 +18,7 @@ runs: shell: bash run: | set -eExou pipefail - pwd + git status echo "=============== list modified files ===============" git diff --name-only HEAD^ HEAD From fa545e0475f9a1037d1ac62f0697112a5641ef01 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 11:48:54 +0200 Subject: [PATCH 11/21] adding sha --- .../workflows/check-modified-files-as-step/action.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml index a2dca9947..d5e2ba00a 100644 --- a/.github/workflows/check-modified-files-as-step/action.yaml +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -15,15 +15,18 @@ runs: - name: "πŸ” Check if $PATH_TO_CHECK is modified in last commit " env: PATH_TO_CHECK: ${{ inputs.path }} + SHA: ${{ github.sha }} shell: bash run: | set -eExou pipefail - git status + + echo "Github sha: $SHA" + echo "=============== list modified files ===============" - git diff --name-only HEAD^ HEAD + git diff --name-only $SHA^ $SHA echo "========== check paths of modified files ==========" - git diff --name-only HEAD^ HEAD > files.txt + git diff --name-only $SHA^ $SHA > files.txt while IFS= read -r file do echo $file From 048545c0673f10c89e4f8ec73eecbb1768b9bbc0 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 11:50:38 +0200 Subject: [PATCH 12/21] changing to use env variable --- .github/workflows/check-modified-files-as-step/action.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml index d5e2ba00a..e4adcfd1d 100644 --- a/.github/workflows/check-modified-files-as-step/action.yaml +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -15,18 +15,17 @@ runs: - name: "πŸ” Check if $PATH_TO_CHECK is modified in last commit " env: PATH_TO_CHECK: ${{ inputs.path }} - SHA: ${{ github.sha }} shell: bash run: | set -eExou pipefail - echo "Github sha: $SHA" + echo "Github sha: $GITHUB_SHA" echo "=============== list modified files ===============" - git diff --name-only $SHA^ $SHA + git diff --name-only $GITHUB_SHA^ $GITHUB_SHA echo "========== check paths of modified files ==========" - git diff --name-only $SHA^ $SHA > files.txt + git diff --name-only $GITHUB_SHA^ $GITHUB_SHA > files.txt while IFS= read -r file do echo $file From 73ac134d3039e3c550bbd06ec1ae4ababcc14981 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 11:53:27 +0200 Subject: [PATCH 13/21] adding sha for calculation --- .../workflows/check-modified-files-as-step/action.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml index e4adcfd1d..64056fa76 100644 --- a/.github/workflows/check-modified-files-as-step/action.yaml +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -18,14 +18,14 @@ runs: shell: bash run: | set -eExou pipefail - - echo "Github sha: $GITHUB_SHA" + SHA=$(git log -1 --pretty=format:"%H") + echo "Github sha: $SHA" echo "=============== list modified files ===============" - git diff --name-only $GITHUB_SHA^ $GITHUB_SHA + git diff --name-only $SHA^ $SHA echo "========== check paths of modified files ==========" - git diff --name-only $GITHUB_SHA^ $GITHUB_SHA > files.txt + git diff --name-only $SHA^ $SHA > files.txt while IFS= read -r file do echo $file From 24c356785813e57602c1e5312a31ec654f3f1168 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 11:55:47 +0200 Subject: [PATCH 14/21] increasing git fetch depth --- .github/workflows/check-modified-files-as-step/action.yaml | 6 ++---- .github/workflows/main.yaml | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml index 64056fa76..49541655f 100644 --- a/.github/workflows/check-modified-files-as-step/action.yaml +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -18,14 +18,12 @@ runs: shell: bash run: | set -eExou pipefail - SHA=$(git log -1 --pretty=format:"%H") - echo "Github sha: $SHA" echo "=============== list modified files ===============" - git diff --name-only $SHA^ $SHA + git diff --name-only HEAD^ HEAD echo "========== check paths of modified files ==========" - git diff --name-only $SHA^ $SHA > files.txt + git diff --name-only HEAD^ HEAD > files.txt while IFS= read -r file do echo $file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a91900290..dbfc847fb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -20,6 +20,8 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 + with: + fetch-depth: 2 # - name: "☁️ Setup runner" # uses: ./.github/workflows/manage-runner-pre From b02bc3438a8864ddad12b94ab5b485b1dc5fd1b0 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 11:58:12 +0200 Subject: [PATCH 15/21] changing to correct symbols --- .github/workflows/check-modified-files-as-step/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml index 49541655f..1a89b02c6 100644 --- a/.github/workflows/check-modified-files-as-step/action.yaml +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -23,7 +23,7 @@ runs: git diff --name-only HEAD^ HEAD echo "========== check paths of modified files ==========" - git diff --name-only HEAD^ HEAD > files.txt + git diff --name-only HEAD^ HEAD > files.txt while IFS= read -r file do echo $file @@ -34,4 +34,4 @@ runs: echo "::set-output name=changed::true" break fi - done < files.txt + done < files.txt From bb4af04a2134331f46259c377c31f94ee6d8f485 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 11:59:16 +0200 Subject: [PATCH 16/21] adding better debug print --- .github/workflows/check-modified-files-as-step/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml index 1a89b02c6..d1ca1b832 100644 --- a/.github/workflows/check-modified-files-as-step/action.yaml +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -30,7 +30,7 @@ runs: if [[ $file != $PATH_TO_CHECK ]]; then echo "::set-output name=changed::false" else - echo "This modified file matches $PATH_TO_CHECK" + echo "File $file matches $PATH_TO_CHECK" echo "::set-output name=changed::true" break fi From f8d61e249a303f661d955d136f98bca4cd9abcf3 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 12:01:51 +0200 Subject: [PATCH 17/21] updating to non-legacy options --- .github/workflows/check-modified-files-as-step/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml index d1ca1b832..751a9494a 100644 --- a/.github/workflows/check-modified-files-as-step/action.yaml +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -28,10 +28,10 @@ runs: do echo $file if [[ $file != $PATH_TO_CHECK ]]; then - echo "::set-output name=changed::false" + echo "changed=false" >> $GITHUB_OUTPUT else echo "File $file matches $PATH_TO_CHECK" - echo "::set-output name=changed::true" + echo "changed=true" >> $GITHUB_OUTPUT break fi done < files.txt From e5d05e098c3fdcf96afd64ae416ce16cbddb2af3 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 12:05:02 +0200 Subject: [PATCH 18/21] converting --- .github/workflows/check-modified-files-as-step/action.yaml | 4 ++-- .github/workflows/main.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-modified-files-as-step/action.yaml b/.github/workflows/check-modified-files-as-step/action.yaml index 751a9494a..12d4b8060 100644 --- a/.github/workflows/check-modified-files-as-step/action.yaml +++ b/.github/workflows/check-modified-files-as-step/action.yaml @@ -28,10 +28,10 @@ runs: do echo $file if [[ $file != $PATH_TO_CHECK ]]; then - echo "changed=false" >> $GITHUB_OUTPUT + echo "changed=false" >> $GITHUB_ENV else echo "File $file matches $PATH_TO_CHECK" - echo "changed=true" >> $GITHUB_OUTPUT + echo "changed=true" >> $GITHUB_ENV break fi done < files.txt diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index dbfc847fb..5d827b09b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -80,7 +80,7 @@ jobs: - name: "πŸ’² Setting correct paths to update" id: paths env: - PATH_CHANGED: ${{ steps.check.outputs.changed }} + PATH_CHANGED: $changed shell: bash run: | files=( @@ -97,7 +97,7 @@ jobs: files_json=$(echo "${files[@]}" | jq -R . | jq -s .) echo "Output of this step:" echo $files_json - echo "::set-output name=filesJson::$files_json" + echo "filesJson=$files_json" >> $GITHUB_ENV ######################################## # Update k8s deployments @@ -107,7 +107,7 @@ jobs: uses: ./.github/workflows/update-k8s-deployments with: gitlab_api_token: ${{ secrets.GITLAB_K8S_API_TOKEN }} - paths: ${{ steps.paths.outputs.filesJson }} + paths: $filesJson ######################################## From f55239720ea7d0d18efb6b024df76b09e5cde4d2 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 12:07:59 +0200 Subject: [PATCH 19/21] fixing --- .github/workflows/main.yaml | 9 +++------ .github/workflows/update-k8s-deployments/action.yaml | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5d827b09b..191c3bff4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -79,25 +79,22 @@ jobs: - name: "πŸ’² Setting correct paths to update" id: paths - env: - PATH_CHANGED: $changed shell: bash run: | files=( bases/apps/mainnet-dashboard/statefulset-slack.yaml bases/apps/mainnet-dashboard/backend/base/deployment.yaml ) - if [[ $PATH_CHANGED == "true" ]]; then + if [[ $changed == "true" ]]; then echo "Adding frontend to list of files" files+=( bases/apps/mainnet-dashboard/frontend/deployment.yaml ) else echo "Skipping adding of frontend to list of files" fi - files_json=$(echo "${files[@]}" | jq -R . | jq -s .) echo "Output of this step:" - echo $files_json - echo "filesJson=$files_json" >> $GITHUB_ENV + echo ${files[@]} + echo "files=${files[@]}" >> $GITHUB_ENV ######################################## # Update k8s deployments diff --git a/.github/workflows/update-k8s-deployments/action.yaml b/.github/workflows/update-k8s-deployments/action.yaml index 07ee177dc..5dc0929fa 100644 --- a/.github/workflows/update-k8s-deployments/action.yaml +++ b/.github/workflows/update-k8s-deployments/action.yaml @@ -20,7 +20,7 @@ runs: run: | set -eExou pipefail - files=$(echo $K8S_PATHS | jq -r '.[]') + files=$K8S_PATHS echo "Should change following files:" echo $files From 80fd0b8444de9ccd42799ef8f232a0692045411c Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 12:10:03 +0200 Subject: [PATCH 20/21] reenabling whole main --- .github/workflows/main.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 191c3bff4..9ee42ac58 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -22,18 +22,18 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 2 - # - name: "☁️ Setup runner" - # uses: ./.github/workflows/manage-runner-pre + - name: "☁️ Setup runner" + uses: ./.github/workflows/manage-runner-pre ######################################## # Build and test ######################################## - # - name: "πŸš€ Building" - # uses: ./.github/workflows/build - # with: - # ssh_pk_workflow: ${{ secrets.SSH_PK_WORKFLOW }} - # - run: bazel test ... - # name: "πŸš€ Testing" + - name: "πŸš€ Building" + uses: ./.github/workflows/build + with: + ssh_pk_workflow: ${{ secrets.SSH_PK_WORKFLOW }} + - run: bazel test ... + name: "πŸš€ Testing" ######################################## # Upload test artifacts @@ -110,7 +110,7 @@ jobs: ######################################## # Clean up runner ######################################## - # - uses: ./.github/workflows/manage-runner-post - # name: "πŸͺ“ Tear down runner" - # with: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: ./.github/workflows/manage-runner-post + name: "πŸͺ“ Tear down runner" + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 12d4141a7f6b31d29141b91dbd93c66103c91034 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 3 Apr 2024 12:40:36 +0200 Subject: [PATCH 21/21] using files instead of variable --- .github/workflows/main.yaml | 1 - .github/workflows/update-k8s-deployments/action.yaml | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9ee42ac58..26417b9ec 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -104,7 +104,6 @@ jobs: uses: ./.github/workflows/update-k8s-deployments with: gitlab_api_token: ${{ secrets.GITLAB_K8S_API_TOKEN }} - paths: $filesJson ######################################## diff --git a/.github/workflows/update-k8s-deployments/action.yaml b/.github/workflows/update-k8s-deployments/action.yaml index 5dc0929fa..d44729280 100644 --- a/.github/workflows/update-k8s-deployments/action.yaml +++ b/.github/workflows/update-k8s-deployments/action.yaml @@ -5,9 +5,6 @@ inputs: gitlab_api_token: description: 'A GitLab API token with access to the k8s repository' required: true - paths: - description: 'Paths in k8s repo to update' - required: true runs: using: composite @@ -15,12 +12,10 @@ runs: - name: "☸️ Update k8s deployments" env: GITLAB_API_TOKEN: ${{ inputs.gitlab_api_token }} - K8S_PATHS: ${{ inputs.paths }} shell: bash run: | set -eExou pipefail - files=$K8S_PATHS echo "Should change following files:" echo $files @@ -38,7 +33,7 @@ runs: # this regex matches the first group (ie the image name) and uses \1 # called a back-reference to insert the first group matched, the second # part is to match the 40 characters hash that we replace with the $GITHUB_SHA - sed -i "s~\(\([[:alpha:]]\|-\)\+\):[[:alnum:]]\{40\}~\1:${GITHUB_SHA}~g" ${K8S_PATHS} + sed -i "s~\(\([[:alpha:]]\|-\)\+\):[[:alnum:]]\{40\}~\1:${GITHUB_SHA}~g" $files # commit changes if there are any git add .