Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Remove opengraph now that UI doesn't depend on it #67

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,9 @@ RUN locale-gen ${LOCALE}

COPY . /animated-carnival
WORKDIR /animated-carnival
RUN cd fetch-open-graph && \
go build -o /usr/local/bin/
RUN cargo build --release
FROM ubuntu:20.04
COPY --from=builder /animated-carnival/target/release/agent /usr/local/bin
COPY --from=builder /usr/local/bin/fetch-open-graph /usr/local/bin/fetch-open-graph
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
ca-certificates \
Expand Down
21 changes: 0 additions & 21 deletions crates/agent-sql/src/connector_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,6 @@ where
Ok(())
}

pub async fn update_open_graph_raw(
connector_id: Id,
open_graph_raw: Box<RawValue>,
txn: &mut sqlx::Transaction<'_, sqlx::Postgres>,
) -> sqlx::Result<()> {
sqlx::query!(
r#"update connectors set
open_graph_raw = $2,
updated_at = clock_timestamp()
where id = $1
returning 1 as "must_exist";
"#,
connector_id as Id,
Json(open_graph_raw) as Json<Box<RawValue>>,
)
.fetch_one(txn)
.await?;

Ok(())
}

pub async fn update_oauth2_spec(
connector_id: Id,
oauth2_spec: Box<RawValue>,
Expand Down
23 changes: 0 additions & 23 deletions crates/agent/src/connector_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,6 @@ impl TagHandler {
return Ok((row.tag_id, JobStatus::SpecFailed));
}

let fetch_open_graph =
tokio::process::Command::new(format!("{}/fetch-open-graph", &self.bindir))
.kill_on_drop(true)
.arg("-url")
.arg(&row.external_url)
.output()
.await
.context("fetching open graph metadata")?;

if !fetch_open_graph.status.success() {
return Ok((
row.tag_id,
JobStatus::OpenGraphFailed {
error: String::from_utf8_lossy(&fetch_open_graph.stderr).into(),
},
));
}
let open_graph_raw: Box<RawValue> = serde_json::from_slice(&fetch_open_graph.stdout)
.context("parsing open graph response")?;

agent_sql::connector_tags::update_open_graph_raw(row.connector_id, open_graph_raw, txn)
.await?;

/// Spec is the output shape of the `flowctl api spec` command.
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
Expand Down
5 changes: 0 additions & 5 deletions fetch-open-graph/go.mod

This file was deleted.

6 changes: 0 additions & 6 deletions fetch-open-graph/go.sum

This file was deleted.

133 changes: 0 additions & 133 deletions fetch-open-graph/main.go

This file was deleted.

8 changes: 3 additions & 5 deletions local/start-component.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ function must_run() {
function wait_until_listening() {
local port="$1"
local desc="$2"
log Waiting for $desc to be listening on port $port
while ! nc -z localhost $port; do
log Waiting for "$desc" to be listening on port "$port"
while ! nc -z localhost "$port"; do
sleep 1
done
log $desc is now listening on port $port
log "$desc" is now listening on port "$port"
}

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";
Expand Down Expand Up @@ -90,8 +90,6 @@ function start_control_plane() {

function start_control_plane_agent() {
local flow_bin_dir="$(project_dir 'flow')/.build/package/bin"
cd "$(project_dir 'animated-carnival')/fetch-open-graph"
go build -o "$flow_bin_dir"

cd "$(project_dir 'animated-carnival')"
# Start building immediately, since it could take a while
Expand Down
11 changes: 1 addition & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The agent is a non-user-facing component which lives under [crates/agent/](crate

Today this includes:

* Fetching connector details, such as open-graph metadata and endpoint / resource JSON-schemas.
* Fetching connector details, such as endpoint / resource JSON-schemas.
* Running connector discovery operations to produce proposed catalog specifications.
* Publishing catalog drafts by testing and then activating them into the data-plane.

Expand Down Expand Up @@ -129,15 +129,6 @@ data-plane-gateway

_Note: The gateway allows for configuring the port, the Flow service ports, the signing secret, and the CORS settings. The defaults should work out of the box._

### Build `fetch-open-graph`:

Build the fetch-open-graph helper to the same location where the flow binaries live. This is the same path that will be provided to the agent using `--bin--dir` argument:

```console
cd fetch-open-graph/
go build -o ~/estuary/flow/.build/package/bin/
```

### Start the `agent`:

Again from within your checkout of this repo:
Expand Down
1 change: 0 additions & 1 deletion scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cd /home/agent
wget https://github.com/estuary/flow/releases/download/dev/flow-x86-linux.tar.gz
mkdir -p /home/agent/.bin
tar -xvf flow-x86-linux.tar.gz -C /home/agent/.bin
cp /usr/local/bin/fetch-open-graph /home/agent/.bin/fetch-open-graph

if [[ $1 ]]; then
eval "$@"
Expand Down
3 changes: 1 addition & 2 deletions scripts/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ paths=(
/usr/local/bin/flowctl-go
/usr/bin/gsutil
/usr/local/bin/sops
/usr/bin/jq
/usr/local/bin/fetch-open-graph)
/usr/bin/jq)

for i in "${paths[@]}"
do
Expand Down
Loading