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

che-devworkspace-generator doesn't seem to like the URLs I have in my meta.yaml files #22974

Open
willkara opened this issue May 20, 2024 · 9 comments
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.

Comments

@willkara
Copy link

Summary

Trying to build/host a local instance of the dev-file-registry and it's failing when running the ./build/scripts/generate_devworkspace_templates.sh command.

Fails when trying to parse the Git based URL. I had to tweak the execution of the che-devworkspace-generator since it always failed while using npx. Changed it to use node node_modules/@eclipse-che/che-devworkspace-generator/lib/entrypoint.js


name=$(basename "${devfile_repo}")
    project="${name}={{_INTERNAL_URL_}}/resources/v2/${name}.zip"
    echo "${devfile_url}"                               #print out the URL to be used
    # Generate devworkspace-che-code-insiders.yaml
    npm_config_yes=true node node_modules/@eclipse-che/che-devworkspace-generator/lib/entrypoint.js \
    --devfile-url:"${devfile_url}" \
    --editor-entry:che-incubator/che-code/insiders \
    --plugin-registry-url:https://redhat-developer.github.io/devspaces/che-plugin-registry/"${VERSION}"/"${arch}"/v3 \
    --output-file:"${dir}"devworkspace-che-code-insiders.yaml \
    --project."${project}"

The output if ${devfile_url} is https://***/dev-spaces/devfiles/lombok-project/tree/v1-3.12-rhel8

The total error message is

stack=Error: Can not resolver the URL
    at GitUrlResolver.resolve (/vagrant/devspaces-stuff/che-devfile-registry/node_modules/@eclipse-che/che-devworkspace-generator/lib/resolve/git-url-resolver.js:31:19)
    at Main.<anonymous> (/vagrant/devspaces-stuff/che-devfile-registry/node_modules/@eclipse-che/che-devworkspace-generator/lib/main.js:113:40)
    at step (/vagrant/devspaces-stuff/che-devfile-registry/node_modules/@eclipse-che/che-devworkspace-generator/lib/main.js:61:23)
    at Object.next (/vagrant/devspaces-stuff/che-devfile-registry/node_modules/@eclipse-che/che-devworkspace-generator/lib/main.js:42:53)
    at fulfilled (/vagrant/devspaces-stuff/che-devfile-registry/node_modules/@eclipse-che/che-devworkspace-generator/lib/main.js:33:58)
Unable to start Error: Can not resolver the URL
    at GitUrlResolver.resolve (/vagrant/devspaces-stuff/che-devfile-registry/node_modules/@eclipse-che/che-devworkspace-generator/lib/resolve/git-url-resolver.js:31:19)
    at Main.<anonymous> (/vagrant/devspaces-stuff/che-devfile-registry/node_modules/@eclipse-che/che-devworkspace-generator/lib/main.js:113:40)
    at step (/vagrant/devspaces-stuff/che-devfile-registry/node_modules/@eclipse-che/che-devworkspace-generator/lib/main.js:61:23)
    at Object.next (/vagrant/devspaces-stuff/che-devfile-registry/node_modules/@eclipse-che/che-devworkspace-generator/lib/main.js:42:53)
    at fulfilled (/vagrant/devspaces-stuff/che-devfile-registry/node_modules/@eclipse-che/che-devworkspace-generator/lib/main.js:33:58)

Relevant information

Trying to build it locally and push to our registry so that I can deploy it in a customized environment. It is running in a vagrant managed VirtualBox Ubuntu OS.

I had to tweak the execution of the che-devworkspace-generator since it always failed while using npx. Changed it to use node node_modules/@eclipse-che/che-devworkspace-generator/lib/entrypoint.js

@willkara willkara added the kind/question Questions that haven't been identified as being feature requests or bugs. label May 20, 2024
@ibuziuk
Copy link
Member

ibuziuk commented May 21, 2024

@svor @vinokurig could you please take a look?

@vinokurig
Copy link
Contributor

@willkara devfile-url must be a git repository url, but not a direct file url. We support GitHub, BitBucket, and BitBucket-Server repository urls.

@willkara
Copy link
Author

@vinokurig , I'll be using self-hosted GitLab for our DevFile registry.

Might be a mental-block for now, but could you please describe the difference between git repository URL and direct file URL?

The one I used as an example was taking from the browser address-bar when I navigated to the branch I want to use.

@vinokurig
Copy link
Contributor

vinokurig commented May 22, 2024

could you please describe the difference between git repository URL and direct file URL?

By the direct file url I mean the url which points to a specific file from the repository tree.

The one I used as an example was taking from the browser address-bar when I navigated to the branch I want to use

This should work as it points to the repository's root.

I'll be using self-hosted GitLab for our DevFile registry.

We do not support GitLab Server yet. @ibuziuk Do we need an issue to add the GitLab Server support?

@willkara
Copy link
Author

@vinokurig , I'd be able to help attack it. It'd need to be able to support gitlab.com as well as self-hosted versions.

I wonder if the self-hosted version necessitates the creation of a general git resolver, rather than falling back on hostnames?

@vinokurig
Copy link
Contributor

We do not support Gitlab yet, so we would need a separate resolver for it. In case of Gitlab we can have one resolver for both SAAS and self hosted versions.

@ibuziuk
Copy link
Member

ibuziuk commented May 23, 2024

@willkara @vinokurig There are no plans to provide support for any other providers for che-devfile-registry since it is going to be deprecated in the short run - #22960

For getting-started samples consider using cloud-native k8s cm based approach - https://eclipse.dev/che/docs/stable/administration-guide/configuring-getting-started-samples/

@willkara
Copy link
Author

@ibuziuk , sad news! Seems like the new option is a lot more flexible and less involved.

Would you recommend the ConfigMap approach for self-hosted versions? Any chance you have an example or two to make sure I get it right? lol

When I attempt the ConfigMap version, should I disable the built-in DevFile registry?

@willkara
Copy link
Author

Also, does this approach require a certain version? Seems like it works with 3.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.
Projects
None yet
Development

No branches or pull requests

3 participants