Skip to content

Commit

Permalink
feat: add names to run-sh (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Jun 13, 2024
1 parent d980fee commit 6b447b7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/grafana/grafana_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def merge_dashboards_artifacts(
] = additional_dashboard_data[GRANAFA_ADDITIONAL_DASHBOARDS_ARTIFACT_NAME_KEY]

result = plan.run_sh(
name="merge-grafana-dashboards",
description="Merging grafana dashboards artifacts",
run="find "
+ GRAFANA_ADDITIONAL_DASHBOARDS_FILEPATH_ON_SERVICE
Expand Down
1 change: 1 addition & 0 deletions src/network_launcher/devnet.star
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def launch(plan, network, cancun_time, prague_time):
name="el_cl_genesis",
)
el_cl_genesis_data_uuid = plan.run_sh(
name="move_genesis_data",
description="Creating network configs",
run="mkdir -p /network-configs/ && mv /opt/* /network-configs/",
store=[StoreSpec(src="/network-configs/", name="el_cl_genesis_data")],
Expand Down
1 change: 1 addition & 0 deletions src/network_launcher/ephemery.star
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ el_cl_genesis_data = import_module(

def launch(plan, cancun_time, prague_time):
el_cl_genesis_data_uuid = plan.run_sh(
name="fetch_ephemery_genesis_data",
description="Creating network configs",
run="mkdir -p /network-configs/ && \
curl -o latest.tar.gz https://ephemery.dev/latest.tar.gz && \
Expand Down
1 change: 1 addition & 0 deletions src/network_launcher/public_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ constants = import_module("../package_io/constants.star")
def launch(plan, network, cancun_time, prague_time):
# We are running a public network
dummy_genesis_data = plan.run_sh(
name="dummy_genesis_data",
description="Creating network configs folder",
run="mkdir /network-configs",
store=[StoreSpec(src="/network-configs/", name="el_cl_genesis_data")],
Expand Down
2 changes: 2 additions & 0 deletions src/network_launcher/shadowfork.star
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def shadowfork_prep(
# overload the network name to remove the shadowfork suffix
if constants.NETWORK_NAME.ephemery in base_network:
chain_id = plan.run_sh(
name="fetch_chain_id",
description="Fetching the chain id",
run="curl -s https://ephemery.dev/latest/config.yaml | yq .DEPOSIT_CHAIN_ID | tr -d '\n'",
image="linuxserver/yq",
Expand All @@ -25,6 +26,7 @@ def shadowfork_prep(
base_network
] # overload the network id to match the network name
latest_block = plan.run_sh(
name="fetch_latest_block",
description="Fetching the latest block",
run="mkdir -p /shadowfork && \
curl -o /shadowfork/latest_block.json "
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 @@ -1139,6 +1139,8 @@ def deep_copy_participant(participant):

def get_public_ip(plan):
response = plan.run_sh(
name="get_public_ip",
description="Get the public IP address of the current machine",
run="curl -s https://ident.me",
)
return response.output
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def generate_el_cl_genesis_data(
files[GENESIS_VALUES_PATH] = genesis_generation_config_artifact_name

genesis = plan.run_sh(
name="run_generate_genesis",
description="Creating genesis",
run="cp /opt/values.env /config/values.env && ./entrypoint.sh all && mkdir /network-configs && mv /data/metadata/* /network-configs/",
image=image,
Expand All @@ -102,20 +103,23 @@ def generate_el_cl_genesis_data(
)

genesis_validators_root = plan.run_sh(
name="read_genesis_validators_root",
description="Reading genesis validators root",
run="cat /data/genesis_validators_root.txt",
files={"/data": genesis.files_artifacts[1]},
wait=None,
)

cancun_time = plan.run_sh(
name="read_cancun_time",
description="Reading cancun time from genesis",
run="jq .config.cancunTime /data/genesis.json | tr -d '\n'",
image="badouralix/curl-jq",
files={"/data": genesis.files_artifacts[0]},
)

prague_time = plan.run_sh(
name="read_prague_time",
description="Reading prague time from genesis",
run="jq .config.pragueTime /data/genesis.json | tr -d '\n'",
image="badouralix/curl-jq",
Expand Down

0 comments on commit 6b447b7

Please sign in to comment.