Skip to content

Commit

Permalink
fix: add static port config for apache (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa committed May 13, 2024
1 parent 67e3da0 commit b96e502
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,11 @@ xatu_sentry_params:
- contribution_and_proof
- blob_sidecar

# Apache params
# Apache public port to port forward to local machine
# Default to port 40000, only set if apache additional service is activated
apache_port: 40000

# Global tolerations that will be passed to all containers (unless overridden by a more specific toleration)
# Only works with Kubernetes
# Example: tolerations:
Expand Down
2 changes: 2 additions & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def run(plan, args={}):
global_tolerations = args_with_right_defaults.global_tolerations
global_node_selectors = args_with_right_defaults.global_node_selectors
keymanager_enabled = args_with_right_defaults.keymanager_enabled
apache_port = args_with_right_defaults.apache_port

grafana_datasource_config_template = read_file(
static_files.GRAFANA_DATASOURCE_CONFIG_TEMPLATE_FILEPATH
Expand Down Expand Up @@ -492,6 +493,7 @@ def run(plan, args={}):
apache.launch_apache(
plan,
el_cl_data_files_artifact_uuid,
apache_port,
all_participants,
args_with_right_defaults.participants,
global_node_selectors,
Expand Down
1 change: 1 addition & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ xatu_sentry_params:
- voluntary_exit
- contribution_and_proof
- blob_sidecar
apache_port: 40000
global_tolerations: []
global_node_selectors: {}
keymanager_enabled: false
Expand Down
9 changes: 8 additions & 1 deletion src/apache/apache_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ constants = import_module("../package_io/constants.star")
SERVICE_NAME = "apache"
HTTP_PORT_ID = "http"
HTTP_PORT_NUMBER = 80

APACHE_CONFIG_FILENAME = "index.html"
APACHE_ENR_FILENAME = "boot_enr.yaml"
APACHE_ENODE_FILENAME = "bootnode.txt"
Expand All @@ -30,6 +29,7 @@ USED_PORTS = {
def launch_apache(
plan,
el_cl_genesis_data,
apache_port,
participant_contexts,
participant_configs,
global_node_selectors,
Expand Down Expand Up @@ -80,9 +80,14 @@ def launch_apache(
template_and_data_by_rel_dest_filepath, "bootstrap-info"
)

public_ports = {
HTTP_PORT_ID: shared_utils.new_port_spec(apache_port, shared_utils.TCP_PROTOCOL)
}

config = get_config(
config_files_artifact_name,
el_cl_genesis_data,
public_ports,
bootstrap_info_files_artifact_name,
global_node_selectors,
)
Expand All @@ -93,6 +98,7 @@ def launch_apache(
def get_config(
config_files_artifact_name,
el_cl_genesis_data,
public_ports,
bootstrap_info_files_artifact_name,
node_selectors,
):
Expand Down Expand Up @@ -139,6 +145,7 @@ def get_config(
image="httpd:latest",
ports=USED_PORTS,
cmd=[cmd_str],
public_ports=public_ports,
entrypoint=["sh", "-c"],
files=files,
min_cpu=MIN_CPU,
Expand Down
2 changes: 2 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ def input_parser(plan, input_args):
goomy_blob_params=struct(
goomy_blob_args=result["goomy_blob_params"]["goomy_blob_args"],
),
apache_port=result["apache_port"],
assertoor_params=struct(
image=result["assertoor_params"]["image"],
run_stability_check=result["assertoor_params"]["run_stability_check"],
Expand Down Expand Up @@ -667,6 +668,7 @@ def default_input_args():
"persistent": False,
"mev_type": None,
"xatu_sentry_enabled": False,
"apache_port": 40000,
"global_tolerations": [],
"global_node_selectors": {},
"keymanager_enabled": False,
Expand Down

0 comments on commit b96e502

Please sign in to comment.