Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Conversation

@dotansimha
Copy link
Member

@dotansimha dotansimha commented Nov 17, 2023

Related #98

  • Cleanup tokio dependency
  • Figure out async_runtime setup
  • Allow GW to setup quickly and provide endpoint/source/plugins_mgr using simple route matching
  • Create a Wrangler project that runs and compiled
  • Make it work
  • Deal with reqwest / other client
  • Fix logging and tracing
  • CI/CD setup

@dotansimha dotansimha changed the title restructure compile and run conductor as WASM (for CloudFlare Worker) Nov 17, 2023
@YassinEldeeb
Copy link
Contributor

🤯🚀

@github-actions
Copy link

github-actions bot commented Nov 18, 2023

🐋 This PR was built and pushed to the following Docker images:

Docker Bake metadata
{
"conductor": {
  "containerimage.config.digest": "sha256:1623f20618b9a20217ad543fe688dcda3829e5661f96250b0f68721c6c7e10d8",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
    "digest": "sha256:054c99f2a11a63680f062d7d7e2c78e985033fc616c05adb5db09231d7a407d0",
    "size": 901,
    "platform": {
      "architecture": "amd64",
      "os": "linux"
    }
  },
  "containerimage.digest": "sha256:054c99f2a11a63680f062d7d7e2c78e985033fc616c05adb5db09231d7a407d0",
  "image.name": "ghcr.io/the-guild-org/conductor-t2/conductor:2583ec5ff7069f370ce7c3b87564f90532c9c0e3"
}
}

@dotansimha dotansimha merged commit bf6ece8 into cargo-workspace Nov 18, 2023
Comment on lines +15 to +18
let conductor_config_str = env.var("CONDUCTOR_CONFIG").map(|v| v.to_string());

match conductor_config_str {
Ok(conductor_config_str) => match from_yaml(&conductor_config_str) {
Copy link
Contributor

@YassinEldeeb YassinEldeeb Nov 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gonna a bit inefficient to load and parse the config file on every request,
what can we do to maintain this sort of state in a cloudflare function where the function is just stateless? 🤔

let gw = ConductorGateway::lazy(conductor_config);

if let Some(route_data) = gw.match_route(&req.url().unwrap()) {
console_log!("Route found: {:?}", route_data);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if console_log! macro is handling logging efficiently in production,
It comes from worker_sys by cloudflare workers, and the inline docs are:

When debugging your Worker via wrangler dev, wrangler tail, or from the Workers Dashboard,
anything passed to this macro will be printed to the terminal or written to the console.

Comment on lines +32 to +36

let body = req.bytes().await.unwrap().into();
let uri = req.url().unwrap().to_string();
let query_string = req.url().unwrap().query().unwrap_or_default().to_string();
let method = Method::from_str(req.method().as_ref()).unwrap();
Copy link
Contributor

@YassinEldeeb YassinEldeeb Nov 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can provide helpful error messages later on instead of .expect()

Copy link
Contributor

@YassinEldeeb YassinEldeeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! ❤️

YassinEldeeb pushed a commit that referenced this pull request Nov 19, 2023
…a HTTP server, and also CF Worker (wasm) runtime (#127)

* restructure

ok separated config now

wip

wip

wip

ok ok

ok it's working again

ok getting there

ok

bring back plugins

fix graphiql

fix graphiql again

fix tracing

ok ok ok

fix clippy, fmt, over-http and ci

fix benches
fix deps

fix docker image

fix

* compile and run conductor as WASM (for CloudFlare Worker) (#134)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants