Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self deploy via docker is broken without yarn.lock #1132

Open
nittolese opened this issue Dec 7, 2023 · 3 comments
Open

Self deploy via docker is broken without yarn.lock #1132

nittolese opened this issue Dec 7, 2023 · 3 comments

Comments

@nittolese
Copy link

Hi,
I'm trying to follow this guide about self deploy with docker compose

During the build and after the docker compose up -d command, I'm getting this:

 => ERROR [worker-anthropic-proxy 6/7] COPY worker/package.json worker/yarn.lock ./                                          0.0s
 => ERROR [worker-openai-proxy 6/7] COPY worker/package.json worker/yarn.lock ./                                             0.0s
 => ERROR [worker-helicone-api 6/7] COPY worker/package.json worker/yarn.lock ./                                             0.0s
------
 > [worker-anthropic-proxy 6/7] COPY worker/package.json worker/yarn.lock ./:
------
------
 > [worker-openai-proxy 6/7] COPY worker/package.json worker/yarn.lock ./:
------
------
 > [worker-helicone-api 6/7] COPY worker/package.json worker/yarn.lock ./:
------
failed to solve: failed to compute cache key: failed to calculate checksum of ref 2a950788-0b40-4efd-affa-3a2d87def67d::6s2eaxhjp50p6zn29xvgz2k8l: "/worker/yarn.lock": not found

It seems that this yarn.lock is missing from the current version of this repo, so I found this https://github.com/Helicone/helicone/blob/update-intructions/worker/yarn.lock from a previous version of the repo.

But now I'm getting this:

 => CANCELED [web 4/4] RUN yarn                                                                                             53.0s
 => [clickhouse-migration-runner 5/6] WORKDIR /app                                                                           0.0s
 => [clickhouse-migration-runner 6/6] COPY ./clickhouse/ /app                                                                0.0s
 => [clickhouse-migration-runner] exporting to image                                                                         2.9s
 => => exporting layers                                                                                                      2.9s
 => => writing image sha256:8c8ed51b965b48f754992a272d47542cb722d1008bd0a2067eed093dffdd332a                                 0.0s
 => => naming to docker.io/library/clickhouse-migration-runner-local                                                         0.0s
 => [worker-helicone-api 4/7] RUN npm install -g wrangler                                                                   11.5s
 => [worker-helicone-api 5/7] WORKDIR /usr/src/app                                                                           0.1s
 => [worker-anthropic-proxy 6/7] COPY worker/package.json worker/yarn.lock ./                                                0.0s
 => CANCELED [worker-anthropic-proxy 7/7] RUN yarn                                                                          12.3s
 => ERROR [jawn 5/6] RUN npx lerna run build                                                                                11.5s
------
 > [jawn 5/6] RUN npx lerna run build:
2.319 lerna notice cli v7.4.2
2.389
2.390  >  Lerna (powered by Nx)   Running target build for 3 projects:
2.390
2.390     - helicone-shared-ts
2.390     - jawn
2.390     - slay
2.390
2.390
6.309
6.309 > slay:build
6.309
yarn run v1.22.19
$ tsc
Done in 3.11s.
7.281
7.281 > helicone-shared-ts:build
7.282
yarn run v1.22.19
$ tsc
Done in 3.98s.
10.95
10.95 > jawn:build
10.95
yarn run v1.22.19
$ tsc
10.95 src/index.ts(4,56): error TS7016: Could not find a declaration file for module 'helicone-shared-ts'. '/usr/src/app/packages/helicone-shared-ts/dist/index.js' implicitly has an 'any' type.
10.95   Try `npm i --save-dev @types/helicone-shared-ts` if it exists or add a new declaration (.d.ts) file containing `declare module 'helicone-shared-ts';`
10.95 src/index.ts(37,14): error TS7031: Binding element 'request' implicitly has an 'any' type.
10.95 src/index.ts(37,23): error TS7031: Binding element 'res' implicitly has an 'any' type.
10.95 src/index.ts(37,28): error TS7031: Binding element 'supabaseClient' implicitly has an 'any' type.
10.95 src/index.ts(37,44): error TS7031: Binding element 'db' implicitly has an 'any' type.
10.95 src/index.ts(90,19): error TS7031: Binding element 'db' implicitly has an 'any' type.
10.95 src/index.ts(90,23): error TS7031: Binding element 'request' implicitly has an 'any' type.
10.95 src/index.ts(90,32): error TS7031: Binding element 'res' implicitly has an 'any' type.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
10.95
10.95
10.95
10.95  >  Lerna (powered by Nx)   Running target build for 3 projects failed
10.95
10.95    Failed tasks:
10.95
10.95    - jawn:build
10.95
10.97 npm notice
10.97 npm notice New patch version of npm available! 10.2.3 -> 10.2.5
10.97 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.5>
10.97 npm notice Run `npm install -g npm@10.2.5` to update!
10.97 npm notice
------
failed to solve: process "/bin/sh -c npx lerna run build" did not complete successfully: exit code: 1

What I'm missing?

@umuthopeyildirim
Copy link
Contributor

Hello @nittolese,

Apologies for the inconvenience caused. It appears that you encountered an error because dockerfile-local was searching for a yarn.lock file. We have transitioned to NPM, as it is more widely used. Below is the updated version of dockerfile-local. Could you please try copying this into your workers/dockerfile-local directory and then re-compose it?

FROM node:18.11.0

WORKDIR /worker

RUN apt-get update && apt-get install -y clang libc++-dev libc++abi-dev

RUN npm install -g wrangler

WORKDIR /usr/src/app

COPY worker/package.json worker/package-lock.json ./

RUN npm install

CMD env > .dev.vars && echo "n" | wrangler dev --local --port ${PORT}

Let us know if this fixed your issue!

@fightingmonk
Copy link

fightingmonk commented Jan 30, 2024

Hi @umuthopeyildirim - I am hitting this same issue w/ current main branch.

Can you confirm that if I want to run Helicone locally using docker-compose I should be running compose from the root of the repo and using the docker-compose-local.yml config? I found another issue where they are talking about running docker-compose from inside ./docker - but that's not mentioned in the Self Deploy Docker Compose docs

Error I get is:

=> ERROR [worker-helicone-api 6/7] COPY worker/package.json worker/package-lock.json ./

I replaced the contents of worker/dockerfile-local as suggested but no change -- worker/package-lock.json is missing during the build. I used npm i to generate a package-lock, and the COPY command succeeds now.

cd worker
nvm install 18.15
nvm use 18.15
npm i
cd ..
docker-compose -f docker-compose-local.yml up 

However, I'm now hitting another dependency error. Any ideas?

 > [web 4/4] RUN yarn:
0.185 yarn install v1.22.19
0.230 [1/4] Resolving packages...
[SNIPPED DEPRECATION WARNINGS]
24.63 [2/4] Fetching packages...
73.53 error next@14.1.0: The engine "node" is incompatible with this module. Expected version ">=18.17.0". Got "18.11.0"
73.61 error Found incompatible module.
73.61 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
------
failed to solve: process "/bin/sh -c yarn" did not complete successfully: exit code: 1

@andychase
Copy link

I ran into the same issue but found that it did at least start using the compose file in /docker

I suspect the one in the root directory is old or for a different purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants