tianji icon indicating copy to clipboard operation
tianji copied to clipboard

Can install Tianji via other way than as a container?

Open dgtn-va opened this issue 1 year ago • 14 comments

Hi,

I would like install it on PaaS, where containerization is not available (because this env deploy with), like it's possible for Uptime Kuma. Alternative install/update method is planned in roadmap?

Thank you :)

dgtn-va avatar Apr 24 '24 09:04 dgtn-va

Hi, @dgtn-va , Thanks for your report, I added a document here : https://tianji.msgbyte.com/docs/install/manual

can you help us test it? if you have any problem, i can help you resolve it and improve this document

moonrailgun avatar Apr 24 '24 12:04 moonrailgun

Thank you very much!

I plan this and I will come back soon with my feedback ;)

dgtn-va avatar Apr 24 '24 12:04 dgtn-va

Hey @moonrailgun I noticed that the usage seemed way higher when building from source and running it locally then running it inside a docker container.

Is this sort of behavior expected?

Its4Nik avatar May 22 '24 05:05 Its4Nik

@moonrailgun Hi,

During my first test install, I had to add (globally) some missing dependencies for pnpm install:

  1. https://pnpm.io/installation#using-npm
  2. https://www.npmjs.com/package/ts-node#installation

After all clear and fresh restart:

  1. pnpm install: PASS
  2. pnpm build: FAIL

Actually, I can't run preconized 18.0 (pnpm requiere 18.12 minimum) or 20.4 (not available for me) Node.js versions. I can only these 20.x versions: 20.0.0, 20.1.0, 20.3.1, 20.7.0, 20.9.0, 20.11.0, 20.11.1, 20.13.1. Or 18.x versions: 18.0.0, 18.1.0, 18.5.0, 18.9.1, 18.12.1, 18.13.0, 18.15.0, 18.16.0, 18.16.1, 18.18.0, 18.18.2, 18.19.0, 18.19.1, 18.20.2.

But same result for tested version 20.7.0, 20.13.1 or 18.12.1...

dgtn-va@ssh1:~/tianji$ pnpm install

Scope: all 7 workspace projects Lockfile is up to date, resolution step is skipped Packages: +2840 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Progress: resolved 2840, reused 2765, downloaded 0, added 2840, done node_modules/.pnpm/@[email protected]/node_modules/@prisma/engines: Running postinstall script, done in 2s node_modules/.pnpm/@[email protected]/node_modules/@prisma/engines: Running postinstall script, done in 2.1s node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 416ms node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 399ms node_modules/.pnpm/[email protected][email protected]/node_modules/msw: Running postinstall script, done in 107ms node_modules/.pnpm/[email protected]/node_modules/isolated-vm: Running install script, done in 40.5s node_modules/.pnpm/[email protected][email protected]/node_modules/puppeteer: Running postinstall script, done in 18.2s node_modules/.pnpm/[email protected]/node_modules/core-js-pure: Running postinstall script, done in 66ms node_modules/.pnpm/[email protected]/node_modules/core-js: Running postinstall script, done in 58ms node_modules/.pnpm/[email protected]/node_modules/postman-code-generators: Running postinstall script, done in 1m 8.4s node_modules/.pnpm/[email protected][email protected]/node_modules/react-vertical-timeline-component: Running postinstall script, done in 73ms node_modules/.pnpm/[email protected]/node_modules/prisma: Running preinstall script, done in 64ms node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client: Running postinstall script, done in 1.4s node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client: Running postinstall script, done in 1.4s

dependencies:

  • dayjs 1.11.10
  • eventemitter-strict 1.0.1
  • zod 3.22.2

devDependencies:

  • @release-it/conventional-changelog 8.0.1
  • @types/fs-extra 11.0.3
  • @types/node 18.17.12
  • @types/tar 6.1.10
  • concurrently 8.2.2
  • cross-env 7.0.3
  • fs-extra 11.2.0
  • prettier-plugin-tailwindcss 0.5.12
  • release-it 17.0.1
  • tar 6.1.15
  • ts-node 10.9.1
  • typescript 5.2.2
  • vite 5.0.12

src/shared postinstall$ pnpm build [12 lines collapsed] │ [build:cjs] npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.0 │ [build:cjs] npm notice Run npm install -g [email protected] to update! │ [build:cjs] npm notice │ [build:esm] npm notice │ [build:esm] npm notice New major version of npm available! 9.9.3 -> 10.8.0 │ [build:esm] npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.0 │ npm notice Run npm install -g [email protected] to update! │ [build:esm] npm notice │ [build:cjs] npm run build:cjs exited with code 0 │ [build:esm] npm run build:esm exited with code 0 └─ Done in 4.7s packages/client-sdk prepare$ tsc └─ Done in 2.8s packages/react prepare$ tsc └─ Done in 1.6s src/server postinstall$ pnpm db:generate [7 lines collapsed] │ │ import { PrismaClient } from '@prisma/client' │ const prisma = new PrismaClient() │ │ or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate) │ │ import { PrismaClient } from '@prisma/client/edge' │ const prisma = new PrismaClient() │ │ See other ways of importing Prisma Client: http://pris.ly/d/importing-client └─ Done in 5.3s Done in 3m 24.2s

dgtn-va@ssh1:~/tianji$ pnpm build

[email protected] build /home/dgtn-va/tianji pnpm build:tracker && pnpm build:app && pnpm build:geo

[email protected] build:tracker /home/dgtn-va/tianji ts-node scripts/build-tracker.ts

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details. Start Build Tracker vite v5.0.12 building for production... ✓ 1 modules transformed. src/client/public/tracker.js 2.52 kB │ gzip: 1.45 kB ✓ built in 265ms Build Tracker Completed

[email protected] build:app /home/dgtn-va/tianji pnpm build:server && pnpm build:client

[email protected] build:server /home/dgtn-va/tianji cd src/server && pnpm build

@tianji/[email protected] build /home/dgtn-va/tianji/src/server tsc -p tsconfig.server.json

[email protected] build:client /home/dgtn-va/tianji cd src/client && pnpm build

@tianji/client@ build /home/dgtn-va/tianji/src/client vite build

♻️ Generating routes... ✅ Processed routes in 4825ms vite v5.0.12 building for production... ../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next-themes/dist/index.module.js (1:1576) A comment

"/#PURE/"

in "../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next-themes/dist/index.module.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment w ill be removed to avoid issues. ../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next-themes/dist/index.module.js (1:2992) A comment

"/#PURE/"

in "../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next-themes/dist/index.module.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment w ill be removed to avoid issues. Killed  ELIFECYCLE  Command failed with exit code 137.  ELIFECYCLE  Command failed with exit code 137.  ELIFECYCLE  Command failed with exit code 137.  ELIFECYCLE  Command failed with exit code 137. dgtn-va@ssh1:~/tianji$

About manual procedure install: https://tianji.msgbyte.com/docs/install/manual

  • DB URL string don't have connection_limit=10 param in your dist .env(.example) like described in your procedure.
  • In instructions just below, you may specify the locale to define for Postgre DB: en_US.utf8 value or possibly something else? And some extensions needed too?

Thanks.

dgtn-va avatar May 22 '24 11:05 dgtn-va

thanks for your report. i will update document for your report.

moonrailgun avatar May 22 '24 13:05 moonrailgun

let me know if still has error

moonrailgun avatar May 22 '24 13:05 moonrailgun

Hey @moonrailgun I noticed that the usage seemed way higher when building from source and running it locally then running it inside a docker container.

did you full follow dockerfile to build frontend and server?

moonrailgun avatar May 22 '24 13:05 moonrailgun

Hey @moonrailgun I noticed that the usage seemed way higher when building from source and running it locally then running it inside a docker container.

did you full follow dockerfile to build frontend and server?

Frontend and Server built locally

Its4Nik avatar May 22 '24 13:05 Its4Nik

@moonrailgun

let me know if still has error

Thanks, but my last test has been runned on officially compatible env:

dgtn-va@ssh1: ~$ node -v v18.12.1 dgtn-va@ssh1: ~$ npm list -g --depth=0 npm notice npm notice New major version of npm available! 9.9.3 -> 10.8.0 npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.0 npm notice Run npm install -g [email protected] to update! npm notice /home/dgtn-va/.npm-packages/lib ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] └── [email protected] digitanie@ssh1: ~$

Yet the build process unexpectedly stops... I don't see what the problem is.

Thank you.

dgtn-va avatar May 22 '24 14:05 dgtn-va

i think you are using pnpm 9. but recommand to use pnpm@8

some break change but not time to upgrade yet.

image

moonrailgun avatar May 24 '24 09:05 moonrailgun

Strictelly v8, okay. For me, "+" suppose compatible with any superior versions, including majors. You sould be probably write pnpm@8 instead in the manual 😉

New test and exactlly same issue/exit with [email protected] 🙁

dgtn-va@ssh1:~/tianji$ pnpm install

Scope: all 7 workspace projects Lockfile is up to date, resolution step is skipped Packages: +2840 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

╭─────────────────────────────────────────────────────────────────╮ │ │ │ Update available! 8.15.8 → 9.1.2. │ │ Changelog: https://github.com/pnpm/pnpm/releases/tag/v9.1.2 │ │ Run "pnpm add -g pnpm" to update. │ │ │ │ Follow @pnpmjs for updates: https://twitter.com/pnpmjs │ │ │ ╰─────────────────────────────────────────────────────────────────╯

Progress: resolved 2840, reused 2765, downloaded 0, added 2840, done node_modules/.pnpm/[email protected][email protected]/node_modules/msw: Running postinstall script... node_modules/.pnpm/[email protected][email protected]/node_modules/msw: Running postinstall script, done in 168msne-componen node_modules/.pnpm/[email protected][email protected]/node_modules/react-vertical-timeline-componen t: Running postinstall script, done in 137msdules/isolated-vm: Running install script... node_modules/.pnpm/[email protected]/node_modules/isolated-vm: Running install script, done in 44.4snstall script... node_modules/.pnpm/[email protected]/node_modules/postman-code-generators: Running postinstall script, do ne in 1m 30.1s node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 477ms node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 465ms node_modules/.pnpm/[email protected]/node_modules/prisma: Running preinstall script, done in 94ms node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client: Running postinstall script... node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client: Running postinstall script, done in 2.1ss

node_modules/.pnpm/[email protected][email protected]/node_modules/puppeteer: Running postinstall script, done in 2.4s

dependencies:

  • dayjs 1.11.10
  • eventemitter-strict 1.0.1
  • zod 3.22.2

devDependencies:

  • @release-it/conventional-changelog 8.0.1
  • @types/fs-extra 11.0.3
  • @types/node 18.17.12
  • @types/tar 6.1.10
  • concurrently 8.2.2
  • cross-env 7.0.3
  • fs-extra 11.2.0
  • prettier-plugin-tailwindcss 0.5.12
  • release-it 17.0.1
  • tar 6.1.15
  • ts-node 10.9.1
  • typescript 5.2.2
  • vite 5.0.12

src/shared postinstall$ pnpm build [2 lines collapsed] │ [build:esm] │ [build:esm] > @tianji/[email protected] build:esm │ [build:esm] > tsc --module esnext --outDir ./dist/esm │ [build:esm] │ [build:cjs] │ [build:cjs] > @tianji/[email protected] build:cjs │ [build:cjs] > tsc --module commonjs --outDir ./dist/cjs │ [build:cjs] │ [build:esm] npm run build:esm exited with code 0 │ [build:cjs] npm run build:cjs exited with code 0 └─ Done in 7.6s packages/client-sdk prepare$ tsc └─ Done in 4.5s packages/react prepare$ tsc └─ Done in 2.4s src/server postinstall$ pnpm db:generate [7 lines collapsed] │ │ import { PrismaClient } from '@prisma/client' │ const prisma = new PrismaClient() │ │ or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate) │ │ import { PrismaClient } from '@prisma/client/edge' │ const prisma = new PrismaClient() │ │ See other ways of importing Prisma Client: http://pris.ly/d/importing-client └─ Done in 8.1s Done in 4m 53.4s

dgtn-va@ssh1:~/tianji$ pnpm build

[email protected] build /home/dgtn-va/tianji pnpm build:tracker && pnpm build:app && pnpm build:geo

[email protected] build:tracker /home/dgtn-va/tianji ts-node scripts/build-tracker.ts

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-d eprecated for more details. Start Build Tracker vite v5.0.12 building for production... ✓ 1 modules transformed. src/client/public/tracker.js 2.52 kB │ gzip: 1.45 kB ✓ built in 139ms Build Tracker Completed

[email protected] build:app /home/dgtn-va/tianji pnpm build:server && pnpm build:client

[email protected] build:server /home/dgtn-va/tianji cd src/server && pnpm build

@tianji/[email protected] build /home/dgtn-va/tianji/src/server tsc -p tsconfig.server.json

[email protected] build:client /home/dgtn-va/tianji cd src/client && pnpm build

@tianji/client@ build /home/dgtn-va/tianji/src/client vite build

♻️ Generating routes... ✅ Processed routes in 4359ms vite v5.0.12 building for production... ../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next-themes/dist/in dex.module.js (1:1576) A comment

"/#PURE/"

in "../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next-themes/dis t/index.module.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The commen t will be removed to avoid issues. ../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next-themes/dist/in dex.module.js (1:2992) A comment

"/#PURE/"

in "../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next-themes/dis t/index.module.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The commen t will be removed to avoid issues. ✓ 10852 modules transformed. Killed  ELIFECYCLE  Command failed with exit code 137.  ELIFECYCLE  Command failed with exit code 137.  ELIFECYCLE  Command failed with exit code 137.  ELIFECYCLE  Command failed with exit code 137.

dgtn-va@ssh1:~/tianji$

dgtn-va avatar May 24 '24 10:05 dgtn-va

Thanks for your report.

i think exit code 137 means OOM error. its not recommend build frontend code in servers, special in low resource server.

for example, free github action even has 4gb memory for build.

actually, you can build tianji, then upload to server. i think its will be work fine in your case.

BTW, how much resource about your server?

moonrailgun avatar May 25 '24 12:05 moonrailgun

Just installed Tianji without docker. Some adjustments have to be made.

  • as https://github.com/msgbyte/tianji/commit/1b89c3b5a808b57f1a695b86a8f35e4199e0ed7c the pnpm version is bumped to 9.5.0
  • I installed latest pnpm version with npm install -g pnpm [Source]
  • using a pm2 config file, the following does work:
 { 
      name: "tianji",
      script: "dist/src/server/main.js",
      cwd: "/var/www/html/tianji/src/server/",
      watch: false,
      env: {
          "PORT": 3004,
          "NODE_ENV": "production"
      }
  }

1Luc1 avatar Jul 22 '24 18:07 1Luc1

as https://github.com/msgbyte/tianji/commit/1b89c3b5a808b57f1a695b86a8f35e4199e0ed7c the pnpm version is bumped to 9.5.0

thanks for reminder, i will update document.

moonrailgun avatar Jul 22 '24 18:07 moonrailgun