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

feat: introduce the CLI and build workflows #4

Merged
merged 22 commits into from
Aug 14, 2024
Merged

Conversation

vcastellm
Copy link
Contributor

@vcastellm vcastellm commented May 30, 2024

This is the first PR introducing the CLI to handle configuration and execution of the different components of the system. In this PoC of the CLI it's only capable of running cdk-node as a subprocess and accept 2 configuration files:

  1. The genesis file
  2. The node-config file

Also introduce the necessary workflows to build and release docker images to docker repositories compiling and including these elements.

e2e-testing

I've simplified a lot here, if we're testing in local, it's assumed that the developer will have a correct environment running, it's opinionated in the sense that it's required to have kurtosis-cdk installed and checked-out on the version you want to try. Similar to having docker installed on your system.

Also, there are a lot of defaults now so we don't need to set them.

Reviewer: @goran-ethernal

@vcastellm vcastellm marked this pull request as draft June 20, 2024 16:05
@vcastellm vcastellm marked this pull request as draft June 20, 2024 16:05
@vcastellm vcastellm changed the base branch from main to develop July 15, 2024 10:41
@vcastellm vcastellm changed the title Scaffold running EC feat: Introduce the CLI and build workflows Jul 22, 2024
@vcastellm vcastellm force-pushed the vcastellm/run-erigon branch 4 times, most recently from 8d06c3f to 070f051 Compare July 31, 2024 15:16
@vcastellm vcastellm marked this pull request as ready for review July 31, 2024 15:17
@vcastellm vcastellm requested a review from a team July 31, 2024 15:17
@vcastellm vcastellm changed the title feat: Introduce the CLI and build workflows feat: introduce the CLI and build workflows Jul 31, 2024
@vcastellm vcastellm changed the title feat: introduce the CLI and build workflows feat: Introduce the CLI and build workflows Jul 31, 2024
dataavailability/datacommittee/datacommittee_test.go Outdated Show resolved Hide resolved
cmd/run.go Outdated Show resolved Hide resolved
.vscode/launch.json Show resolved Hide resolved
@goran-ethernal goran-ethernal self-requested a review August 6, 2024 07:12
Copy link
Collaborator

@goran-ethernal goran-ethernal left a comment

Choose a reason for hiding this comment

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

If I disregard the rust files, since I am not in rust yet (and I know you just pushed some base work to continue future work), this looks good to me.

.gitignore Outdated Show resolved Hide resolved
Copy link

@muursh muursh left a comment

Choose a reason for hiding this comment

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

I don't know if I need to do something special to build this code, not being familiar with the existing code at all but cargo check or cargo build gives me the following error

error: failed to run custom build command for `cdk v0.1.0 (/Users/ben/dev/cdk/crates/cdk)`

Caused by:
  process didn't exit successfully: `/Users/ben/dev/cdk/target/release/build/cdk-b8965ac9ee75bf2c/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=*.go

  --- stderr
  thread 'main' panicked at crates/cdk/build.rs:29:10:
  Failed to execute make command: Os { code: 2, kind: NotFound, message: "No such file or directory" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...`

Either there's an issue or I need some build instructions :)

@vcastellm
Copy link
Contributor Author

@begmaroman the base image now is based on Debian so we need to use golang default image that it's based on debian instead of alpine, binaries are not compatible because the build toolchain is different between them.

@vcastellm
Copy link
Contributor Author

I don't know if I need to do something special to build this code, not being familiar with the existing code at all but cargo check or cargo build gives me the following error

error: failed to run custom build command for `cdk v0.1.0 (/Users/ben/dev/cdk/crates/cdk)`

Caused by:
  process didn't exit successfully: `/Users/ben/dev/cdk/target/release/build/cdk-b8965ac9ee75bf2c/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=*.go

  --- stderr
  thread 'main' panicked at crates/cdk/build.rs:29:10:
  Failed to execute make command: Os { code: 2, kind: NotFound, message: "No such file or directory" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...`

Either there's an issue or I need some build instructions :)

Yes, some build instructions are needed, but basically it tries to build go code first using a cargo buildscript, so it has the cdk-node binary available.

Could it be that you don't have Go build toolchain installed?

@muursh
Copy link

muursh commented Aug 8, 2024

I don't know if I need to do something special to build this code, not being familiar with the existing code at all but cargo check or cargo build gives me the following error

error: failed to run custom build command for `cdk v0.1.0 (/Users/ben/dev/cdk/crates/cdk)`

Caused by:
  process didn't exit successfully: `/Users/ben/dev/cdk/target/release/build/cdk-b8965ac9ee75bf2c/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=*.go

  --- stderr
  thread 'main' panicked at crates/cdk/build.rs:29:10:
  Failed to execute make command: Os { code: 2, kind: NotFound, message: "No such file or directory" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...`

Either there's an issue or I need some build instructions :)

Yes, some build instructions are needed, but basically it tries to build go code first using a cargo buildscript, so it has the cdk-node binary available.

Could it be that you don't have Go build toolchain installed?

Go is installed. v1.22.5 to be specific

@vcastellm vcastellm changed the title feat: Introduce the CLI and build workflows feat: introduce the CLI and build workflows Aug 12, 2024
@vcastellm
Copy link
Contributor Author

I don't know if I need to do something special to build this code, not being familiar with the existing code at all but cargo check or cargo build gives me the following error

error: failed to run custom build command for `cdk v0.1.0 (/Users/ben/dev/cdk/crates/cdk)`

Caused by:
  process didn't exit successfully: `/Users/ben/dev/cdk/target/release/build/cdk-b8965ac9ee75bf2c/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=*.go

  --- stderr
  thread 'main' panicked at crates/cdk/build.rs:29:10:
  Failed to execute make command: Os { code: 2, kind: NotFound, message: "No such file or directory" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...`

Either there's an issue or I need some build instructions :)

Yes, some build instructions are needed, but basically it tries to build go code first using a cargo buildscript, so it has the cdk-node binary available.
Could it be that you don't have Go build toolchain installed?

Go is installed. v1.22.5 to be specific

Issue should be fixed now @muursh, can you try again?

@muursh
Copy link

muursh commented Aug 14, 2024

I don't know if I need to do something special to build this code, not being familiar with the existing code at all but cargo check or cargo build gives me the following error

error: failed to run custom build command for `cdk v0.1.0 (/Users/ben/dev/cdk/crates/cdk)`

Caused by:
  process didn't exit successfully: `/Users/ben/dev/cdk/target/release/build/cdk-b8965ac9ee75bf2c/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=*.go

  --- stderr
  thread 'main' panicked at crates/cdk/build.rs:29:10:
  Failed to execute make command: Os { code: 2, kind: NotFound, message: "No such file or directory" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...`

Either there's an issue or I need some build instructions :)

Yes, some build instructions are needed, but basically it tries to build go code first using a cargo buildscript, so it has the cdk-node binary available.
Could it be that you don't have Go build toolchain installed?

Go is installed. v1.22.5 to be specific

Issue should be fixed now @muursh, can you try again?

Yep builds now. I'll aim to review today/tomorrow

Copy link

sonarcloud bot commented Aug 14, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@vcastellm vcastellm merged commit 50d96ec into develop Aug 14, 2024
5 of 7 checks passed
@vcastellm vcastellm deleted the vcastellm/run-erigon branch August 14, 2024 11:14
Stefan-Ethernal pushed a commit that referenced this pull request Sep 17, 2024
* feat: introduce the CLI and build workflows
* fix: fixed dockerfile
Use golang image based on Debian
* fix: default config
* fix: paths
Fix warnings
* fix: report better errors
* fix: make file OS and make path
* refactor: simplify, trim and remove defaults
* refactor: do not depend on external testing scripts
* fix: conversion of banana sequence
* fix: opinionate on CI
---------

Co-authored-by: Goran Rojovic <[email protected]>
Co-authored-by: begmaroman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants