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

fix(cluster): write install script for worker pool #2009

Open
wants to merge 1 commit into
base: 02-08-feat_clusters_add_worker_pool_type
Choose a base branch
from

Conversation

MasterPtato
Copy link
Contributor

Changes

Copy link

cloudflare-workers-and-pages bot commented Feb 11, 2025

Deploying rivet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 257ad3e
Status:⚡️  Build in progress...

View logs

Copy link
Contributor Author

MasterPtato commented Feb 11, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR implements installation scripts and configurations for worker pools in the Rivet cluster management system, focusing on proper service connectivity and resource management.

  • Added new worker pool type in sdks/api/fern/definition/provision/common.yml with corresponding SDK updates
  • Implemented worker pool configuration in packages/common/config/src/config/server/rivet/cluster_provision.rs with proper service URLs and port mappings
  • Added FoundationDB configuration support in packages/edge/infra/client/isolate-v8-runner/src/main.rs for worker pools
  • Added datacenter_name_id field to server info responses for better datacenter identification
  • Configured tunnel services with specific ports (CRDB: 5040, Redis: 5041/5042, ClickHouse: 5043/5044, S3: 5045, NATS: 5046, Prometheus: 5047) in packages/core/services/cluster/src/workflows/server/install/install_scripts/components/traefik.rs

131 file(s) reviewed, 28 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +42 to +44
--mount=type=cache,target=/usr/local/cargo/git,id=univseral-cargo-git \
--mount=type=cache,target=/usr/local/cargo/registry,id=univseral-cargo-registry \
--mount=type=cache,target=/app/target,id=univseral-target \
Copy link

Choose a reason for hiding this comment

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

syntax: typo in cache mount ids: 'univseral' should be 'universal'

connection: "fdb:[email protected]:4500".to_string(),
cluster_description: "fdb".to_string(),
cluster_id: "fdb".to_string(),
addresses: Addresses::Static(vec!["127.0.0.1:4500".to_string()]),
Copy link

Choose a reason for hiding this comment

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

style: default address includes port 4500 but should use the FDB constant from default_ports to stay DRY

async move {
let joined = servers
.into_iter()
.filter_map(|server| server.lan_ip)
Copy link

Choose a reason for hiding this comment

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

logic: No handling for empty server list - could cause invalid connection string if all servers are filtered out

cluster_id = fdb_config.cluster_id,
);

fs::write(temp_path, connection.as_bytes()).await?;
Copy link

Choose a reason for hiding this comment

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

logic: Multiple concurrent service discovery callbacks could race when writing to the same file

rand = "0.8"
reqwest = { version = "0.11", features = ["json"] }
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1.40", features = ["full"] }
Copy link

Choose a reason for hiding this comment

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

style: tokio 1.40 is very new and may cause compatibility issues. Consider using a more established version like 1.32 which is used in other parts of the codebase.

Comment on lines +23 to +24
FROM scratch
COPY --from=rust /app/dist/ /
Copy link

Choose a reason for hiding this comment

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

logic: Using scratch base image without libfdb_c.so will cause runtime errors since the FoundationDB client library is required. Need to copy libfdb_c.so from builder stage.

COPY --from=rust /app/dist/ /

# Allows `docker create` to work even though this fails
CMD [""]
Copy link

Choose a reason for hiding this comment

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

logic: Empty CMD will cause container to fail immediately. Should set proper entrypoint to run rivet-edge-server.

@@ -0,0 +1,8 @@
*
Copy link

Choose a reason for hiding this comment

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

style: Consider adding a comment header explaining the purpose of this dockerignore file

@@ -33,6 +34,7 @@ util.workspace = true
uuid = "1.11.0"

server-spec = { workspace = true, optional = true }
token-create.workspace = true
Copy link

Choose a reason for hiding this comment

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

style: token-create is not marked as optional despite being likely only needed for certain features like the other dependencies

Comment on lines +384 to 387
base_path: util::url::to_string_without_slash(&edge.intercom_endpoint),
bearer_access_token: Some(token),
..Default::default()
};
Copy link

Choose a reason for hiding this comment

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

style: Consider adding error handling for URL parsing failures

@MasterPtato MasterPtato force-pushed the 02-08-feat_clusters_add_worker_pool_type branch from 24ae5de to 02f4f81 Compare February 15, 2025 01:52
@MasterPtato MasterPtato force-pushed the 02-11-fix_cluster_write_install_script_for_worker_pool branch from 741ef37 to 0618a18 Compare February 15, 2025 01:52
@MasterPtato MasterPtato force-pushed the 02-08-feat_clusters_add_worker_pool_type branch from 02f4f81 to 7bdc5b6 Compare February 18, 2025 02:28
@MasterPtato MasterPtato force-pushed the 02-11-fix_cluster_write_install_script_for_worker_pool branch from 0618a18 to 72e6e1e Compare February 18, 2025 02:32
@NathanFlurry NathanFlurry changed the base branch from 02-08-feat_clusters_add_worker_pool_type to graphite-base/2009 February 19, 2025 02:56
@NathanFlurry NathanFlurry force-pushed the 02-11-fix_cluster_write_install_script_for_worker_pool branch from 72e6e1e to d4e7b15 Compare February 19, 2025 02:59
Copy link

cloudflare-workers-and-pages bot commented Feb 19, 2025

Deploying rivet-hub with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9936cb1
Status:⚡️  Build in progress...

View logs

@MasterPtato MasterPtato force-pushed the 02-11-fix_cluster_write_install_script_for_worker_pool branch from d4e7b15 to b439967 Compare February 19, 2025 20:16
@MasterPtato MasterPtato force-pushed the 02-11-fix_cluster_write_install_script_for_worker_pool branch from b439967 to 1ca83db Compare February 19, 2025 20:25
@MasterPtato MasterPtato force-pushed the 02-11-fix_cluster_write_install_script_for_worker_pool branch from 1ca83db to 257ad3e Compare February 20, 2025 01:55
@NathanFlurry NathanFlurry force-pushed the 02-11-fix_cluster_write_install_script_for_worker_pool branch from 257ad3e to 9936cb1 Compare February 20, 2025 02:28
@MasterPtato MasterPtato force-pushed the 02-11-fix_cluster_write_install_script_for_worker_pool branch from 9936cb1 to 257ad3e Compare February 20, 2025 02:36
@NathanFlurry NathanFlurry force-pushed the 02-11-fix_cluster_write_install_script_for_worker_pool branch from 257ad3e to 9936cb1 Compare February 20, 2025 02:55
@MasterPtato MasterPtato force-pushed the 02-11-fix_cluster_write_install_script_for_worker_pool branch from 9936cb1 to 257ad3e Compare February 20, 2025 22:00
Copy link

cloudflare-workers-and-pages bot commented Feb 20, 2025

Deploying rivet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 257ad3e
Status: ✅  Deploy successful!
Preview URL: https://c8c5ec4d.rivet.pages.dev
Branch Preview URL: https://graphite-base-2020.rivet.pages.dev

View logs

@MasterPtato MasterPtato changed the base branch from graphite-base/2009 to 02-08-feat_clusters_add_worker_pool_type February 21, 2025 02:25
@NathanFlurry NathanFlurry force-pushed the 02-11-fix_cluster_write_install_script_for_worker_pool branch from 257ad3e to 9936cb1 Compare February 21, 2025 05:17
@NathanFlurry NathanFlurry force-pushed the 02-08-feat_clusters_add_worker_pool_type branch from 9f0f985 to 9763a09 Compare February 21, 2025 05:17
Copy link

Deploying rivet-hub with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9936cb1
Status: ✅  Deploy successful!
Preview URL: https://9930d981.rivet-hub-7jb.pages.dev
Branch Preview URL: https://02-11-fix-cluster-write-inst.rivet-hub-7jb.pages.dev

View logs

Copy link

Deploying rivet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9936cb1
Status: ✅  Deploy successful!
Preview URL: https://b9ab0ff9.rivet.pages.dev
Branch Preview URL: https://02-11-fix-cluster-write-inst.rivet.pages.dev

View logs

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.

1 participant