Skip to content

Commit c843c98

Browse files
authored
Merge pull request #92 from obeli-sk/fly-activity-fix
Override inherited envvars, update fly activity, push components
2 parents 88cd39c + 42a1684 commit c843c98

11 files changed

Lines changed: 61 additions & 40 deletions

obelisk-external.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[[activity_wasm]]
22
name = "activity_fly_http"
3-
location = "oci://docker.io/getobelisk/components_fly_activity_fly_http:2026-03-30@sha256:fef07531120e10a8e59edbb4927dcfffae68aed6925d76ea43c8e02e30584161"
3+
location = "oci://docker.io/getobelisk/components_fly_activity_fly_http:2026-03-31@sha256:cc831dc0cfeecf267c67c0340aa5e3de511ff71d5978a3225e837de184635de3"
44

55
# HTTP Client for health checking.
66
[[activity_wasm]]

obelisk-local-postgres.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[[activity_wasm]]
22
name = "activity_fly_http"
3-
location = "oci://docker.io/getobelisk/components_fly_activity_fly_http:2026-03-30@sha256:fef07531120e10a8e59edbb4927dcfffae68aed6925d76ea43c8e02e30584161"
3+
location = "oci://docker.io/getobelisk/components_fly_activity_fly_http:2026-03-31@sha256:cc831dc0cfeecf267c67c0340aa5e3de511ff71d5978a3225e837de184635de3"
44
exec.lock_expiry.seconds = 15
55
max_retries = 6
66
[[activity_wasm.allowed_host]]
77
pattern = "https://api.machines.dev"
8-
methods = ["POST"]
8+
methods = "*"
99
[activity_wasm.allowed_host.secrets]
1010
env_vars = ["FLY_API_TOKEN"]
1111
replace_in = ["headers"]
@@ -16,7 +16,7 @@ name = "activity_http_generic"
1616
location = "oci://docker.io/getobelisk/components_http_activity_http_generic:2026-03-30@sha256:d170092f3023380960c459bb92d71b6a0ac8c8d3f16ccb863eed72e69cf7157d"
1717
exec.lock_expiry.seconds = 5
1818
[[activity_wasm.allowed_host]]
19-
pattern = "https://*.fly.dev"
19+
pattern = "https://*.fly.dev:444"
2020
methods = "*"
2121

2222
[[activity_wasm]]

obelisk-local.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[[activity_wasm]]
22
name = "activity_fly_http"
3-
location = "oci://docker.io/getobelisk/components_fly_activity_fly_http:2026-03-30@sha256:fef07531120e10a8e59edbb4927dcfffae68aed6925d76ea43c8e02e30584161"
3+
location = "oci://docker.io/getobelisk/components_fly_activity_fly_http:2026-03-31@sha256:cc831dc0cfeecf267c67c0340aa5e3de511ff71d5978a3225e837de184635de3"
44
exec.lock_expiry.seconds = 15
55
max_retries = 6
66
[[activity_wasm.allowed_host]]
77
pattern = "https://api.machines.dev"
8-
methods = ["POST"]
8+
methods = "*"
99
[activity_wasm.allowed_host.secrets]
1010
env_vars = ["FLY_API_TOKEN"]
1111
replace_in = ["headers"]
@@ -16,7 +16,7 @@ name = "activity_http_generic"
1616
location = "oci://docker.io/getobelisk/components_http_activity_http_generic:2026-03-30@sha256:d170092f3023380960c459bb92d71b6a0ac8c8d3f16ccb863eed72e69cf7157d"
1717
exec.lock_expiry.seconds = 5
1818
[[activity_wasm.allowed_host]]
19-
pattern = "https://*.fly.dev"
19+
pattern = "https://*.fly.dev:444"
2020
methods = "*"
2121

2222
[[activity_wasm]]

obelisk-oci.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[[activity_wasm]]
22
name = "activity_fly_http"
3-
location = "oci://docker.io/getobelisk/components_fly_activity_fly_http:2026-03-30@sha256:fef07531120e10a8e59edbb4927dcfffae68aed6925d76ea43c8e02e30584161"
3+
location = "oci://docker.io/getobelisk/components_fly_activity_fly_http:2026-03-31@sha256:cc831dc0cfeecf267c67c0340aa5e3de511ff71d5978a3225e837de184635de3"
44
exec.lock_expiry.seconds = 15
55
max_retries = 6
66
[[activity_wasm.allowed_host]]
77
pattern = "https://api.machines.dev"
8-
methods = ["POST"]
8+
methods = "*"
99
[activity_wasm.allowed_host.secrets]
1010
env_vars = ["FLY_API_TOKEN"]
1111
replace_in = ["headers"]
@@ -16,7 +16,7 @@ name = "activity_http_generic"
1616
location = "oci://docker.io/getobelisk/components_http_activity_http_generic:2026-03-30@sha256:d170092f3023380960c459bb92d71b6a0ac8c8d3f16ccb863eed72e69cf7157d"
1717
exec.lock_expiry.seconds = 5
1818
[[activity_wasm.allowed_host]]
19-
pattern = "https://*.fly.dev"
19+
pattern = "https://*.fly.dev:444"
2020
methods = "*"
2121

2222
[[activity_wasm]]
@@ -28,10 +28,10 @@ methods = ["GET", "POST"]
2828

2929
[[workflow_wasm]]
3030
name = "obelisk_deployer_flyio"
31-
location = "oci://docker.io/getobelisk/components_flyio_obelisk_deployer_flyio:2026-03-30@sha256:07b5f2492a3f41a36fbe74cda801a7a0c291a986f99d0c1d0866c43bf89d7aa2"
31+
location = "oci://docker.io/getobelisk/components_flyio_obelisk_deployer_flyio:2026-03-31@sha256:632e91298929abcf9c8fb9a6e4d7c8852f194b5e9df7a2cb9a528b0c810546ce"
3232

3333
# This webhook is here only for `push-components.sh`
3434
[[webhook_endpoint_wasm]]
3535
name = "webhook_healthcheck"
36-
location = "oci://docker.io/getobelisk/components_flyio_webhook_healthcheck:2026-03-30@sha256:a81199c7df4d282725ed57f0d20f4214a64dc04aa8320911cda1748dcfde68f8"
36+
location = "oci://docker.io/getobelisk/components_flyio_webhook_healthcheck:2026-03-31@sha256:1cda8ea88b472b280b1d4b28285c61f2008edd7594216a6bc594f66a87b64452"
3737
routes = ["/obeliskhealthcheck"]

server-postgres.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
api.listening_addr = "127.0.0.1:5005"
2-
webui.listening_addr = "127.0.0.1:8080"
3-
41
database.postgres.host = "${POSTGRES_HOST}"
52
database.postgres.user = "${POSTGRES_USER}"
63
database.postgres.password = "${POSTGRES_PASSWORD}"

server.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
api.listening_addr = "127.0.0.1:5005"
2-
webui.listening_addr = "127.0.0.1:8080"
3-
41
[log.file]
52
enabled = true
63
target = true

wit/deps/obelisk-flyio_activity-fly-http@1.0.0-beta/obelisk-flyio_activity-fly-http@1.0.0-beta.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ interface machines {
204204
guest: option<guest-config>,
205205
auto-destroy: option<bool>,
206206
init: option<init-config>,
207-
env: option<list<tuple<string, string>>>,
207+
env: option<list<tuple<string, option<string>>>>,
208208
restart: option<machine-restart>,
209209
stop-config: option<stop-config>,
210210
mounts: option<list<mount>>,

workflow/deployer-workflow/src/lib.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ const LITESTREAM_CONFIG_PATH: &str = "/etc/litestream.yml";
7575
const SQLITE_DIRECTORY_PATH: &str = formatcp!("{VOLUME_MOUNT_PATH}/obelisk-sqlite");
7676
const SQLITE_FILE_PATH: &str = formatcp!("{SQLITE_DIRECTORY_PATH}/obelisk.sqlite");
7777
const REGION: Region = Region::Ams;
78-
const WEBHOOK_INTERNAL_PORT: u16 = 9090;
78+
const WEBHOOK_INTERNAL_PORT: u16 = 9090; // forwarded to 443 in `services` section
7979
const API_INTERNAL_PORT: u16 = 5005;
80-
const HEALTHCHECK_INTERNAL_PORT: u16 = 9091;
80+
const HEALTHCHECK_INTERNAL_PORT: u16 = 9091; // forwarded to HEALTHCHECK_EXTERNAL_PORT
8181
const HEALTHCHECK_EXTERNAL_PORT: u16 = 444;
8282
const SLEEP_BETWEEN_RETRIES: Duration = Duration::from_secs(10);
8383
const SLEEP_AFTER_TEMP_VM_SHUTDOWN: Duration = Duration::from_secs(5);
@@ -502,7 +502,22 @@ fn start_final_vm(
502502
swap_size_mb: Some(FINAL_VM_SWAP_MB),
503503
tty: None,
504504
}),
505-
env: None,
505+
env: Some(vec![
506+
// Fix for Obelisk 0.36.1 - fly.io does not allow unsetting those env vars set in Dockerfile.
507+
// Using [::] for when a port is not exposed and needs `fly proxy` forwarding.
508+
(
509+
"OBELISK__API__LISTENING_ADDR".to_string(),
510+
Some(format!("[::]:{API_INTERNAL_PORT}")),
511+
),
512+
(
513+
"OBELISK__EXTERNAL__LISTENING_ADDR".to_string(),
514+
Some(format!("[::]:{WEBHOOK_INTERNAL_PORT}")),
515+
),
516+
(
517+
"OBELISK__WEBUI__LISTENING_ADDR".to_string(),
518+
Some("[::]:8080".to_string()),
519+
),
520+
]),
506521
restart: Some(MachineRestart {
507522
max_retries: Some(MAX_VM_FAILURE_RETRIES),
508523
policy: RestartPolicy::OnFailure,

workflow/deployer-workflow/src/snapshots/obelisk_deployer_flyio__toml__tests__deployment_toml.snap

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ env_vars = ["OPENAI_API_KEY"]
77
location = "oci://docker.io/getobelisk/demo_stargazers_activity_llm_openai:2025-09-28@sha256:4b10a66c80bec625a6b0a2e8a4b5192f8a2356eca19c0a6705335771a8b8b1e8"
88
name = "stargazers_activity_llm_chatgpt"
99

10+
[[activity_wasm.allowed_host]]
11+
methods = "*"
12+
pattern = "*://*:*"
13+
1014
[activity_wasm.exec.lock_expiry]
1115
seconds = 10
1216

@@ -15,6 +19,10 @@ env_vars = ["GITHUB_TOKEN"]
1519
location = "oci://docker.io/getobelisk/demo_stargazers_activity_github_impl:2025-09-28@sha256:8f6fc9b1379b359e085998fa2fd7c966c450327d09770807dfba4b2f75731d72"
1620
name = "stargazers_activity_github_impl"
1721

22+
[[activity_wasm.allowed_host]]
23+
methods = "*"
24+
pattern = "*://*:*"
25+
1826
[activity_wasm.exec.lock_expiry]
1927
seconds = 5
2028

@@ -27,12 +35,16 @@ location = "oci://docker.io/getobelisk/demo_stargazers_activity_db_turso:2025-09
2735
max_retries = 9
2836
name = "stargazers_activity_db_turso"
2937

38+
[[activity_wasm.allowed_host]]
39+
methods = "*"
40+
pattern = "*://*:*"
41+
3042
[activity_wasm.exec.lock_expiry]
3143
seconds = 5
3244

3345
[[webhook_endpoint_wasm]]
3446
http_server = "healthcheck_server"
35-
location = "oci://docker.io/getobelisk/components_flyio_webhook_healthcheck:2026-03-30@sha256:a81199c7df4d282725ed57f0d20f4214a64dc04aa8320911cda1748dcfde68f8"
47+
location = "oci://docker.io/getobelisk/components_flyio_webhook_healthcheck:2026-03-31@sha256:1cda8ea88b472b280b1d4b28285c61f2008edd7594216a6bc594f66a87b64452"
3648
name = "webhook_healthcheck"
3749
routes = [""]
3850

workflow/deployer-workflow/src/snapshots/obelisk_deployer_flyio__toml__tests__server_toml.snap

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
source: workflow/deployer-workflow/src/toml.rs
33
expression: server_toml
44
---
5-
[api]
6-
listening_addr = "[::]:5005"
75

86
[database.sqlite]
97
directory = "/volume/obelisk-sqlite"
@@ -12,7 +10,7 @@ directory = "/volume/obelisk-sqlite"
1210
cache_size = "3000"
1311

1412
[[http_server]]
15-
listening_addr = "0.0.0.0:9091"
13+
listening_addr = "[::]:9091"
1614
name = "healthcheck_server"
1715

1816
[log.file]
@@ -25,11 +23,5 @@ target = true
2523
cache_directory = "/volume/wasm"
2624
parallel_compilation = false
2725

28-
[wasm.backtrace]
29-
persist = false
30-
3126
[wasm.codegen_cache]
3227
directory = "/volume/codegen"
33-
34-
[webui]
35-
listening_addr = "[::]:8080"

0 commit comments

Comments
 (0)