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

Support composite commands #3338

Closed
3 tasks
elsony opened this issue Jun 11, 2020 · 4 comments · Fixed by #3551
Closed
3 tasks

Support composite commands #3338

elsony opened this issue Jun 11, 2020 · 4 comments · Fixed by #3551
Assignees
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. kind/user-story An issue of user-story kind

Comments

@elsony
Copy link

elsony commented Jun 11, 2020

/kind user-story

User Story

As a stack creator, I want to define composite commands to chain multiple commands together when running in odo.

Acceptance Criteria

  • It should follow the corresponding settings specified in the devfile 2.0 specification: Composite commands label and id devfile/api#18
  • It should support running composite command for all command groups that odo supports, e.g. build, run, etc.
  • If parallel flag is set to true, the commands should be executed sequentially based on the order specified in the composite command; otherwise, the command will be executed in parallel.

This item will only cover the composite command for the build, not including the run command.

Links

/kind user-story
/area devfile
/area devfilev2

@openshift-ci-robot openshift-ci-robot added kind/user-story An issue of user-story kind area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. area/devfileV2 labels Jun 11, 2020
@johnmcollier
Copy link
Member

Sample Devfile 2.0 with composite commands:

schemaVersion: 2.0.0
metadata:
  name: openLiberty
  version: 1.0.0
  description: Java application stack using Open Liberty runtime
projects:
  - name: user-app
    git:
      location: 'https://github.com/odo-devfiles/openliberty-ex.git'
      branch: master
components:
  - chePlugin:
      id: redhat/java/latest
      memoryLimit: 1512Mi
  - container:
      name: appsodyrun
      image: 'ajymau/java-openliberty-dev:latest'
      memoryLimit: 1024Mi
      mountSources: true
      endpoints:
        - name: 9080/tcp
          configuration:
            discoverable: false
            public: true
            protocol: tcp
            scheme: http
          targetPort: 9080
      env:
        - name: MODE2
          value: TEST2
        - name: myprop2
          value: myval2
commands:
  - exec:
      id: build
      component: appsodyrun
      commandLine: mvn -DhotTests=true -DappsDirectory=apps -Dmaven.repo.local=/mvn/repository liberty:dev
      workingDir: /projects/user-app
      attributes:
        restart: "false"
      group:
        kind: run
        isDefault: true
   - exec:
       id: run
       commandLine: "./run.sh"
       component: tooling
       group: 
          kind: run
   - composite:
       id: buildAndRun
       label: Build and Run
       commands:
         - build
         - run
       parallel: false
       group: 
          kind: run

Based on the second point, it sounds like this PR depends on support for command groups in devfiles (#2938)

@johnmcollier
Copy link
Member

Some questions on composite commands that I couldn't find answers for in the schema:

  1. Can a composite command reference other composite commands?
  2. When parallel: true, does odo need to wait for all of the commands to finish executing?
  3. If yes to 2, do we wait indefinitely or should there be a timeout?

@elsony
Copy link
Author

elsony commented Jun 23, 2020

  1. Yes, from spec perspective, there is nothing prevent someone to reference a composite command to another composite command
  2. yes
  3. Similar to push command today, there is no timeout for command execution.

@johnmcollier
Copy link
Member

@kadel Based on our discussion on the odo contributor's call on Tuesday about composite run commands, @elsony and I chatted and we decided to scope this story down to just suppoorting composite build/init/test commands, rather than partially supporting non-long running composite commands.

We'll open up a separate story for suppoorting composite run commands (both long running and non-long running)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. kind/user-story An issue of user-story kind
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants