eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.99k stars 1.19k forks source link

How to build chectl outside Che #21367

Closed ghost closed 1 year ago

ghost commented 2 years ago

Summary

Because of the situation with #21366, I'm now stuck in a situation where I don't have a Che cluster deployed and can't redeploy it. I planned to build the old version myself but found that the documentation expects me to develope chectl only from inside Che; is there any documentation on building it outside of itself?

Relevant information

I tried to run yarn as instructed, incase that would just work. Here's the output I got:

``` yarn install v1.22.18 [1/5] Validating package.json... [2/5] Resolving packages... success Already up-to-date. $ npm run -s postinstall-repositories && npm run -s postinstall-operator && npm run -s postinstall-cleanup yarn upgrade v1.22.18 [1/5] Validating package.json... [2/5] Resolving packages... [3/5] Fetching packages... [4/5] Linking dependencies... warning "eslint-config-oclif > eslint-config-xo-space@0.20.0" has incorrect peer dependency "eslint@^5.3.0". warning "eslint-config-oclif-typescript > @typescript-eslint/eslint-plugin@2.34.0" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0". warning "eslint-config-oclif-typescript > @typescript-eslint/parser@2.34.0" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0". [5/5] Rebuilding all packages... success Saved lockfile. success Saved 1 new dependency. info Direct dependencies └─ eclipse-che-operator@0.0.0 info All dependencies └─ eclipse-che-operator@0.0.0 Done in 7.76s. internal/fs/utils.js:332 throw err; ^ Error: ENOENT: no such file or directory, lstat '/home/yujiri/chectl/node_modules/eclipse-che-operator/config/samples/org_v1_chebackupserverconfiguration.yaml' at Object.lstatSync (fs.js:1119:3) at Object.lstatSync (/home/yujiri/chectl/node_modules/graceful-fs/polyfills.js:307:34) at statFunc (/home/yujiri/chectl/node_modules/fs-extra/lib/util/stat.js:24:20) at getStatsSync (/home/yujiri/chectl/node_modules/fs-extra/lib/util/stat.js:25:19) at Object.checkPathsSync (/home/yujiri/chectl/node_modules/fs-extra/lib/util/stat.js:67:33) at Object.copySync (/home/yujiri/chectl/node_modules/fs-extra/lib/copy-sync/copy-sync.js:24:38) at prepareTemplates (/home/yujiri/chectl/prepare-che-operator-templates.js:46:12) at Object. (/home/yujiri/chectl/prepare-che-operator-templates.js:55:1) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) { errno: -2, syscall: 'lstat', code: 'ENOENT', path: '/home/yujiri/chectl/node_modules/eclipse-che-operator/config/samples/org_v1_chebackupserverconfiguration.yaml' } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command ```
benoitf commented 2 years ago

What's your nodejs version ? Try with nodejs 16.x

ghost commented 2 years ago

I was running node 14.19, but after installing 16.15 the same output appears (and I recloned the repository so it can't be cached build files or anything).

ghost commented 2 years ago

I am running this on Artix Linux 5.17.4. npm is 8.5.5. Let me know if any other environment inforrmation would hlep.

tolusha commented 2 years ago

@yujiri8 What is chectl version you tried to build? Any changes in package.json ?

ghost commented 2 years ago

I checked out the tag v7.41.2. There are no changes in package.json, though yarn.lock did get modified after running yarn.

diff --git a/yarn.lock b/yarn.lock
index 44321fa..407bf99 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2579,7 +2579,7 @@ ecc-jsbn@~0.1.1:

 "eclipse-che-operator@https://github.com/eclipse-che/che-operator#main":
   version "0.0.0"
-  resolved "https://github.com/eclipse-che/che-operator#bb3c53cc6cba197ebab9d2889aa4fc0788c076e8"
+  resolved "https://github.com/eclipse-che/che-operator#73bbeaafeac5abdedbd9e7903fc2a305fb9bbdca"

 editorconfig@^0.15.0:
   version "0.15.3"
tolusha commented 2 years ago

@yujiri8 Something strange, but to fix your problem pls set 7.41.2 instead of main here [1]

[1] https://github.com/che-incubator/chectl/blob/7.41.2/package.json#L25

amisevsk commented 2 years ago

@tolusha is this issue present in other chectl release branches? Do we need a follow-up issue to fix it?

ghost commented 2 years ago

Ah, Tolusha's suggestion fixed it for me. Thank you.

tolusha commented 2 years ago

Actually this issue helped me realize that our release actions behave incorrectly. This action [1] is triggered once .x branch is created (even before release PR is merged). So, release sources won't have updated package.json file.

@mkuznyetsov pls have a look.

[1] https://github.com/che-incubator/chectl/blob/0a7174a56b1ce6902613be3243001e25347fa983/.github/workflows/release-build-and-push-to-GH-releases.yml#L18

amisevsk commented 2 years ago

Thanks for catching this @yujiri8 :+1:

che-bot commented 2 years ago

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

amisevsk commented 2 years ago

/remove-lifecycle stale

nickboldt commented 1 year ago

well, this change has broken the release process because the GH action that creates the release PR needs the branch to exist :) will work on a fix...

https://github.com/che-incubator/chectl/actions/runs/3540932049/jobs/5944574155

tolusha commented 1 year ago

Basically we can close this issue now. package.json in .x branch contains correct che and devworkspace operators versions.