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

odo dev: Add support for non-exec commands part of a composite run or debug command #5832

Closed
2 tasks
rm3l opened this issue Jun 15, 2022 · 1 comment · Fixed by #5923
Closed
2 tasks

odo dev: Add support for non-exec commands part of a composite run or debug command #5832

rm3l opened this issue Jun 15, 2022 · 1 comment · Fixed by #5923
Assignees
Labels
kind/user-story An issue of user-story kind priority/Medium Nice to have issue. Getting it done before priority changes would be great.

Comments

@rm3l
Copy link
Member

rm3l commented Jun 15, 2022

User Story

  • As an odo user
  • Now that I am able to run commands that are composite (thanks to Add support for composite run commands #5054)
  • I want to be able to include non-exec commands(apply command) as part of my composite run or debug command
  • So that I can perform additional operations, like applying other component definitions (e.g., for building and pushing images, creating other Kubernetes resources, ...)

Acceptance Criteria

  • odo dev should run all the commands part of the composite run command
  • odo dev --debug should run all the commands part of the composite debug command

Example

schemaVersion: 2.2.0
metadata:
  name: nodejs
variables:
  CONTAINER_IMAGE: quay.io/unknown-account/myimage

components:
  - container:
      endpoints:
        - name: http-3000
          targetPort: 3000
      image: registry.access.redhat.com/ubi8/nodejs-14:latest
    name: runtime

  - name: image-build-component
    image:
      imageName: "{{CONTAINER_IMAGE}}"
      dockerfile:
        uri: ./Dockerfile

  - name: my-k8s-resource
    kubernetes:
      # Resource potentially referencing the 'CONTAINER_IMAGE' variable.
      # Might be inlined as well.
      uri: 'k8s/my-resource.yaml'

commands:
  - id: build-image
    apply:
      component: image-build-component

  - id: create-k8s-resource
    apply:
      component: my-k8s-resource

  - id: install
    exec:
      commandLine: npm install
      component: runtime
      workingDir: /projects

  - id: start
    exec:
      workingDir: /projects
      commandLine: npm start
      component: runtime

  - id: run
    composite:
      commands:
        - build-image
        - create-k8s-resource
        - install
        - start
      group:
        isDefault: true
        kind: run

Links

/kind user-story

@openshift-ci openshift-ci bot added the kind/user-story An issue of user-story kind label Jun 15, 2022
@kadel kadel added this to the v3.0.0-beta2 milestone Jun 15, 2022
@kadel kadel added the priority/Medium Nice to have issue. Getting it done before priority changes would be great. label Jun 15, 2022
@kadel kadel removed this from the v3.0.0-beta2 milestone Jun 22, 2022
@valaparthvi valaparthvi moved this to In Progress in odo v3-beta2 Jul 6, 2022
@valaparthvi valaparthvi moved this from In Progress to For review in odo v3-beta2 Jul 18, 2022
@valaparthvi
Copy link
Contributor

@feloy I'm wondering if we'll need to add additional watchers for the resources deployed using the apply command here.

Repository owner moved this from For review to Done in odo v3-beta2 Aug 10, 2022
@rm3l rm3l added the v3 label Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/user-story An issue of user-story kind priority/Medium Nice to have issue. Getting it done before priority changes would be great.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants