[FOLIO-1111] Add Docker-based launch descriptors to module descriptor templates Created: 07/Mar/18  Updated: 12/Nov/18  Resolved: 13/Mar/18

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Task Priority: P2
Reporter: Wayne Schneider Assignee: John Malconian
Resolution: Done Votes: 0
Labels: ci, core, sprint34
Remaining Estimate: Not Specified
Time Spent: 3 hours, 15 minutes
Original estimate: Not Specified

Issue links:
Blocks
blocks FOLIO-1043 integrate ui-testing with PR Closed
Relates
relates to FOLIO-1116 Disable Jenkins release jobs for back... Closed
Sprint:

 Description   

This would be very useful for auto-deployment. Assumption is that launch descriptors in module descriptors would be overridden by launch descriptors in deployment descriptors.



 Comments   
Comment by John Malconian [ 07/Mar/18 ]

mod-authtoken
mod-circulation
mod-circulation-storage
mod-codex-ekb
mod-codex-inventory
mod-codex-mux
mod-configuration
mod-finance
mod-feesfines
mod-graphql
mod-inventory
mod-inventory-storage
mod-kb-ebsco
mod-login
mod-login-saml
mod-notes
mod-notify
mod-orders
mod-permissions
mod-user-bl
mod-user-import
mod-users
mod-vendor

Wayne Schneider I'm going to start with the first twelve on this list (up to and including mod-inventory-storage)

Comment by John Malconian [ 07/Mar/18 ]

Based on discussions with Wayne Schneider, the agreed upon approach is to update the Module Descriptor template for each backend module to include a docker-based launch descriptor. The launch descriptor should be docker repository agnostic and 'dockerPull' should be set to 'false' by default. The FOLIO CI system will then take the generated Module Descriptor and add the correct docker repository ('folioci' for snapshot releases or 'folioorg' for non snapshot releases and change dockerPull to 'true' before posting to 'folio-registry'. Some work needs to be done in the CI before making these changes to the MD templates.

Example of new MD template with launch descriptor:

{
  "id": "${artifactId}-${version}",
  "name": "authtoken",
  "provides": [
    {
      "id": "authtoken",
      "version": "1.2",
      "handlers" : [
        {
          "methods" : [ "POST" ],
          "pathPattern" : "/token"
        }
      ]
    }
  ],
  "filters" : [
    {
      "methods" : [ "*" ],
      "pathPattern" : "/*",
      "phase" : "auth",
      "type" : "headers",
      "modulePermissions" : [ "perms.users.get" ]
    }
  ],
  "launchDescriptor": {
    "dockerImage": "${artifactId}:${version}",
    "dockerArgs": {
      "HostConfig": { "PortBindings": { "8081/tcp":  [{ "HostPort": "%p" }] } } 
    },
    "dockerPull" : false
  }
}

Comment by John Malconian [ 07/Mar/18 ]

Bumping this to P2 since it will make module deployment easier for CI tests ( FOLIO-1043 Closed ).

Comment by Adam Dickmeiss [ 08/Mar/18 ]

A lot of modules to be updated We was discussing this morning that a neat and "dynamic" way to achive the same would be that the install method could take a launchDescriptor in the POST .. Thus, autoDeploy would use that. This is more "last" minute and more flexible but will only work if all modules have same Docker Launch.. Substition would have to take place by Okapi.. Eg:

"launchDescriptor": {
    "dockerImage": "$m:$v",
    "dockerArgs": {
      "HostConfig: { "PortBindings": { "8081/tcp":  [{ "HostPort": "%p" }] } } 
    },
    "dockerPull" : false
  }

Here $m and $v is the module name and version from the the Module ID content (that was subsituted long time ago).

Doing it this way COULD be a faster way to achieve this.. than updating all those modules. And I think more flexible.

Comment by Wayne Schneider [ 08/Mar/18 ]

This would require all modules to have the same dockerArgs (and env and dockerCMD), which I think actually limits flexibility a bit. For example, right now there are (I think) 2 modules – mod-inventory and mod-circulation – that need the port binding on a different port than 8081.

Comment by John Malconian [ 09/Mar/18 ]

I've completed a big chuck of the work in CI in order to support this change ( FOLIO-1112 Closed ) and have proceeded with adding the launch descriptor as described above to mod-authtoken. Other modules in the list to follow. There are a couple of outlier modules that will require some special attention - mod-graphql and mod-kb-ebsco. I suggest we leave these for last.

Comment by John Malconian [ 13/Mar/18 ]

All modules list above now have a launch descriptor appended to their respective module descriptor templates on the master branch and generated module descriptors have been posted to folio-registry.

Generated at Thu Feb 08 23:10:55 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.