Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing governance cd #955

Merged

Conversation

tenmoves
Copy link
Contributor

@tenmoves tenmoves commented Mar 21, 2023

Description

fix governance CD pipeline

Fixes #951 #974 #998 #970 #971

for testing add the following to .iex.exs

alias Archethic.Governance.Code.CICD.Docker
prop = %Archethic.Governance.Code.Proposal{
  address: <<0, 0, 135, 189, 175, 8, 43, 160, 49, 21, 23, 241, 61, 189, 221,
    177, 45, 120, 59, 243, 80, 75, 193, 250, 119, 188, 219, 73, 209, 197, 118,
    170, 122, 142>>,
  previous_public_key: <<0, 1, 62, 205, 23, 142, 29, 217, 94, 202, 136, 109,
    165, 135, 153, 205, 202, 132, 122, 116, 97, 18, 90, 34, 141, 225, 172, 138,
    16, 138, 85, 15, 41, 149>>,
  timestamp: nil,
  description: "\Testing code proposal\"",
  changes: "diff --git a/mix.exs b/mix.exs\nindex a82c0b3c..b94d4323 100644\n--- a/mix.exs\n+++ b/mix.exs\n@@ -4,7 +4,7 @@ defmodule Archethic.MixProject do\n   def project do\n     [\n       app: :archethic,\n-      version: \"1.0.8-rc1\",\n+      version: \"1.0.9\",\n       build_path: \"_build\",\n       config_path: \"config/config.exs\",\n       deps_path: \"deps\",\ndiff --git a/rel/appups/archethic/1.0.8-rc1_to_1.0.9.appup b/rel/appups/archethic/1.0.8-rc1_to_1.0.9.appup\nnew file mode 100644\nindex 00000000..18b6d541\n--- /dev/null\n+++ b/rel/appups/archethic/1.0.8-rc1_to_1.0.9.appup\n@@ -0,0 +1,4 @@\n+{\"1.0.9\",\n+ [{\"1.0.8-rc1\",\n+   [{load_module,'Elixir.Archethic', []}]}],\n+ [{\"1.0.8-rc1\",\n+   [{load_module,'Elixir.Archethic', []}]}]\n+}.\n",
  version: "1.0.9",
  files: ["mix.exs", "rel/appups/archethic/1.0.8-rc1_to_1.0.9.appup"],
  approvals: [
    <<0, 0, 135, 189, 175, 8, 43, 160, 49, 21, 23, 241, 61, 189, 221, 177, 45,
      120, 59, 243, 80, 75, 193, 250, 119, 188, 219, 73, 209, 197, 118, 170,
      122, 142>>,
    <<0, 0, 168, 220, 209, 92, 167, 255, 187, 168, 176, 63, 128, 210, 199, 35,
      63, 0, 252, 36, 147, 196, 130, 249, 233, 17, 132, 0, 6, 88, 232, 198, 98,
      44>>
  ]
}

and launch Docker.run_ci!(prop) and Docker.run_testnet!(prop).

@tenmoves tenmoves added core team Assigned to the core team Governance About On-Chain governance labels Mar 21, 2023
@tenmoves tenmoves self-assigned this Mar 21, 2023
@tenmoves tenmoves force-pushed the fixing_governance_cd branch 6 times, most recently from b0a0d5d to 9959068 Compare March 30, 2023 18:25
@tenmoves tenmoves marked this pull request as ready for review March 30, 2023 18:25
@tenmoves
Copy link
Contributor Author

tenmoves commented Mar 30, 2023

in order to test add this to your .iex.exs file

alias Archethic.Governance.Code.CICD.Docker prop = %Archethic.Governance.Code.Proposal{ address: <<0, 0, 135, 189, 175, 8, 43, 160, 49, 21, 23, 241, 61, 189, 221, 177, 45, 120, 59, 243, 80, 75, 193, 250, 119, 188, 219, 73, 209, 197, 118, 170, 122, 142>>, previous_public_key: <<0, 1, 62, 205, 23, 142, 29, 217, 94, 202, 136, 109, 165, 135, 153, 205, 202, 132, 122, 116, 97, 18, 90, 34, 141, 225, 172, 138, 16, 138, 85, 15, 41, 149>>, timestamp: nil, description: "\Testing code proposal\"", changes: "diff --git a/mix.exs b/mix.exs\nindex a82c0b3c..b94d4323 100644\n--- a/mix.exs\n+++ b/mix.exs\n@@ -4,7 +4,7 @@ defmodule Archethic.MixProject do\n def project do\n [\n app: :archethic,\n- version: \"1.0.7\",\n+ version: \"1.0.8\",\n build_path: \"_build\",\n config_path: \"config/config.exs\",\n deps_path: \"deps\",\ndiff --git a/rel/appups/archethic/1.0.7_to_1.0.8.appup b/rel/appups/archethic/1.0.7_to_1.0.8.appup\nnew file mode 100644\nindex 00000000..18b6d541\n--- /dev/null\n+++ b/rel/appups/archethic/1.0.7_to_1.0.8.appup\n@@ -0,0 +1,4 @@\n+{\"1.0.8\",\n+ [{\"1.0.7\",\n+ [{load_module,'Elixir.Archethic', []}]}],\n+ [{\"1.0.7\",\n+ [{load_module,'Elixir.Archethic', []}]}]\n+}.\n", version: "1.0.8", files: ["mix.exs", "rel/appups/archethic/1.0.7_to_1.0.8.appup"], approvals: [ <<0, 0, 135, 189, 175, 8, 43, 160, 49, 21, 23, 241, 61, 189, 221, 177, 45, 120, 59, 243, 80, 75, 193, 250, 119, 188, 219, 73, 209, 197, 118, 170, 122, 142>>, <<0, 0, 168, 220, 209, 92, 167, 255, 187, 168, 176, 63, 128, 210, 199, 35, 63, 0, 252, 36, 147, 196, 130, 249, 233, 17, 132, 0, 6, 88, 232, 198, 98, 44>> ] }
then you can launch
Docker.run_ci!(prop)

and after
Docker.run_testnet!(prop)

@tenmoves tenmoves force-pushed the fixing_governance_cd branch 2 times, most recently from 7792cde to dcb09bf Compare April 4, 2023 08:47
config/config.exs Outdated Show resolved Hide resolved
Copy link
Contributor

@cluster cluster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having a hard time testing it... but it seems related to my computer... it looks like Apple Silicon processors, Docker and xla aren't good friends... 🤔
so just one small remark :)

lib/mix/tasks/utils.ex Outdated Show resolved Hide resolved
@tenmoves tenmoves force-pushed the fixing_governance_cd branch 3 times, most recently from 2ad5668 to 0222d8b Compare April 13, 2023 09:40
@tenmoves tenmoves force-pushed the fixing_governance_cd branch 2 times, most recently from 0222d8b to 1d460c9 Compare April 18, 2023 13:07
@samuelmanzanera
Copy link
Member

samuelmanzanera commented Apr 18, 2023

Using MIX_ENV=test mix test --trace in the pre_push git hooks fixes the tests during the CI's image building.

Because the docker file using the MIX_ENV=prod we have to indicate during the tests for the CI to use the test environment to avoid spawning of supervisor children such as scheduler, listeners, etc...

@tenmoves tenmoves force-pushed the fixing_governance_cd branch 2 times, most recently from 3cbd5b0 to fec2f12 Compare April 25, 2023 13:43
@bchamagne
Copy link
Member

Updated proposal for 1.1.0-rc2 to 1.1.0-rc3

alias Archethic.Governance.Code.CICD.Docker
prop = %Archethic.Governance.Code.Proposal{
  address: <<0, 0, 135, 189, 175, 8, 43, 160, 49, 21, 23, 241, 61, 189, 221,
    177, 45, 120, 59, 243, 80, 75, 193, 250, 119, 188, 219, 73, 209, 197, 118,
    170, 122, 142>>,
  previous_public_key: <<0, 1, 62, 205, 23, 142, 29, 217, 94, 202, 136, 109,
    165, 135, 153, 205, 202, 132, 122, 116, 97, 18, 90, 34, 141, 225, 172, 138,
    16, 138, 85, 15, 41, 149>>,
  timestamp: nil,
  description: "\Testing code proposal\"",
  changes: "diff --git a/mix.exs b/mix.exs\nindex a82c0b3c..b94d4323 100644\n--- a/mix.exs\n+++ b/mix.exs\n@@ -4,7 +4,7 @@ defmodule Archethic.MixProject do\n   def project do\n     [\n       app: :archethic,\n-      version: \"1.1.0-rc2\",\n+      version: \"1.1.0-rc3\",\n       build_path: \"_build\",\n       config_path: \"config/config.exs\",\n       deps_path: \"deps\",\ndiff --git a/rel/appups/archethic/1.1.0-rc2_to_1.1.0-rc3.appup b/rel/appups/archethic/1.1.0-rc2_to_1.1.0-rc3.appup\nnew file mode 100644\nindex 00000000..18b6d541\n--- /dev/null\n+++ b/rel/appups/archethic/1.1.0-rc2_to_1.1.0-rc3.appup\n@@ -0,0 +1,4 @@\n+{\"1.1.0-rc3\",\n+ [{\"1.1.0-rc2\",\n+   [{load_module,'Elixir.Archethic', []}]}],\n+ [{\"1.1.0-rc2\",\n+   [{load_module,'Elixir.Archethic', []}]}]\n+}.\n",
  version: "1.1.0-rc3",
  files: ["mix.exs", "rel/appups/archethic/1.1.0-rc2_to_1.1.0-rc3.appup"],
  approvals: [
    <<0, 0, 135, 189, 175, 8, 43, 160, 49, 21, 23, 241, 61, 189, 221, 177, 45,
      120, 59, 243, 80, 75, 193, 250, 119, 188, 219, 73, 209, 197, 118, 170,
      122, 142>>,
    <<0, 0, 168, 220, 209, 92, 167, 255, 187, 168, 176, 63, 128, 210, 199, 35,
      63, 0, 252, 36, 147, 196, 130, 249, 233, 17, 132, 0, 6, 88, 232, 198, 98,
      44>>
  ]
}
Docker.run_ci!(prop)
Docker.run_testnet!(prop)

@samuelmanzanera
Copy link
Member

samuelmanzanera commented May 30, 2023

For multiple runs, I got

image

@samuelmanzanera samuelmanzanera merged commit af0c186 into archethic-foundation:develop Jun 5, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core team Assigned to the core team enhancements Governance About On-Chain governance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the continuous deployment of code proposals
4 participants