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

chore: Pre-build DevWorkspace templates for devfile v2 #518

Merged
merged 14 commits into from Nov 24, 2021
Merged

chore: Pre-build DevWorkspace templates for devfile v2 #518

merged 14 commits into from Nov 24, 2021

Conversation

vinokurig
Copy link
Contributor

Signed-off-by: Igor Vinokur ivinokur@redhat.com

What does this PR do?

Generate DW templates at build time and put them into /usr/local/apache2/htdocs/devfiles/v2/che-thei/ folder in the che-devfile-registry image.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

fixes eclipse-che/che#19718

How to test this PR?

  1. Build and run the che-devfile-registry image.
  2. Go to <devfile-registry URL>/devfiles/v2/che-theia/.
  3. See: List of the generated tamplates.

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
@github-actions
Copy link

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

Click here to review and test in web IDE: Contribute

FROM registry.access.redhat.com/ubi8/nodejs-12:1-102 as dwtemplates
USER 0

RUN npm install -g @eclipse-che/che-theia-devworkspace-handler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it won't work in brew environment (cc @nickboldt for downstreaming)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, CRW devfile registry is a fork. There's no sync between che devfile reg and the crw one.

Therefore you need to manually apply these changes to downstream. But you cannot just npm install in brew unless either:

@github-actions
Copy link

Click here to review and test in web IDE: Contribute

@benoitf
Copy link
Contributor

benoitf commented Nov 23, 2021

Thank you for all the fixes

I still have a couple of questions:

  • how do we get the link to this dev workspace templates ? I don't see meta.yaml being updated with the link to che-theia devWorkspace templates for example ?
  • What are the images of che-theia used ? for example when we cut a release like 7.40.0 what devworkspace.yaml file will contain ? as it should reference che-theia:7.40.0 images in that case ?

@github-actions
Copy link

Click here to review and test in web IDE: Contribute

@eclipse-che eclipse-che deleted a comment from github-actions bot Nov 24, 2021
@eclipse-che eclipse-che deleted a comment from github-actions bot Nov 24, 2021
@eclipse-che eclipse-che deleted a comment from github-actions bot Nov 24, 2021
@eclipse-che eclipse-che deleted a comment from github-actions bot Nov 24, 2021
@eclipse-che eclipse-che deleted a comment from github-actions bot Nov 24, 2021
@vinokurig
Copy link
Contributor Author

@svor @benoitf

  • The meta.yaml file is updated with devWorkspaces links.
  • DevWorkspace templates are generated for both next and latest versions in the extension directory.
  • shellcheck successfully passed.

@benoitf
Copy link
Contributor

benoitf commented Nov 24, 2021

I tested but I have as links

links": {
"v2": "https://github.com/che-samples/java-guestbook/tree/devfilev2",
"self": "/devfiles/java-mongo/devfile.yaml",
"devWorkspaces": {
"eclipse/che-theia/latest": "devfiles/java-mongo/devworkspace-che-theia-latest.yaml",
"eclipse/che-theia/next": "devfiles/java-mongo/devworkspace-che-theia-next.yaml"

so I suppose there is a missing / before devfiles ?

@github-actions
Copy link

Click here to review and test in web IDE: Contribute

@vinokurig
Copy link
Contributor Author

@benoitf

I tested but I have as links

"links": {
"v2": "https://github.com/che-samples/java-guestbook/tree/devfilev2",
"self": "/devfiles/java-mongo/devfile.yaml",
"devWorkspaces": {
"eclipse/che-theia/latest": "devfiles/java-mongo/devworkspace-che-theia-latest.yaml",
"eclipse/che-theia/next": "devfiles/java-mongo/devworkspace-che-theia-next.yaml"
}

so I suppose there is a missing / before devfiles ?

fixed

@vinokurig
Copy link
Contributor Author

@nickboldt @svor @benoitf

seems reasonable. Please remember to submit a PR for downstreaming this into https://github.com/redhat-developer/codeready-workspaces/tree/crw-2-rhel-8/dependencies/che-devfile-registry/devfiles for CRW 2.14

I think it should be done as a next iteration and in the scope of a separate issue.

Copy link
Contributor

@benoitf benoitf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok to me as first step

@benoitf
Copy link
Contributor

benoitf commented Nov 24, 2021

probably it requires a change in release.sh to handle the tag replacement for latest images in DevWorkspaceTemplates but I don't know if you plan to do it now or later. But it needs to be addressed

@svor
Copy link
Contributor

svor commented Nov 24, 2021

Release DevWorkspaceTemplates in devfile registry #20824
Related issue for CRW: https://issues.redhat.com/browse/CRW-2500

@svor
Copy link
Contributor

svor commented Nov 24, 2021

Is it ok that the content of resulted meta.yaml is in json format?

@benoitf
Copy link
Contributor

benoitf commented Nov 24, 2021

@svor

Index file is in JSON and it's where we're adding the links

The generated file is in yaml file as expected

@svor
Copy link
Contributor

svor commented Nov 24, 2021

@benoitf I mean in devfiles/go folder i see meta.yaml and its content is in JSON:

bash-5.0# ls
devfile.yaml  devworkspace-che-theia-latest.yaml  devworkspace-che-theia-next.yaml  meta.yaml
bash-5.0# cat meta.yaml 
{
  "displayName": "Go",
  "description": "Stack with Go 1.14",
  "tags": [
    "Debian",
    "Go"
  ],
  "icon": "/images/go.svg",
  "links": {
    "v2": "https://github.com/che-samples/golang-echo-example/tree/devfile2",
    "self": "/devfiles/go/devfile.yaml",
    "devWorkspaces": {
      "eclipse/che-theia/latest": "/devfiles/go/devworkspace-che-theia-latest.yaml",
      "eclipse/che-theia/next": "/devfiles/go/devworkspace-che-theia-next.yaml"
    }
  }
}

But it's not related to this PR

@svor svor merged commit a7b1ac9 into main Nov 24, 2021
@svor svor deleted the che-19718 branch November 24, 2021 22:15
@che-bot che-bot added this to the 7.40 milestone Nov 24, 2021
@nickboldt
Copy link
Contributor

Downstream issue is https://issues.redhat.com/browse/CRW-2500

@benoitf
Copy link
Contributor

benoitf commented Nov 25, 2021

@svor OK that's a bug that needs to be fixed

@svor
Copy link
Contributor

svor commented Nov 25, 2021

@svor OK that's a bug that needs to be fixed

issue for that eclipse-che/che#20828

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

Successfully merging this pull request may close these issues.

Pre-build DevWorkspace templates for devfile v2 of devfile registry
5 participants