You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to run hive gateway with bun. But according to the docs, I need to use a programmatic approach.
However, for other issues I have been involved in, I have been strongly advised to use the hive cli to start my gateway; i.e. starting with hive-gateway supergraph. When I adopted this approach, abandoning my programmatic one, I start to see this warning in logs:
You use Bun Node compatibility mode, which is not recommended! It will affect your performance. Please check our Bun integration recipe, and avoid using 'http' for your server implementation.
My dockerfile:
# e.g. docker buildx build -f Dockerfile.hive-gateway -t hive . && docker run --rm -it --name hivey hive shFROM oven/bun:1.1.36 AS bun
FROM bun AS base
WORKDIR /app
COPY package.json package.json.tmp
# bun install needs all the files listed in workspaces, remove unwanted workspaces now:RUN cat package.json.tmp | grep -v "bebb4185" | grep -v 'scripts' | grep -v 'query-registry' | grep -v 'dashboards' | grep -v 'dgs' > package.json && rm package.json.tmp
COPY gateway/package.json ./gateway/package.json
COPY shared/package.json ./shared/package.json.tmp
RUN cat ./shared/package.json.tmp | grep -v "farmhash" > ./shared/package.json && rm ./shared/package.json.tmp
# Install production depsCOPY patches patches/
RUN bun install --production
### Produce the final artefact:FROM bun AS final
WORKDIR /app
COPY .local-dev-services.json .local-dev-services.json
# Copy prod dependencies from base:COPY --from=base /app/node_modules /app/node_modules/
RUN rm -rf /app/node_modules/@vcc/gateway
COPY gateway /app/
COPY shared /app/shared
COPY package.json.dgs ./package.json
ENV HOST=0.0.0.0
ENV PORT=3000
CMD [ "bun", "hive-gateway", "supergraph" ]
What is the recommended approach to run Hive Gateway with Bun (and full speed) without seeing this warning?
The text was updated successfully, but these errors were encountered:
klippx
changed the title
Running with hive-cli with bun
Running Hive Gateway with bun (non-programmatic)
Nov 21, 2024
klippx
changed the title
Running Hive Gateway with bun (non-programmatic)
Running Hive Gateway with Bun (non-programmatic)
Nov 21, 2024
Actually you can ignore the warning and keep using it, it is still way faster than Node even if it is compatibility mode. We are going to ship these changes so our CLI will also use Bun's native API so there will no longer be a warning. #98
I want to run hive gateway with bun. But according to the docs, I need to use a programmatic approach.
However, for other issues I have been involved in, I have been strongly advised to use the hive cli to start my gateway; i.e. starting with
hive-gateway supergraph
. When I adopted this approach, abandoning my programmatic one, I start to see this warning in logs:My dockerfile:
What is the recommended approach to run Hive Gateway with Bun (and full speed) without seeing this warning?
The text was updated successfully, but these errors were encountered: