Skip to content

Exec command for deploy does not support volumeMounts or mounts PROJECT_SOURCE #6658

Open
@valaparthvi

Description

/kind bug

What versions of software are you using?

Operating System:
Darwin

Output of odo version:
odo v3.7.0 (c3c3605)

How did you run odo exactly?

  1. git clone https://github.com/ehsavoie/numberguess.git
  2. git checkout odo
  3. odo deploy
devfile.yaml
schemaVersion: 2.2.0
metadata:
  name: java-wildfly-numberguess
  version: 2.0.0
  website: https://wildfly.org
  displayName: WildFly Java Numberguess
  description: Upstream WildFly
  icon: https://design.jboss.org/wildfly/logo/final/wildfly_logomark.svg
  tags: ['Java', 'WildFly']
  projectType: 'wildfly'
  language: 'java'
attributes:
  controller.devfile.io/storage-type: ephemeral
  .vscode/extensions.json: |
    {
      "recommendations": [
        "redhat.java",
        "vscjava.vscode-java-debug",
        "vscjava.vscode-java-test",
        "redhat.fabric8-analytics"
      ]
    }
  .che/che-theia-plugins.yaml: |
    - id: redhat/java
components:
  - name: wildfly
    container:
      image: quay.io/wildfly/wildfly-s2i:latest
      memoryLimit: 1512Mi
      mountSources: true
      volumeMounts:
        - name: m2-repository
          path: /home/jboss/.m2/repository
      env:
        - name: GC_METASPACE_SIZE
          value: '96'
        - name: JAVA_OPTS
          value: '-Djava.security.egd=file:/dev/urandom'
        - name: MVN_ARGS_APPEND
          value: '-s /home/jboss/.m2/settings.xml -Dmaven.repo.local=/home/jboss/.m2/repository -Dcom.redhat.xpaas.repo.jbossorg'
        - name: DEBUG_PORT
          value: "5005"
      endpoints:
        - name: debug
          exposure: internal
          protocol: tcp
          targetPort: 5005
        - name: 'http'
          protocol: http
          targetPort: 8080
          exposure: public
        - name: 'management'
          targetPort: 9990
          protocol: http
          exposure: internal
        - name: 'transaction'
          protocol: tcp
          targetPort: 4172
          exposure: internal
  - name: tools
    container:
      image: quay.io/devfile/universal-developer-image:ubi8-latest
      memoryLimit: 1512Mi
      mountSources: true
      env:
        - name: OPENSHIFT_IMAGE_REGISTRY
          value: "image-registry.openshift-image-registry.svc:5000"
        - name: IMAGE
          value: "numberguess"
  - name: m2-repository
    volume:
      size: 3Gi
commands:
  - id: init-server
    exec:
      label: "Init the server"
      component: wildfly
      commandLine: mvn ${MVN_ARGS_APPEND} -Pprovisioned-server -Dwildfly.javaOpts="-Djboss.node.name=numberguess -agentlib:jdwp=transport=dt_socket,address=0.0.0.0:${DEBUG_PORT},server=y,suspend=n" clean package org.wildfly.plugins:wildfly-maven-plugin:start
      workingDir: ${PROJECT_SOURCE}
      group:
        kind: run
        isDefault: false
  - id: debug
    exec:
      label: "Package and start the application in debug mode."
      component: wildfly
      commandLine: mvn ${MVN_ARGS_APPEND} -Pprovisioned-server -Dwildfly.javaOpts="-Djboss.node.name=numberguess -agentlib:jdwp=transport=dt_socket,address=0.0.0.0:${DEBUG_PORT},server=y,suspend=n" clean package org.wildfly.plugins:wildfly-maven-plugin:run
      workingDir: ${PROJECT_SOURCE}
      group:
        kind: debug
        isDefault: true
  - id: package
    exec:
      label: "Build the application."
      component: wildfly
      commandLine: mvn ${MVN_ARGS_APPEND} -Pprovisioned-server package
      workingDir: ${PROJECT_SOURCE}
      group:
        kind: build
        isDefault: true
  - id: deploy
    exec:
      label: "Build the application."
      component: wildfly
      commandLine: mvn ${MVN_ARGS_APPEND} -Popenshift -Dmaven.test.skip=true clean package
      workingDir: ${PROJECT_SOURCE}
      group:
        kind: run
        isDefault: true
  - id: outerloop-deploy
    composite:
      commands:
            - openshift-build
            - openshift-registry-login
            - build-runtime-image
            - push-image
            - deploy-image
      parallel: false
      label: "Build and deploy the application on Openshift."
      group:
          kind: deploy
          isDefault: true
  - id: openshift-build
    exec:
      label: "1 Build the application for OpenShift."
      component: wildfly
      commandLine: mvn ${MVN_ARGS_APPEND} -Popenshift -Dmaven.test.skip=true clean package
      workingDir: ${PROJECT_SOURCE}
  - id: openshift-registry-login
    exec:
      label: "2 Login into OpenShift registry."
      component: tools
      commandLine: podman login --tls-verify=false -u kubeadmin -p $(oc whoami -t) ${OPENSHIFT_IMAGE_REGISTRY} && oc login --token=$(oc whoami -t)
      workingDir: ${PROJECT_SOURCE}
  - id: build-runtime-image
    exec:
      label: "3 Build Runtime Image for Openshift."
      component: tools
      commandLine: "export OPENSHIFT_NS=$(oc project -q) && podman build -f Containerfile -t ${OPENSHIFT_IMAGE_REGISTRY}/${OPENSHIFT_NS}/${IMAGE} ."
      workingDir: ${PROJECT_SOURCE}
  - id: push-image
    exec:
      label: "4 Push Image into OpenShift registry."
      component: tools
      workingDir: ${PROJECT_SOURCE}
      commandLine: "export OPENSHIFT_NS=$(oc project -q) && podman tag ${OPENSHIFT_IMAGE_REGISTRY}/${OPENSHIFT_NS}/${IMAGE} ${OPENSHIFT_IMAGE_REGISTRY}/${OPENSHIFT_NS}/${IMAGE}:latest && podman push --tls-verify=false ${OPENSHIFT_IMAGE_REGISTRY}/${OPENSHIFT_NS}/${IMAGE}:latest"
  - id: deploy-image
    exec:
      label: "5 Deploy Image into OpenShift."
      component: tools
      workingDir: ${PROJECT_SOURCE}
      commandLine: "helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ && oc set image-lookup ${IMAGE} && helm install ${IMAGE} -f charts/helm.yaml --set build.enabled=false --set image.name=${IMAGE} wildfly/wildfly"
events:
  postStart:
    - 'init-server'
Containerfile
FROM quay.io/wildfly/wildfly-runtime:latest
COPY --chown=jboss:root target/server $JBOSS_HOME
RUN chmod -R ug+rwX $JBOSS_HOME 

Actual behavior

The command fails, but if you check the pod definition for job that runs exec command, there is no reference to volume mounts used by wildfly container component.

Expected behavior

If volume mounts were supported, it might be possible to successfully run odo deploy on the devfile.

Any logs, error output, etc?

/bin/sh: line 0: cd: /projects: No such file or directory

Metadata

Assignees

No one assigned

    Labels

    area/deployIssues or PRs specific to the `odo deploy` commandkind/bugCategorizes issue or PR as related to a bug.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/MediumNice to have issue. Getting it done before priority changes would be great.

    Type

    No type

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions