Skip to content

Commit

Permalink
Merge pull request #139 from cardano-scaling/fix/switch-to-socat
Browse files Browse the repository at this point in the history
fix: switch to socat
  • Loading branch information
scarmuega authored Dec 9, 2024
2 parents 5ff38e2 + f4ea1e0 commit d0becd6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 2 additions & 0 deletions crates/operator/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ pub struct K8sConstants {
pub game_state_metric: String,
pub transactions_metric: String,
pub dmtrctl_image: String,
pub socat_image: String,
pub storage_class_name: String,
pub service_account_name: String,
pub used_snapshot_prefix: String,
Expand All @@ -118,6 +119,7 @@ impl Default for K8sConstants {
secret_dir: "/var/secret".to_string(),
socket_dir: "/ipc".to_string(),
dmtrctl_image: "ghcr.io/demeter-run/dmtrctl:sha-3ffefaa".to_string(),
socat_image: "alpine/socat:latest".to_string(),
socket_path: "/ipc/socket".to_string(),
initial_utxo_config_dir: "/etc/initial_utxo_config".to_string(),
data_dir: "/var/data".to_string(),
Expand Down
23 changes: 12 additions & 11 deletions crates/operator/src/custom_resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,19 +436,20 @@ impl HydraDoomNode {

// Offline is optional. If undefined, the node is presumed to be online.
if !self.spec.offline.unwrap_or(false) {
let node_service = match config.network_id.as_str() {
"0" => "node-preprod".to_string(),
_ => "node-mainnet".to_string(),
};

containers.push(Container {
name: "dmtrctl".to_string(),
image: Some(constants.dmtrctl_image.to_string()),
name: "socat".to_string(),
image: Some(constants.socat_image.to_string()),
args: Some(vec![
"--project-id".to_string(),
config.dmtr_project_id.clone(),
"--api-key".to_string(),
config.dmtr_api_key.clone(),
"ports".to_string(),
"tunnel".to_string(),
config.dmtr_port_name.clone(),
"--socket".to_string(),
constants.socket_path.clone(),
format!("UNIX-LISTEN:{0},fork", constants.socket_path),
format!(
"TCP:{0}.hydra-doom-system.svc.cluster.local:3307,ignoreeof",
node_service
),
]),
volume_mounts: Some(vec![VolumeMount {
name: "ipc".to_string(),
Expand Down

0 comments on commit d0becd6

Please sign in to comment.