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

fix: mark idea-rhel8 component as container-contribution #881

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

vitaliy-guliy
Copy link
Contributor

Signed-off-by: Vitaliy Gulyy vgulyy@redhat.com

What does this PR do?

  1. Marks idea-rhel8 component of IDEA editor as container contribution.
  2. Replaces app.kubernetes.io/component: che-rhel8-injector on app.kubernetes.io/component: che-rhel8-runtime to be consistent with che-code where everything works without issues

What issues does this PR fix or reference?

eclipse-che/che#21878

Depends on eclipse-che/che#21738

Release Notes

Docs PR (if applicable)

Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
Copy link
Contributor

@svor svor left a comment

Choose a reason for hiding this comment

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

The codebase looks good. Please wait with the merge, I want to test

@svor
Copy link
Contributor

svor commented Feb 1, 2023

Tested by
kubectl apply -f all-in-one.yaml -n che-kube-admin-che-caxqov

all-in-one.yaml is:
apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspaceTemplate
metadata:
  name: che-idea-spring-petclinic
spec:
  commands:
    - id: init-container-command
      apply:
        component: idea-rhel8-injector
  events:
    preStart:
      - init-container-command
  components:
    - name: idea-rhel8
      container:
        image: quay.io/devfile/universal-developer-image:ubi8-9436df2
        command:
          - /projector/entrypoint-volume.sh
        env:
          - name: PROJECTOR_ASSEMBLY_DIR
            value: /projector
          - name: PROJECTOR_CONFIG_DIR
            value: /home/user/.jetbrains
        volumeMounts:
          - name: projector-volume
            path: /projector
          - name: projector-configuration
            path: /home/user/.jetbrains
          - name: projector-java-configuration
            path: /home/user/.java
        memoryLimit: 6144Mi
        memoryRequest: 2048Mi
        cpuLimit: 2000m
        cpuRequest: 1500m
        endpoints:
          - name: intellij
            attributes:
              type: main
              cookiesAuthEnabled: true
              discoverable: false
              urlRewriteSupported: true
              secure: false
            targetPort: 8887
            exposure: public
            path: /?backgroundColor=434343&wss
            protocol: http
          - name: intellij-redirect-1
            attributes:
              discoverable: false
              urlRewriteSupported: false
            targetPort: 13131
            exposure: public
            protocol: http
          - name: intellij-redirect-2
            attributes:
              discoverable: false
              urlRewriteSupported: false
            targetPort: 13132
            exposure: public
            protocol: http
          - name: intellij-redirect-3
            attributes:
              discoverable: false
              urlRewriteSupported: false
            targetPort: 13133
            exposure: public
            protocol: http
      attributes:
        app.kubernetes.io/component: idea-rhel8-runtime
        app.kubernetes.io/part-of: idea-rhel8.eclipse.org
        controller.devfile.io/container-contribution: true
    - name: projector-volume
      volume: {}
    - name: projector-configuration
      volume: {}
    - name: projector-java-configuration
      volume: {}
    - name: idea-rhel8-injector
      container:
        image: quay.io/che-incubator/che-idea:next
        command:
          - /projector/entrypoint-init-container.sh
        env:
          - name: PROJECTOR_VOLUME_MOUNT
            value: /projector-volume
          - name: PROJECTOR_ASSEMBLY_DIR
            value: /projector
        volumeMounts:
          - name: projector-volume
            path: /projector-volume
        memoryLimit: 128Mi
        memoryRequest: 32Mi
        cpuLimit: 500m
        cpuRequest: 30m
---
apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspace
metadata:
  name: spring-petclinic
spec:
  started: true
  template:
    components:
      - name: tools
        container:
          image: quay.io/devfile/universal-developer-image:ubi8-0e189d9
          memoryLimit: 3Gi
          endpoints:
            - exposure: none
              name: debug
              protocol: tcp
              targetPort: 5005
            - exposure: public
              name: 8080-tcp
              protocol: http
              targetPort: 8080
          volumeMounts:
            - name: m2
              path: /home/user/.m2
        attributes:
          controller.devfile.io/merge-contribution: true
      - name: m2
        volume:
          size: 1G
      - name: mariadb
        container:
          image: >-
            quay.io/eclipse/che--mariadb:10.7.1-5a8009369ee57c85b6f4a08406147bd9c505cde6b8250d16a27d2a5febfdead7
          memoryLimit: 300Mi
          endpoints:
            - exposure: none
              name: db
              protocol: tcp
              targetPort: 3306
          env:
            - name: MARIADB_USER
              value: petclinic
            - name: MARIADB_PASSWORD
              value: petclinic
            - name: MARIADB_DATABASE
              value: petclinic
            - name: MARIADB_ALLOW_EMPTY_ROOT_PASSWORD
              value: allow
            - name: PS1
              value: $(echo ${0}) $
          volumeMounts:
            - name: mysqldata
              path: /var/lib/mysql
      - name: mysqldata
        volume:
          size: 256Mi
    commands:
      - id: prepare-database
        exec:
          component: mariadb
          workingDir: ${PROJECT_SOURCE}
          commandLine: >
            mysql -u root <
            ${PROJECT_SOURCE}/src/main/resources/db/mysql/user.sql && \

            mysql -u root petclinic <
            ${PROJECT_SOURCE}/src/main/resources/db/mysql/schema.sql && \

            mysql -u root petclinic <
            ${PROJECT_SOURCE}/src/main/resources/db/mysql/data.sql && \

            echo "\e[32mDone.\e[0m Database petclinic was configured"
          group:
            kind: run
            isDefault: true
      - id: maven-build
        exec:
          component: tools
          workingDir: ${PROJECT_SOURCE}
          commandLine: mvn clean install
          group:
            kind: build
            isDefault: true
      - id: run-with-hsqldb
        exec:
          component: tools
          workingDir: ${PROJECT_SOURCE}
          commandLine: >
            mvn spring-boot:run -DskipTests \

            -Dspring-boot.run.jvmArguments='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y'
          group:
            kind: run
            isDefault: true
      - id: run-with-mysql
        exec:
          component: tools
          workingDir: ${PROJECT_SOURCE}
          commandLine: >
            mvn spring-boot:run -DskipTests -Dspring-boot.run.profiles=mysql \

            -Dspring-boot.run.jvmArguments='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y'
          group:
            kind: run
            isDefault: true
    projects:
      - name: java-spring-petclinic
        git:
          remotes:
            origin: https://github.com/che-samples/java-spring-petclinic.git
          checkoutFrom:
            revision: main
  contributions:
    - name: editor
      kubernetes:
        name: che-idea-spring-petclinic

The workspace was failed:

NAME               DEVWORKSPACE ID             PHASE    INFO
spring-petclinic   workspace8b96e1d2e73b4970   Failed   devworkspace failed to progress past phase 'Starting' for longer than timeout (5m)

by checking status of the devworkspace: kubectl get devworkspace -n che-kube-admin-che-caxqov, I see that the editor wasn't started:

kubectl get devworkspace -n che-kube-admin-che-caxqov
NAME               DEVWORKSPACE ID             PHASE      INFO
spring-petclinic   workspace8b96e1d2e73b4970   Starting   Waiting for editor to start

Did I miss something?

@nickboldt
Copy link
Member

If this depends on eclipse-che/che#21738 then we might have more to do before it's safe to merge in 3.x.

Planned for 3.6 / 7.61, it seems.

@svor
Copy link
Contributor

svor commented Feb 2, 2023

I don't see how it could be related to eclipse-che/che#21738, I don't use the dashboard to start a workspace.

Copy link
Contributor

@svor svor left a comment

Choose a reason for hiding this comment

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

screenshot-workspace8448efabbdbb42f7 apps ci-ln-xc5bgnb-76ef8 aws-2 ci openshift org-2023 02 03-00_50_03

@svor svor merged commit 53f0e82 into devspaces-3-rhel-8 Feb 2, 2023
@svor svor deleted the allow-container-contributions branch February 2, 2023 23:04
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.

3 participants