-
Notifications
You must be signed in to change notification settings - Fork 1
fix: Docker build on macOS #32
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
base: main
Are you sure you want to change the base?
Changes from all commits
7e6aa23
9550771
33d4da1
e375bed
ffa436b
c77afa9
aa09a29
c3780aa
68ae908
573c261
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,22 @@ | ||
| # Volume mappings for builder Docker image | ||
| # Format: host_subdirectory = "container_path" | ||
| # Host paths will be relative to ~/.foc-devnet/artifacts/docker/volumes/builder/ | ||
| # Host paths will be relative to ~/.foc-devnet/docker/volumes/cache/foc-c-builder/ | ||
| # | ||
| # Strategy: Mount only dependency cache directories, not tool directories | ||
| # This allows caching of downloaded dependencies while keeping tools functional. | ||
|
|
||
| [volumes] | ||
| cargo = "/home/foc-user/.cargo" | ||
| rustup = "/home/foc-user/.rustup" | ||
| go = "/home/foc-user/go" | ||
| foundry = "/home/foc-user/.foundry" | ||
| # Cargo dependency caches (NOT the cargo binary itself) | ||
| cargo-registry = "/home/foc-user/.cargo/registry" # crates.io downloads | ||
| cargo-git = "/home/foc-user/.cargo/git" # git dependencies | ||
|
|
||
| # Go module cache (NOT the go toolchain) | ||
| go-pkg = "/home/foc-user/go/pkg" # go modules cache | ||
|
|
||
| # Note: We do NOT mount: | ||
| # - /home/foc-user/.cargo/bin (contains cargo/rustc binaries) | ||
| # - /home/foc-user/.rustup/toolchains (contains rust toolchain) | ||
| # - /home/foc-user/.rustup/downloads (rustup deletes files after use) | ||
| # - /home/foc-user/.foundry (contains forge/cast binaries) | ||
| # - /usr/local/go (Go toolchain itself) | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,8 +84,7 @@ pub fn setup_docker_run_args( | |
|
|
||
| let mut docker_run_args = vec![ | ||
| "run".to_string(), | ||
| "-u".to_string(), | ||
| "foc-user".to_string(), | ||
| "--rm".to_string(), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unsure if the intent really is:
I don't disagree with them, but would like to understand safety argument for removing
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The The |
||
| "--name".to_string(), | ||
| container_name, | ||
| "-e".to_string(), | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -173,7 +173,9 @@ pub struct Config { | |||
| /// URL to download Yugabyte database tarball. | ||||
| /// | ||||
| /// This is the direct link to the Yugabyte tarball required for running curio. | ||||
| /// Default: https://software.yugabyte.com/releases/2.25.1.0/yugabyte-2.25.1.0-b381-linux-x86_64.tar.gz | ||||
| /// The default URL is automatically selected based on system architecture: | ||||
| /// - ARM64 (aarch64): yugabyte-2.25.1.0-b381-el8-aarch64.tar.gz | ||||
| /// - x86_64: yugabyte-2.25.1.0-b381-linux-x86_64.tar.gz | ||||
| pub yugabyte_download_url: String, | ||||
|
|
||||
| /// Number of approved PDP service providers. | ||||
|
|
@@ -227,14 +229,35 @@ impl Default for Config { | |||
| url: "https://github.com/FilOzone/synapse-sdk.git".to_string(), | ||||
| commit: "773551bf1e9cf4cdc49aeb63a47a81f8dc5cb9e1".to_string(), | ||||
| }, | ||||
| yugabyte_download_url: "https://software.yugabyte.com/releases/2.25.1.0/yugabyte-2.25.1.0-b381-linux-x86_64.tar.gz".to_string(), | ||||
| yugabyte_download_url: Self::get_default_yugabyte_url(), | ||||
| approved_pdp_sp_count: 1, | ||||
| active_pdp_sp_count: 1, | ||||
| } | ||||
| } | ||||
| } | ||||
|
|
||||
| impl Config { | ||||
| /// Get the default YugabyteDB download URL based on system architecture. | ||||
| /// | ||||
| /// Returns the appropriate YugabyteDB tarball URL for the current platform: | ||||
| /// - el8-aarch64 for ARM64 systems (Apple Silicon, AWS Graviton, etc.) | ||||
| /// - linux-x86_64 for x86_64 systems | ||||
| fn get_default_yugabyte_url() -> String { | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This addition is a "feature update". The S3 fallback has to be changed accordingly in the code as well. Please check that.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand what you mean by S3 fallback here? But I do see a place I forgot to update. foc-devnet/scripts/cache-artifacts.sh Line 27 in 629f8e8
|
||||
| const YUGABYTE_VERSION: &str = "2.25.1.0"; | ||||
| const YUGABYTE_BUILD: &str = "b381"; | ||||
|
|
||||
| let arch_suffix = if std::env::consts::ARCH == "aarch64" { | ||||
| "el8-aarch64" | ||||
| } else { | ||||
| "linux-x86_64" | ||||
| }; | ||||
|
|
||||
| format!( | ||||
| "https://software.yugabyte.com/releases/{}/yugabyte-{}-{}-{}.tar.gz", | ||||
| YUGABYTE_VERSION, YUGABYTE_VERSION, YUGABYTE_BUILD, arch_suffix | ||||
| ) | ||||
| } | ||||
|
|
||||
| /// Validate configuration values. | ||||
| /// | ||||
| /// Ensures that: | ||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed? This is good for caching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only works when there is data present. The first time you run the mount, it will clear these directories, causing the toolchain to be lost. I added the critical mappings in a subsequent commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is true, but it cleans up only the first time. The caches are for when the
curioorlotuscodebase is actively being changed and rebuilt frequently. In those instances, re-init is not needed, and these caches would be useful.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cargo bin directory was overwritten, so this binary will never exist unless it is manually downloaded on the host machine.
There are two commits here: one temporarily disables everything, and the second maps according to what's actually usable. The
-vparameter plays a crucial role. Therefore, I've removed it here because I think it's meaningless.However, I must admit that some Rust binaries are not cached. The rest, such as
go pkgandrust registry, are cached.