Skip to content

Docker Engines

diamond_dragon edited this page Apr 28, 2021 · 3 revisions

Docker Engine Manifest

Template of Docker Engine manifest can be created using the following command:

CodeReview.Orchestrator.exe new-engine-collection -o docker.yaml

File created by this command may look as follows:

defaultEngine: default
engines:
  default:
    os: Linux
    url: unix:///var/run/docker.sock
    workerImage: alpine
    features:
    - feature1
    - feature2
  windows:
    os: Windows
    url: npipe:////./pipe/docker_engine
    workerImage: alpine
    features:
    - feature1
    - feature2
  remote:
    os: Windows
    url: http://remote.api:2375/
    workerImage: alpine
    features:
    - feature1
    - feature2

engines section contains array of Docker Engines which can be used for workflow execution. defaultEngine property specifies which engine is used by default if no requirements specified by activity.

The following table describes properties of Docker Engine:

Property Description
os Specifies type operating host operating system of Docker Engine. Possition options are Linux or Windows.
url Url point to Docker Engine REST API endpoint. This can be local services like unix:///var/run/docker.sock ( npipe:////./pipe/docker_engine for Windows) or remote endpoint http://remote.api:2375/
workerImage Helper Docker Image used to create lighweight container for services activities. This kind of activities are related to import\export operations of Docker Volumes (there is no way to export content of volume without creating container). Linux images use alpine image. Windows containes can use microsoft.com/windows/nanoserver.` IMPORTANT: It's important to use version of images which matches host operating system build number.
features List of tags supported by Docker Engine. Each workflow activity may have requirements which needs to be satisfied by Docker Engine. E.g. requirements specified in activity need to available in Docker Engine. If requirements can't be satisfied workflow execution error is thrown.

Example

Let's assume the following worflow manifest manifest is used:

activities:
  git:
    image: dragon/jetbrains
    requirements:
      os: Linux
      features:
      - feature1
  resharper:
    image: dragon/jetbrains
    requirements:
      os: Windows
      features:
      - feature2
      - feature3
  roslyn:
    image: dragon/roslyn

The following Docker Engine manifest was provided:

defaultEngine: default
engines:
  default:
    os: Linux
    url: unix:///var/run/docker.sock
    workerImage: alpine
    features:
    - feature1
    - feature2
  windows:
    os: Windows
    url: npipe:////./pipe/docker_engine
    workerImage: alpine
    features:
    - feature2
    - feature3

Execution flow is going to look as follows:

  1. git activity is executed using default Docker Engine. This engine matches requirements of activity (os = Linux and features = feature1).
  2. Content of volumes is exported to local temporary folder. This happens because next activity can't be executed on current Docker Engine. Volumes are destored on default Docker Engine.
  3. Volumes are created on windows Docker Engine. Volumes are initializes with data exported during step 2.
  4. resharper activity is executed using windows Docker Engine. This engine satisfies requirements of activity (os = Windows and features in (feature2, feature3)).
  5. Content of volumes is exported to local temporary folder. This happens because next activity can't be executed on current Docker Engine. Volumes are destored on windows Docker Engine.
  6. Volumes are created on default Docker Engine. Volumes are initializes with data exported during step 5.
  7. roslyn activity is executed using default Docker Engine because no specific requirements was specified for activity.

NOTE: Any activity without requirements specified is executed using default Docker Engine. Acivity having requirements specified is executed using matching Docker Engine. If multiple Docker Engines were found and one of them was current Docker Engine current engine is used.

Clone this wiki locally