Skip to content

Commit 3495eb6

Browse files
committed
chore: Migrate push-components.sh, extract webhook OCI ref
1 parent 6ac0a40 commit 3495eb6

5 files changed

Lines changed: 42 additions & 21 deletions

File tree

obelisk-healthcheck-local.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Standalone deployment for `webhook_healthcheck`.
2+
# This component is not used at runtime by the deployer — it is injected by
3+
# `serialize_obelisk_toml` into the generated deployment TOML of deployed
4+
# Obelisk apps. This file only exists so `push-components.sh` has a source
5+
# deployment to push it from.
6+
[[webhook_endpoint_wasm]]
7+
name = "webhook_healthcheck"
8+
location = "${DEPLOYMENT_DIR}/target/wasm32-wasip2/release_webhook/webhook_healthcheck.wasm"
9+
routes = ["/obeliskhealthcheck"]

obelisk-healthcheck-oci.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Standalone deployment for `webhook_healthcheck`.
2+
# This component is not used at runtime by the deployer — it is injected by
3+
# `serialize_obelisk_toml` into the generated deployment TOML of deployed
4+
# Obelisk apps. This file only exists so `push-components.sh` has a target to
5+
# update and so `toml.rs` can `include_str!` the pushed OCI location at build
6+
# time.
7+
[[webhook_endpoint_wasm]]
8+
name = "webhook_healthcheck"
9+
location = "oci://docker.io/getobelisk/components_flyio_webhook_healthcheck:2026-03-31@sha256:1cda8ea88b472b280b1d4b28285c61f2008edd7594216a6bc594f66a87b64452"
10+
routes = ["/obeliskhealthcheck"]

obelisk-oci.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,3 @@ methods = ["GET", "POST"]
2929
[[workflow_wasm]]
3030
name = "obelisk_deployer_flyio"
3131
location = "oci://docker.io/getobelisk/components_flyio_obelisk_deployer_flyio:2026-03-31@sha256:632e91298929abcf9c8fb9a6e4d7c8852f194b5e9df7a2cb9a528b0c810546ce"
32-
33-
# This webhook is here only for `push-components.sh`
34-
[[webhook_endpoint_wasm]]
35-
name = "webhook_healthcheck"
36-
location = "oci://docker.io/getobelisk/components_flyio_webhook_healthcheck:2026-03-31@sha256:1cda8ea88b472b280b1d4b28285c61f2008edd7594216a6bc594f66a87b64452"
37-
routes = ["/obeliskhealthcheck"]

scripts/push-components.sh

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,34 @@ set -exuo pipefail
66
cd "$(dirname "$0")/.."
77

88
TAG="$1"
9-
TOML_FILE="obelisk-oci.toml"
10-
PREFIX="docker.io/getobelisk/components_flyio_"
9+
PREFIX="oci://docker.io/getobelisk/components_flyio_"
1110

12-
push() {
13-
local TOML_COMPONENT_TYPE=$1
14-
local RELATIVE_PATH=$2
11+
push_component() {
12+
local LOCAL_DEPLOYMENT_TOML="$1"
13+
local COMPONENT_NAME="$2"
1514

16-
local FILE_NAME_WITHOUT_EXT=$(basename "$RELATIVE_PATH" | sed 's/\.[^.]*$//')
17-
local OCI_LOCATION="${PREFIX}${FILE_NAME_WITHOUT_EXT}:${TAG}"
18-
echo "Pushing ${RELATIVE_PATH} to ${OCI_LOCATION}..."
19-
local OUTPUT=$(obelisk component push "$RELATIVE_PATH" "$OCI_LOCATION")
15+
OCI_LOCATION="${PREFIX}${COMPONENT_NAME}:${TAG}"
16+
obelisk component push --deployment "$LOCAL_DEPLOYMENT_TOML" "$COMPONENT_NAME" "$OCI_LOCATION"
17+
}
18+
19+
push_and_update() {
20+
local LOCAL_DEPLOYMENT_TOML="$1"
21+
local COMPONENT_NAME="$2"
22+
shift 2
23+
DST_TOML_FILES=("$@")
2024

21-
# Replace the old location with the actual OCI location
25+
OCI_LOCATION=$(push_component "$LOCAL_DEPLOYMENT_TOML" "$COMPONENT_NAME")
2226

23-
obelisk component add ${TOML_COMPONENT_TYPE} ${OUTPUT} --name ${FILE_NAME_WITHOUT_EXT} --deployment $TOML_FILE
27+
for DST_TOML_FILE in "${DST_TOML_FILES[@]}"; do
28+
obelisk component add --deployment "$DST_TOML_FILE" "$OCI_LOCATION" "$COMPONENT_NAME"
29+
done
2430
}
2531

2632
# Build components
2733
just build
2834

29-
push workflow_wasm "target/wasm32-unknown-unknown/release_workflow/obelisk_deployer_flyio.wasm"
30-
push webhook_endpoint_wasm "target/wasm32-wasip2/release_webhook/webhook_healthcheck.wasm"
35+
push_and_update obelisk-local.toml obelisk_deployer_flyio obelisk-oci.toml
36+
push_and_update obelisk-healthcheck-local.toml webhook_healthcheck obelisk-healthcheck-oci.toml
3137

3238
echo "All components pushed and TOML file updated successfully."
3339

workflow/deployer-workflow/src/toml.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ pub(crate) fn serialize_obelisk_toml(
77
config: &ObeliskConfig,
88
) -> Result<(String, String), anyhow::Error> {
99
const HEALTHCHECK_SERVER_NAME: &str = "healthcheck_server";
10-
const OBELISK_OCI_TOML: &str = include_str!("../../../obelisk-oci.toml");
10+
const OBELISK_HEALTHCHECK_OCI_TOML: &str =
11+
include_str!("../../../obelisk-healthcheck-oci.toml");
1112

1213
let webhook_healthcheck_location = {
13-
let val: toml::Value = toml::from_str(OBELISK_OCI_TOML).expect("Invalid TOML");
14+
let val: toml::Value =
15+
toml::from_str(OBELISK_HEALTHCHECK_OCI_TOML).expect("Invalid TOML");
1416

1517
let endpoint = val["webhook_endpoint_wasm"]
1618
.as_array()

0 commit comments

Comments
 (0)